This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch : remove EH dependance on DWARF2_ADDR_SIZE
- To: gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Subject: patch : remove EH dependance on DWARF2_ADDR_SIZE
- From: Andrew Macleod <amacleod at cygnus dot com>
- Date: Wed, 4 Apr 2001 13:55:29 -0700
Its possible for an architecture to define DWARF2_ADDR_SIZE to be larger
than a pointer. When this happens, the EH tables no longer align with
the compilers data structures since all addresses are emitted
using DWARF2_ADDR_SIZE. For EH tables, we'll use PTR_SIZE instead of
DWARF2_ADDR_SIZE. IF we don't do it this way, we have to adjust the
size of the data in our runtime structures to be the size of
DWARF2_ADDR_SIZE instead of using pointers. That seems uglier....
I've verified this by bootstrapping on an x86 with the default definitions, and
also by setting DWARF2_ADDR_SIZE to 32 to verify the EH tables are no longer
dependant on DWARF2_ADDR_SIZE.
Andrew
2001-04-04 Andrew MacLeod <amacleod@redhat.com>
* dwarf2out.c (output_cfi): Add 'for_eh' parameter, use PTR_SIZE
instead of DWARF2_ADDR_SIZE for EH addresses.
(output_call_frame_info): Use PTR_SIZE instead of DWARF2_ADDR_SIZE for
EH addresses.
*** dwarf2out.c.orig Wed Apr 4 09:26:02 2001
--- dwarf2out.c Wed Apr 4 14:33:00 2001
*************** output_cfi (cfi, fde, for_eh)
*** 1622,1628 ****
switch (cfi->dw_cfi_opc)
{
case DW_CFA_set_loc:
! dw2_asm_output_addr (DWARF2_ADDR_SIZE,
cfi->dw_cfi_oprnd1.dw_cfi_addr, NULL);
break;
case DW_CFA_advance_loc1:
--- 1622,1628 ----
switch (cfi->dw_cfi_opc)
{
case DW_CFA_set_loc:
! dw2_asm_output_addr ((for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE),
cfi->dw_cfi_oprnd1.dw_cfi_addr, NULL);
break;
case DW_CFA_advance_loc1:
*************** output_call_frame_info (for_eh)
*** 1718,1724 ****
tree label = get_file_function_name ('F');
force_data_section ();
! ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (DWARF2_ADDR_SIZE));
ASM_GLOBALIZE_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
ASM_OUTPUT_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
#endif
--- 1718,1724 ----
tree label = get_file_function_name ('F');
force_data_section ();
! ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
ASM_GLOBALIZE_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
ASM_OUTPUT_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
#endif
*************** output_call_frame_info (for_eh)
*** 1769,1787 ****
if (augmentation[0])
{
! dw2_asm_output_data_uleb128 (DWARF2_ADDR_SIZE, "Augmentation size");
if (eh_personality_libfunc)
! dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE, eh_personality_libfunc,
"Personality");
else
! dw2_asm_output_data (DWARF2_ADDR_SIZE, 0, "Personality (none)");
}
for (cfi = cie_cfi_head; cfi != NULL; cfi = cfi->dw_cfi_next)
output_cfi (cfi, NULL, for_eh);
/* Pad the CIE out to an address sized boundary. */
! ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (DWARF2_ADDR_SIZE));
ASM_OUTPUT_LABEL (asm_out_file, l2);
/* Loop through all of the FDE's. */
--- 1769,1788 ----
if (augmentation[0])
{
! dw2_asm_output_data_uleb128 (PTR_SIZE, "Augmentation size");
if (eh_personality_libfunc)
! dw2_asm_output_addr_rtx (PTR_SIZE, eh_personality_libfunc,
"Personality");
else
! dw2_asm_output_data (PTR_SIZE, 0, "Personality (none)");
}
for (cfi = cie_cfi_head; cfi != NULL; cfi = cfi->dw_cfi_next)
output_cfi (cfi, NULL, for_eh);
/* Pad the CIE out to an address sized boundary. */
! ASM_OUTPUT_ALIGN (asm_out_file,
! floor_log2 (for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE));
ASM_OUTPUT_LABEL (asm_out_file, l2);
/* Loop through all of the FDE's. */
*************** output_call_frame_info (for_eh)
*** 1815,1839 ****
stripattributes (FRAME_SECTION),
"FDE CIE offset");
! dw2_asm_output_addr (DWARF2_ADDR_SIZE, fde->dw_fde_begin,
"FDE initial location");
! dw2_asm_output_delta (DWARF2_ADDR_SIZE, fde->dw_fde_end,
! fde->dw_fde_begin, "FDE address range");
if (augmentation[0])
{
! dw2_asm_output_data_uleb128 (DWARF2_ADDR_SIZE, "Augmentation size");
if (fde->uses_eh_lsda)
{
ASM_GENERATE_INTERNAL_LABEL (l1, "LLSDA", fde->funcdef_number);
! dw2_asm_output_offset (DWARF2_ADDR_SIZE, l1,
! "Language Specific Data Area");
}
else
! dw2_asm_output_data (DWARF2_ADDR_SIZE, 0,
! "Language Specific Data Area (none)");
}
/* Loop through the Call Frame Instructions associated with
--- 1816,1844 ----
stripattributes (FRAME_SECTION),
"FDE CIE offset");
! dw2_asm_output_addr ((for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE),
! fde->dw_fde_begin,
"FDE initial location");
! dw2_asm_output_delta ((for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE),
! fde->dw_fde_end,
! fde->dw_fde_begin,
! "FDE address range");
if (augmentation[0])
{
! dw2_asm_output_data_uleb128 ((for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE),
! "Augmentation size");
if (fde->uses_eh_lsda)
{
ASM_GENERATE_INTERNAL_LABEL (l1, "LLSDA", fde->funcdef_number);
! dw2_asm_output_offset ((for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE),
! l1, "Language Specific Data Area");
}
else
! dw2_asm_output_data ((for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE),
! 0, "Language Specific Data Area (none)");
}
/* Loop through the Call Frame Instructions associated with
*************** output_call_frame_info (for_eh)
*** 1843,1849 ****
output_cfi (cfi, fde, for_eh);
/* Pad the FDE out to an address sized boundary. */
! ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (DWARF2_ADDR_SIZE));
ASM_OUTPUT_LABEL (asm_out_file, l2);
}
--- 1848,1855 ----
output_cfi (cfi, fde, for_eh);
/* Pad the FDE out to an address sized boundary. */
! ASM_OUTPUT_ALIGN (asm_out_file,
! floor_log2 ((for_eh ? PTR_SIZE : DWARF2_ADDR_SIZE)));
ASM_OUTPUT_LABEL (asm_out_file, l2);
}