aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2005-12-10 00:20:16 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2005-12-10 00:20:16 +0000
commit0f67af1ce30cdee9273baa65166fabbcb6eb04b8 (patch)
tree7670fde6cf99d8c4dcfee7a32b97bae2259e7736 /gcc/dwarf2out.c
parent386e0f8c3e02ce5f2e88395c9180f0f1ad1c42fd (diff)
downloadgcc-0f67af1ce30cdee9273baa65166fabbcb6eb04b8.zip
gcc-0f67af1ce30cdee9273baa65166fabbcb6eb04b8.tar.gz
gcc-0f67af1ce30cdee9273baa65166fabbcb6eb04b8.tar.bz2
dwarf2out.c (default_eh_frame_section): Delete, moving handling of EH_FRAME_SECTION_NAME into...
* dwarf2out.c (default_eh_frame_section): Delete, moving handling of EH_FRAME_SECTION_NAME into... (switch_to_eh_frame_section): ...here. Try to set eh_frame_section if it is still null. * except.c (default_exception_section): Delete, moving most of the code to... (switch_to_exception_section): ...this new function. Set exception_section if it is still null, then switch to it. (output_function_exception_table): Use switch_to_exception_section. * varasm.c (exception_section, eh_frame_section): Update comments. (get_section): Hoist use of SECTION_NAMED. (init_varasm_once): Don't set exception_section and eh_frame_section. * output.h (default_exception_section): Delete. (default_eh_frame_section): Delete. testsuite/ * gcc.dg/20051207-1.c, * gcc.dg/20051207-2.c, * gcc.dg/20051207-3.c: New tests. From-SVN: r108336
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c70
1 files changed, 34 insertions, 36 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ba7ce83..0f52184c 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -113,42 +113,6 @@ dwarf2out_do_frame (void)
#define PTR_SIZE (POINTER_SIZE / BITS_PER_UNIT)
#endif
-/* Return the default value of eh_frame_section. Note that this function
- must appear outside the DWARF2_DEBUGGING_INFO || DWARF2_UNWIND_INFO
- macro guards. */
-
-section *
-default_eh_frame_section (void)
-{
-#ifdef EH_FRAME_SECTION_NAME
- int flags;
-
- if (EH_TABLES_CAN_BE_READ_ONLY)
- {
- int fde_encoding;
- int per_encoding;
- int lsda_encoding;
-
- fde_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/1, /*global=*/0);
- per_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2, /*global=*/1);
- lsda_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0, /*global=*/0);
- flags = (! flag_pic
- || ((fde_encoding & 0x70) != DW_EH_PE_absptr
- && (fde_encoding & 0x70) != DW_EH_PE_aligned
- && (per_encoding & 0x70) != DW_EH_PE_absptr
- && (per_encoding & 0x70) != DW_EH_PE_aligned
- && (lsda_encoding & 0x70) != DW_EH_PE_absptr
- && (lsda_encoding & 0x70) != DW_EH_PE_aligned))
- ? 0 : SECTION_WRITE;
- }
- else
- flags = SECTION_WRITE;
- return get_section (EH_FRAME_SECTION_NAME, flags, NULL);
-#else
- return NULL;
-#endif
-}
-
DEF_VEC_P(rtx);
DEF_VEC_ALLOC_P(rtx,gc);
@@ -1992,10 +1956,44 @@ switch_to_eh_frame_section (void)
{
tree label;
+#ifdef EH_FRAME_SECTION_NAME
+ if (eh_frame_section == 0)
+ {
+ int flags;
+
+ if (EH_TABLES_CAN_BE_READ_ONLY)
+ {
+ int fde_encoding;
+ int per_encoding;
+ int lsda_encoding;
+
+ fde_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/1,
+ /*global=*/0);
+ per_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2,
+ /*global=*/1);
+ lsda_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0,
+ /*global=*/0);
+ flags = ((! flag_pic
+ || ((fde_encoding & 0x70) != DW_EH_PE_absptr
+ && (fde_encoding & 0x70) != DW_EH_PE_aligned
+ && (per_encoding & 0x70) != DW_EH_PE_absptr
+ && (per_encoding & 0x70) != DW_EH_PE_aligned
+ && (lsda_encoding & 0x70) != DW_EH_PE_absptr
+ && (lsda_encoding & 0x70) != DW_EH_PE_aligned))
+ ? 0 : SECTION_WRITE);
+ }
+ else
+ flags = SECTION_WRITE;
+ eh_frame_section = get_section (EH_FRAME_SECTION_NAME, flags, NULL);
+ }
+#endif
+
if (eh_frame_section)
switch_to_section (eh_frame_section);
else
{
+ /* We have no special eh_frame section. Put the information in
+ the data section and emit special labels to guide collect2. */
switch_to_section (data_section);
label = get_file_function_name ('F');
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));