summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-26 12:34:25 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-26 12:34:25 +0000
commitd5720b0c143a166029a97908c8f4dc0b1a105b1f (patch)
treefef622cddd6570a0141f3c50a52c5ea8bcf74814 /gcc/dwarf2out.c
parent94269a900191de2d6e64670fe9e56ead256812e8 (diff)
downloadgcc-d5720b0c143a166029a97908c8f4dc0b1a105b1f.tar.gz
* varasm.c (default_exception_section): Move to...
* except.c (default_exception_section): ... here. Make .gcc_except_table read-only if it is not expected to have any dynamic relocations and linker handles it. * dwarf2out.c (default_eh_frame_section): Make .eh_frame read-only if it is not expected to have any dynamic relocations and linker handles it. * configure.in (HAVE_LD_RO_RW_SECTION_MIXING): Check what ld does when linking read-only and read-write sections together. * configure, config.in: Rebuilt. * crtstuff.c (EH_FRAME_SECTION_CONST): Define. (__EH_FRAME_BEGIN__, __FRAME_END__): Add it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59507 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index ed2a0ecd00e..2e8fe614188 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -117,7 +117,24 @@ void
default_eh_frame_section ()
{
#ifdef EH_FRAME_SECTION_NAME
+#ifdef HAVE_LD_RO_RW_SECTION_MIXING
+ int fde_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/1, /*global=*/0);
+ int per_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2, /*global=*/1);
+ int lsda_encoding = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0, /*global=*/0);
+ int flags;
+
+ 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;
+ named_section_flags (EH_FRAME_SECTION_NAME, flags);
+#else
named_section_flags (EH_FRAME_SECTION_NAME, SECTION_WRITE);
+#endif
#else
tree label = get_file_function_name ('F');