[patch gas/ld]: Handle cfi generated segments for link-once text segments

Kai Tietz ktietz70@googlemail.com
Mon Feb 28 10:08:00 GMT 2011


Hello,

this patch does some optimization for cfi and eh_frame/debug for use
in link-once segments.

ChangeLog gas/

2011-02-28  Kai Tietz

	* dw2gencfi.c (dwcfi_seg_list): New struct.
	(dwcfi_hash): New static hash variable.
	(get_debugseg_name): New.
	(alloc_debugseg_item): New.
	(make_debug_seg): New.
	(dwcfi_hash_insert): New.
	(dwcfi_hash_find): New.
	(dwcfi_hash_find_or_make): New.
	(fde_entry): New cseg member.
	(alloc_fde_entry): Initialize cseg member.
	(dot_cfi_sections): Compare for beginning of
	section names via strncmp.
	(get_cfi_seg): New.
	(cfi_finish): Treat link-once sections.
	* ehopt.c (get_cie_info): Use strncmp for
	section name matching.
	(heck_eh_frame): Likewise.

ChangeLog ld/

2011-02-28  Kai Tietz

	* scripttempl/alphavms.sc: Handle .eh_frame($|.)* sections.
	* scripttempl/armbpabi.sc: Likewise.
	* scripttempl/avr.sc: Likewise.
	* scripttempl/crisaout.sc: Likewise.
	* scripttempl/elf.sc: Likewise.
	* scripttempl/elf32cr16.sc: Likewise.
	* scripttempl/elf32crx.sc: Likewise.
	* scripttempl/elf32msp430.sc: Likewise.
	* scripttempl/elf32msp430_3.sc: Likewise.
	* scripttempl/elf32sh-symbian.sc: Likewise.
	* scripttempl/elf64hppa.sc: Likewise.
	* scripttempl/elf_chaos.sc: Likewise.
	* scripttempl/elfd10v.sc: Likewise.
	* scripttempl/elfd30v.sc: Likewise.
	* scripttempl/elfi370.sc: Likewise.
	* scripttempl/elfm68hc11.sc: Likewise.
	* scripttempl/elfm68hc12.sc: Likewise.
	* scripttempl/elfmicroblaze.sc: Likewise.
	* scripttempl/elfxtensa.sc: Likewise.
	* scripttempl/epocpe.sc: Likewise.
	* scripttempl/i386beos.sc: Likewise.
	* scripttempl/i386go32.sc: Likewise.
	* scripttempl/ip2k.sc: Likewise.
	* scripttempl/iq2000.sc: Likewise.
	* scripttempl/mcorepe.sc: Likewise.
	* scripttempl/mep.sc: Likewise.
	* scripttempl/mmo.sc: Likewise.
	* scripttempl/pe.sc: Likewise.
	* scripttempl/pep.sc: Likewise.
	* scripttempl/v850.sc: Likewise.
	* scripttempl/xstormy16.sc: Likewise.

Tested for x86_64-w64-mingw32, i686-pc-cygwin, and
x86_64-pc-linux-gnu. Ok for apply?

Regards,
Kai
-------------- next part --------------
Index: src/gas/dw2gencfi.c
===================================================================
--- src.orig/gas/dw2gencfi.c	2011-02-26 23:07:28.654909100 +0100
+++ src/gas/dw2gencfi.c	2011-02-28 10:53:20.559347300 +0100
@@ -76,6 +76,136 @@
 # define DWARF2_ADDR_SIZE(bfd) (bfd_arch_bits_per_address (bfd) / 8)
 #endif
 
+/* Private segment collection list.  */
+struct dwcfi_seg_list {
+  segT seg;
+  int subseg;
+  char *seg_name;
+};
+
+static struct hash_control *dwcfi_hash;
+
+/* Build based on segment the derived .debug_...
+   segment name containing origin segment's postfix name part.  */
+static char *
+get_debugseg_name (segT seg, const char *base_name)
+{
+  const char *name,*dollar, *dot;
+  char *sname;
+
+  if (!seg)
+    name = "";
+  else
+    name = bfd_get_section_name (stdoutput, seg);
+
+  dollar = strchr (name, '$');
+  dot = strchr (name + 1, '.');
+
+  if (!dollar && !dot)
+    name = "";
+  else if (!dollar)
+    name = dot;
+  else if (!dot)
+    name = dollar;
+  else if (dot < dollar)
+    name = dot;
+  else
+    name = dollar;
+
+  sname = concat (base_name, name, NULL);
+
+  return sname;
+}
+
+/* Allocate a dwcfi_seg_list structure.  */
+static struct dwcfi_seg_list *
+alloc_debugseg_item (segT seg, int subseg, char *name)
+{
+  struct dwcfi_seg_list *r;
+
+  r = (struct dwcfi_seg_list *)
+    xmalloc (sizeof (struct dwcfi_seg_list) + strlen (name));
+  r->seg = seg;
+  r->subseg = subseg;
+  r->seg_name = name;
+  return r;
+}
+
+/* Generate debug... segment with same linkonce properties
+   of based segment.  */
+static segT
+make_debug_seg (segT cseg, char *name, int sflags)
+{
+  segT save_seg = now_seg;
+  int save_subseg = now_subseg;
+  segT r;
+  flagword flags;
+
+  r = subseg_new (name, 0);
+  /* Check if code segment is marked as linked once.  */
+  if (!cseg)
+    flags = 0;
+  else
+    flags = bfd_get_section_flags (stdoutput, cseg)
+      & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
+         | SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
+         | SEC_LINK_DUPLICATES_SAME_CONTENTS);
+
+  /* Add standard section flags.  */
+  flags |= sflags;
+
+  /* Apply possibly linked once flags to new generated segment, too.  */
+  if (!bfd_set_section_flags (stdoutput, r, flags))
+    as_bad (_("bfd_set_section_flags: %s"),
+	    bfd_errmsg (bfd_get_error ()));
+
+  /* Restore to previous segment.  */
+  if (save_seg != NULL)
+    subseg_set (save_seg, save_subseg);
+  return r;
+}
+
+static void
+dwcfi_hash_insert (const char *name, struct dwcfi_seg_list *item)
+{
+  const char *error_string;
+
+  if ((error_string = hash_jam (dwcfi_hash, name, (char *) item)))
+    as_fatal (_("Inserting \"%s\" into structure table failed: %s"),
+	      name, error_string);
+}
+
+static struct dwcfi_seg_list *
+dwcfi_hash_find (char *name)
+{
+  return (struct dwcfi_seg_list *) hash_find (dwcfi_hash, name);
+}
+
+static struct dwcfi_seg_list *
+dwcfi_hash_find_or_make (segT cseg, const char *base_name, int flags)
+{
+  struct dwcfi_seg_list *item;
+  char *name;
+
+  /* Initialize dwcfi_hash once.  */
+  if (!dwcfi_hash)
+    dwcfi_hash = hash_new ();
+
+  name = get_debugseg_name (cseg, base_name);
+
+  item = dwcfi_hash_find (name);
+  if (!item)
+    {
+      item = alloc_debugseg_item (make_debug_seg (cseg, name, flags), 0, name);
+
+      dwcfi_hash_insert (item->seg_name, item);
+    }
+  else
+    free (name);
+
+  return item;
+}
+
 /* ??? Share this with dwarf2cfg.c.  */
 #ifndef TC_DWARF2_EMIT_OFFSET
 #define TC_DWARF2_EMIT_OFFSET  generic_dwarf2_emit_offset
@@ -134,6 +264,7 @@ struct cfi_insn_data
 struct fde_entry
 {
   struct fde_entry *next;
+  segT cseg;
   symbolS *start_address;
   symbolS *end_address;
   struct cfi_insn_data *data;
@@ -195,7 +326,7 @@ alloc_fde_entry (void)
   frchain_now->frch_cfi_data->cur_fde_data = fde;
   *last_fde_data = fde;
   last_fde_data = &fde->next;
-
+  fde->cseg = now_seg;
   fde->last = &fde->data;
   fde->return_column = DWARF2_DEFAULT_RETURN_COLUMN;
   fde->per_encoding = DW_EH_PE_omit;
@@ -916,9 +1047,9 @@ dot_cfi_sections (int ignored ATTRIBUTE_
 	name = input_line_pointer;
 	c = get_symbol_end ();
 
-	if (strcmp (name, ".eh_frame") == 0)
+	if (strncmp (name, ".eh_frame", 9) == 0)
 	  sections |= CFI_EMIT_eh_frame;
-	else if (strcmp (name, ".debug_frame") == 0)
+	else if (strncmp (name, ".debug_frame", 12) == 0)
 	  sections |= CFI_EMIT_debug_frame;
 	else
 	  {
@@ -1671,6 +1802,18 @@ cfi_change_reg_numbers (struct cfi_insn_
 #define cfi_change_reg_numbers(insn) do { } while (0)
 #endif
 
+static segT
+get_cfi_seg (segT cseg, const char *base, flagword flags, int align)
+{
+  struct dwcfi_seg_list *l;
+
+  l = dwcfi_hash_find_or_make (cseg, base, flags);
+
+  subseg_set (l->seg, l->subseg);
+  record_alignment (l->seg, align);
+  return l->seg;
+}
+
 void
 cfi_finish (void)
 {
@@ -1683,14 +1826,10 @@ cfi_finish (void)
 
   if ((cfi_sections & CFI_EMIT_eh_frame) != 0)
     {
-      /* Open .eh_frame section.  */
-      cfi_seg = subseg_new (".eh_frame", 0);
-      bfd_set_section_flags (stdoutput, cfi_seg,
+      cfi_seg = get_cfi_seg (NULL, ".eh_frame",
 			     SEC_ALLOC | SEC_LOAD | SEC_DATA
-			     | DWARF2_EH_FRAME_READ_ONLY);
-      subseg_set (cfi_seg, 0);
-      record_alignment (cfi_seg, EH_FRAME_ALIGNMENT);
-
+			     | DWARF2_EH_FRAME_READ_ONLY,
+			     EH_FRAME_ALIGNMENT);
 #ifdef md_fix_up_eh_frame
       md_fix_up_eh_frame (cfi_seg);
 #endif
@@ -1703,6 +1842,13 @@ cfi_finish (void)
 	{
 	  struct cfi_insn_data *first;
 	  struct cie_entry *cie;
+	  cfi_seg = get_cfi_seg (fde->cseg, ".eh_frame",
+				 SEC_ALLOC | SEC_LOAD | SEC_DATA
+				 | DWARF2_EH_FRAME_READ_ONLY,
+				 EH_FRAME_ALIGNMENT);
+#ifdef md_fix_up_eh_frame
+	  md_fix_up_eh_frame (cfi_seg);
+#endif
 
 	  if (fde->end_address == NULL)
 	    {
@@ -1731,16 +1877,17 @@ cfi_finish (void)
       cie_root = NULL;
 
       /* Open .debug_frame section.  */
-      cfi_seg = subseg_new (".debug_frame", 0);
-      bfd_set_section_flags (stdoutput, cfi_seg,
-			     SEC_READONLY | SEC_DEBUGGING);
-      subseg_set (cfi_seg, 0);
-      record_alignment (cfi_seg, alignment);
+      cfi_seg = get_cfi_seg (NULL, ".debug_frame",
+			     SEC_READONLY | SEC_DEBUGGING,
+			     alignment);
 
       for (fde = all_fde_data; fde ; fde = fde->next)
 	{
 	  struct cfi_insn_data *first;
 
+	  cfi_seg = get_cfi_seg (fde->cseg, ".debug_frame",
+				 SEC_READONLY | SEC_DEBUGGING,
+				 alignment);
 	  if (fde->end_address == NULL)
 	    {
 	      as_bad (_("open CFI at the end of file; missing .cfi_endproc directive"));
Index: src/gas/ehopt.c
===================================================================
--- src.orig/gas/ehopt.c	2011-02-26 23:07:28.662909100 +0100
+++ src/gas/ehopt.c	2011-02-27 12:08:11.872918000 +0100
@@ -120,7 +120,7 @@ get_cie_info (struct cie_info *info)
 
   /* First make sure that the CIE Identifier Tag is 0/-1.  */
 
-  if (strcmp (segment_name (now_seg), ".debug_frame") == 0)
+  if (strncmp (segment_name (now_seg), ".debug_frame", 12) == 0)
     CIE_id = (char)0xff;
   else
     CIE_id = 0;
@@ -285,9 +285,9 @@ check_eh_frame (expressionS *exp, unsign
 #endif
 
   /* Select the proper section data.  */
-  if (strcmp (segment_name (now_seg), ".eh_frame") == 0)
+  if (strncmp (segment_name (now_seg), ".eh_frame", 9) == 0)
     d = &eh_frame_data;
-  else if (strcmp (segment_name (now_seg), ".debug_frame") == 0)
+  else if (strncmp (segment_name (now_seg), ".debug_frame", 12) == 0)
     d = &debug_frame_data;
   else
     return 0;
Index: src/ld/scripttempl/alphavms.sc
===================================================================
--- src.orig/ld/scripttempl/alphavms.sc	2011-02-26 23:07:28.664909100 +0100
+++ src/ld/scripttempl/alphavms.sc	2011-02-27 12:08:11.877918300 +0100
@@ -29,7 +29,7 @@ SECTIONS
     *(\$LITERAL\$)
     *(\$READONLY\$)
     *(\$READONLY_ADDR\$)
-    *(eh_frame)
+    *(eh_frame) *(eh_frame\$*) *(eh_frame.*)
     *(jcr)
     *(ctors)
     *(dtors)
Index: src/ld/scripttempl/armbpabi.sc
===================================================================
--- src.orig/ld/scripttempl/armbpabi.sc	2011-02-26 23:07:28.665909100 +0100
+++ src/ld/scripttempl/armbpabi.sc	2011-02-27 12:08:11.881918500 +0100
@@ -241,7 +241,7 @@ cat <<EOF
 
   ${OTHER_READONLY_SECTIONS}
   .eh_frame_hdr : { *(.eh_frame_hdr) }
-  .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+  .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) }
   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
 
   /* Adjust the address for the data segment.  We want to adjust up to
@@ -251,7 +251,7 @@ cat <<EOF
   ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR};}}
 
   /* Exception handling  */
-  .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+  .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) }
   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
 
   /* Thread Local Storage sections  */
@@ -346,7 +346,7 @@ cat <<EOF
   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/avr.sc
===================================================================
--- src.orig/ld/scripttempl/avr.sc	2011-02-26 23:07:28.666909100 +0100
+++ src/ld/scripttempl/avr.sc	2011-02-27 12:08:11.886918800 +0100
@@ -225,7 +225,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/crisaout.sc
===================================================================
--- src.orig/ld/scripttempl/crisaout.sc	2011-02-26 23:07:28.667909100 +0100
+++ src/ld/scripttempl/crisaout.sc	2011-02-27 12:08:11.890919100 +0100
@@ -90,7 +90,7 @@ SECTIONS
     *(.data);
     ${RELOCATING+*(.data.*)}
     ${RELOCATING+*(.gnu.linkonce.d*)}
-    ${RELOCATING+*(.eh_frame) /* FIXME: Make .text */}
+    ${RELOCATING+*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*) /* FIXME: Make .text */}
     ${RELOCATING+*(.gcc_except_table)}
 
     /* See comment at ALIGN before __Etext.  */
Index: src/ld/scripttempl/elf.sc
===================================================================
--- src.orig/ld/scripttempl/elf.sc	2011-02-26 23:07:28.668909100 +0100
+++ src/ld/scripttempl/elf.sc	2011-02-27 12:08:11.894919300 +0100
@@ -469,7 +469,7 @@ cat <<EOF
   ${CREATE_SHLIB-${SBSS2}}
   ${OTHER_READONLY_SECTIONS}
   .eh_frame_hdr : { *(.eh_frame_hdr) }
-  .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+  .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) }
   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
 
   /* Adjust the address for the data segment.  We want to adjust up to
@@ -479,7 +479,7 @@ cat <<EOF
   ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
 
   /* Exception handling  */
-  .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+  .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) }
   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
 
   /* Thread Local Storage sections  */
@@ -599,7 +599,7 @@ cat <<EOF
   .debug_info     0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elf32cr16.sc
===================================================================
--- src.orig/ld/scripttempl/elf32cr16.sc	2011-02-26 23:07:28.669909100 +0100
+++ src/ld/scripttempl/elf32cr16.sc	2011-02-27 12:08:11.900919600 +0100
@@ -159,7 +159,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elf32crx.sc
===================================================================
--- src.orig/ld/scripttempl/elf32crx.sc	2011-02-26 23:07:28.670909100 +0100
+++ src/ld/scripttempl/elf32crx.sc	2011-02-27 12:08:11.904919900 +0100
@@ -161,7 +161,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elf32msp430.sc
===================================================================
--- src.orig/ld/scripttempl/elf32msp430.sc	2011-02-26 23:07:28.671909100 +0100
+++ src/ld/scripttempl/elf32msp430.sc	2011-02-27 12:08:11.907920000 +0100
@@ -234,7 +234,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elf32msp430_3.sc
===================================================================
--- src.orig/ld/scripttempl/elf32msp430_3.sc	2011-02-26 23:07:28.672909100 +0100
+++ src/ld/scripttempl/elf32msp430_3.sc	2011-02-27 12:08:11.911920300 +0100
@@ -178,7 +178,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elf32sh-symbian.sc
===================================================================
--- src.orig/ld/scripttempl/elf32sh-symbian.sc	2011-02-26 23:07:28.674909100 +0100
+++ src/ld/scripttempl/elf32sh-symbian.sc	2011-02-27 12:08:11.915920500 +0100
@@ -245,7 +245,7 @@ SECTIONS
   .data1            ALIGN(4) : { *(.data1) } :data
   .tdata	    ALIGN(4) : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) } :data
   .tbss		    ALIGN(4) : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} } :data
-  .eh_frame         ALIGN(4) : { KEEP (*(.eh_frame)) } :data
+  .eh_frame         ALIGN(4) : { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) } :data
   .gcc_except_table ALIGN(4) : { *(.gcc_except_table) } :data
   ${WRITABLE_RODATA+${RODATA}}
   ${OTHER_READWRITE_SECTIONS}
@@ -367,7 +367,7 @@ cat <<EOF
   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elf64hppa.sc
===================================================================
--- src.orig/ld/scripttempl/elf64hppa.sc	2011-02-26 23:07:28.675909100 +0100
+++ src/ld/scripttempl/elf64hppa.sc	2011-02-27 12:08:11.920920800 +0100
@@ -420,7 +420,7 @@ cat <<EOF
   ${CREATE_SHLIB-${SBSS2}}
   ${OTHER_READONLY_SECTIONS}
   .eh_frame_hdr : { *(.eh_frame_hdr) }
-  .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+  .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) }
   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
 
   /* Adjust the address for the data segment.  We want to adjust up to
@@ -430,7 +430,7 @@ cat <<EOF
   ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
 
   /* Exception handling  */
-  .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+  .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) }
   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
 
   /* Thread Local Storage sections  */
@@ -549,7 +549,7 @@ cat <<EOF
   .debug_info     0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elf_chaos.sc
===================================================================
--- src.orig/ld/scripttempl/elf_chaos.sc	2011-02-26 23:07:28.683909100 +0100
+++ src/ld/scripttempl/elf_chaos.sc	2011-02-27 12:08:11.926921100 +0100
@@ -264,7 +264,7 @@ cat <<EOF
     ${RELOCATING+${DATA_START_SYMBOLS}}
     *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
     ${CONSTRUCTING+SORT(CONSTRUCTORS)}
-    KEEP (*(.eh_frame))
+    KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*))
     *(.gcc_except_table)
     ${CTOR}
     ${DTOR}
@@ -339,7 +339,7 @@ cat <<EOF
   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elfd10v.sc
===================================================================
--- src.orig/ld/scripttempl/elfd10v.sc	2011-02-26 23:07:28.676909100 +0100
+++ src/ld/scripttempl/elfd10v.sc	2011-02-27 12:08:11.930921300 +0100
@@ -184,7 +184,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elfd30v.sc
===================================================================
--- src.orig/ld/scripttempl/elfd30v.sc	2011-02-26 23:07:28.677909100 +0100
+++ src/ld/scripttempl/elfd30v.sc	2011-02-27 12:08:11.934921600 +0100
@@ -123,7 +123,7 @@ SECTIONS
   .rodata	${RELOCATING-0} : { *(.rodata) }	${RELOCATING+ > ${DATA_MEMORY}}
 
   /* C++ exception support.  */
-  .eh_frame	${RELOCATING-0} : { KEEP (*(.eh_frame)) }	${RELOCATING+ > ${DATA_MEMORY}}
+  .eh_frame	${RELOCATING-0} : { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) }	${RELOCATING+ > ${DATA_MEMORY}}
   .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) }	${RELOCATING+ > ${DATA_MEMORY}}
 
   /* Java class registration support.  */
@@ -211,7 +211,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elfi370.sc
===================================================================
--- src.orig/ld/scripttempl/elfi370.sc	2011-02-26 23:07:28.678909100 +0100
+++ src/ld/scripttempl/elfi370.sc	2011-02-27 12:08:11.938921800 +0100
@@ -203,7 +203,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elfm68hc11.sc
===================================================================
--- src.orig/ld/scripttempl/elfm68hc11.sc	2011-02-26 23:07:28.679909100 +0100
+++ src/ld/scripttempl/elfm68hc11.sc	2011-02-27 12:08:11.943922100 +0100
@@ -325,7 +325,7 @@ SECTIONS
 
   .eh_frame ${RELOCATING-0} :
   {
-    KEEP (*(.eh_frame))
+    KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*))
   } ${RELOCATING+ > ${TEXT_MEMORY}}
 
   .gcc_except_table ${RELOCATING-0} :
@@ -452,7 +452,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elfm68hc12.sc
===================================================================
--- src.orig/ld/scripttempl/elfm68hc12.sc	2011-02-26 23:07:28.680909100 +0100
+++ src/ld/scripttempl/elfm68hc12.sc	2011-02-27 12:08:11.948922400 +0100
@@ -324,7 +324,7 @@ SECTIONS
 
   .eh_frame ${RELOCATING-0} :
   {
-    KEEP (*(.eh_frame))
+    KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*))
   } ${RELOCATING+ > ${TEXT_MEMORY}}
 
   .gcc_except_table ${RELOCATING-0} :
@@ -455,7 +455,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/elfmicroblaze.sc
===================================================================
--- src.orig/ld/scripttempl/elfmicroblaze.sc	2011-02-26 23:07:28.681909100 +0100
+++ src/ld/scripttempl/elfmicroblaze.sc	2011-02-27 12:08:11.952922600 +0100
@@ -142,7 +142,7 @@ SECTIONS
 
   /* Added by Sathya to handle C++ exceptions */
   .eh_frame : {  
-    ${RELOCATING+*(.eh_frame)}
+    ${RELOCATING+*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)}
   }
   
   .jcr : {  
Index: src/ld/scripttempl/elfxtensa.sc
===================================================================
--- src.orig/ld/scripttempl/elfxtensa.sc	2011-02-26 23:07:28.682909100 +0100
+++ src/ld/scripttempl/elfxtensa.sc	2011-02-27 12:08:11.956922800 +0100
@@ -429,7 +429,7 @@ cat <<EOF
   ${CREATE_SHLIB-${SBSS2}}
   ${OTHER_READONLY_SECTIONS}
   .eh_frame_hdr : { *(.eh_frame_hdr) }
-  .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+  .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) }
   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
 
   /* Adjust the address for the data segment.  We want to adjust up to
@@ -439,7 +439,7 @@ cat <<EOF
   ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
 
   /* Exception handling  */
-  .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+  .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) }
   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
 
   /* Thread Local Storage sections  */
@@ -559,7 +559,7 @@ cat <<EOF
   .debug_info     0 : { *(.debug_info${RELOCATING+ .gnu.linkonce.wi.*}) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/epocpe.sc
===================================================================
--- src.orig/ld/scripttempl/epocpe.sc	2011-02-26 23:07:28.684909100 +0100
+++ src/ld/scripttempl/epocpe.sc	2011-02-27 12:08:11.962923200 +0100
@@ -67,7 +67,7 @@ SECTIONS
     section */
     *(.rdata)
     ${R_RDATA}
-    *(.eh_frame)
+    *(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)
   }
 
   /* The Cygwin32 library uses a section to avoid copying certain data
Index: src/ld/scripttempl/i386beos.sc
===================================================================
--- src.orig/ld/scripttempl/i386beos.sc	2011-02-26 23:07:28.685909100 +0100
+++ src/ld/scripttempl/i386beos.sc	2011-02-27 12:08:11.966923400 +0100
@@ -98,7 +98,7 @@ SECTIONS
   {
     *(.rdata)
     ${R_RDATA}
-    *(.eh_frame)
+    *(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)
   }
 
   .edata ${RELOCATING+BLOCK(__section_alignment__)} :
@@ -180,7 +180,7 @@ SECTIONS
   .debug_info     0 ${RELOCATING+(NOLOAD)} : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 ${RELOCATING+(NOLOAD)} : { *(.debug_abbrev) }
   .debug_line     0 ${RELOCATING+(NOLOAD)} : { *(.debug_line) }
-  .debug_frame    0 ${RELOCATING+(NOLOAD)} : { *(.debug_frame) }
+  .debug_frame    0 ${RELOCATING+(NOLOAD)} : { *(.debug_frame*) }
   .debug_str      0 ${RELOCATING+(NOLOAD)} : { *(.debug_str) }
   .debug_loc      0 ${RELOCATING+(NOLOAD)} : { *(.debug_loc) }
   .debug_macinfo  0 ${RELOCATING+(NOLOAD)} : { *(.debug_macinfo) }
Index: src/ld/scripttempl/i386go32.sc
===================================================================
--- src.orig/ld/scripttempl/i386go32.sc	2011-02-26 23:07:28.686909100 +0100
+++ src/ld/scripttempl/i386go32.sc	2011-02-27 12:08:11.969923600 +0100
@@ -71,7 +71,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/ip2k.sc
===================================================================
--- src.orig/ld/scripttempl/ip2k.sc	2011-02-26 23:07:28.688909100 +0100
+++ src/ld/scripttempl/ip2k.sc	2011-02-27 12:08:11.972923800 +0100
@@ -142,7 +142,7 @@ SECTIONS
 	.debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
 	.debug_abbrev   0 : { *(.debug_abbrev) }
 	.debug_line     0 : { *(.debug_line) }
-	.debug_frame    0 : { *(.debug_frame) }
+	.debug_frame    0 : { *(.debug_frame*) }
 	.debug_str      0 : { *(.debug_str) }
 	.debug_loc      0 : { *(.debug_loc) }
 	.debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/iq2000.sc
===================================================================
--- src.orig/ld/scripttempl/iq2000.sc	2011-02-26 23:07:28.689909100 +0100
+++ src/ld/scripttempl/iq2000.sc	2011-02-27 12:08:11.976924000 +0100
@@ -321,7 +321,7 @@ cat <<EOF
   .eh_frame ${RELOCATING-0} : 
   { 
     ${RELOCATING+PROVIDE (__eh_frame_begin = .);}
-    *(.eh_frame) 
+    *(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)
     LONG (0);
     ${RELOCATING+PROVIDE (__eh_frame_end = .);}
   } ${RELOCATING+}
@@ -425,7 +425,7 @@ cat <<EOF
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/mcorepe.sc
===================================================================
--- src.orig/ld/scripttempl/mcorepe.sc	2011-02-26 23:07:28.690909100 +0100
+++ src/ld/scripttempl/mcorepe.sc	2011-02-27 12:08:11.981924300 +0100
@@ -98,7 +98,7 @@ SECTIONS
   {
     *(.rdata)
     ${R_RDATA}
-    *(.eh_frame)
+    *(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)
   }
 
   .edata ${RELOCATING+BLOCK(__section_alignment__)} :
Index: src/ld/scripttempl/mep.sc
===================================================================
--- src.orig/ld/scripttempl/mep.sc	2011-02-26 23:07:28.691909100 +0100
+++ src/ld/scripttempl/mep.sc	2011-02-27 12:08:11.985924500 +0100
@@ -319,7 +319,7 @@ cat <<EOF
   ${CREATE_SHLIB-${SBSS2}}
   ${OTHER_READONLY_SECTIONS}
   .eh_frame_hdr : { *(.eh_frame_hdr) }
-  .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+  .eh_frame     ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) }
   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
 
   /* Adjust the address for the data segment.  We want to adjust up to
@@ -329,7 +329,7 @@ cat <<EOF
   ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
 
   /* Exception handling  */
-  .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
+  .eh_frame     ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) }
   .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
 
   /* Thread Local Storage sections  */
@@ -425,7 +425,7 @@ cat <<EOF
   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/mmo.sc
===================================================================
--- src.orig/ld/scripttempl/mmo.sc	2011-02-26 23:07:28.692909100 +0100
+++ src/ld/scripttempl/mmo.sc	2011-02-27 12:08:11.990924800 +0100
@@ -54,7 +54,7 @@ SECTIONS
     ${RELOCATING+ PROVIDE (__dtors_end = .);}
 
     ${RELOCATING+KEEP (*(.jcr))}
-    ${RELOCATING+KEEP (*(.eh_frame))}
+    ${RELOCATING+KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*))}
     ${RELOCATING+*(.gcc_except_table)}
 
     ${RELOCATING+ PROVIDE(etext = .);}
@@ -74,7 +74,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }
Index: src/ld/scripttempl/pe.sc
===================================================================
--- src.orig/ld/scripttempl/pe.sc	2011-02-26 23:07:28.693909100 +0100
+++ src/ld/scripttempl/pe.sc	2011-02-27 12:08:11.993925000 +0100
@@ -115,7 +115,7 @@ SECTIONS
 
   .eh_frame ${RELOCATING+BLOCK(__section_alignment__)} :
   {
-    *(.eh_frame)
+    *(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)
   }
 
   .pdata ${RELOCATING+BLOCK(__section_alignment__)} :
@@ -250,7 +250,7 @@ SECTIONS
 
   .debug_frame ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
   {
-    *(.debug_frame)
+    *(.debug_frame*)
   }
 
   .debug_str ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
Index: src/ld/scripttempl/pep.sc
===================================================================
--- src.orig/ld/scripttempl/pep.sc	2011-02-26 23:07:28.694909100 +0100
+++ src/ld/scripttempl/pep.sc	2011-02-27 12:08:11.997925200 +0100
@@ -116,7 +116,7 @@ SECTIONS
 
   .eh_frame ${RELOCATING+BLOCK(__section_alignment__)} :
   {
-    *(.eh_frame)
+    *(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)
   }
 
   .pdata ${RELOCATING+BLOCK(__section_alignment__)} :
@@ -256,7 +256,7 @@ SECTIONS
 
   .debug_frame ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
   {
-    *(.debug_frame)
+    *(.debug_frame*)
   }
 
   .debug_str ${RELOCATING+BLOCK(__section_alignment__)} ${RELOCATING+(NOLOAD)} :
Index: src/ld/scripttempl/v850.sc
===================================================================
--- src.orig/ld/scripttempl/v850.sc	2011-02-26 23:07:28.695909100 +0100
+++ src/ld/scripttempl/v850.sc	2011-02-27 12:08:12.001925400 +0100
@@ -210,7 +210,7 @@ SECTIONS
   .debug_info     0	: { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0	: { *(.debug_abbrev) }
   .debug_line     0	: { *(.debug_line) }
-  .debug_frame    0	: { *(.debug_frame) }
+  .debug_frame    0	: { *(.debug_frame*) }
   .debug_str      0	: { *(.debug_str) }
   .debug_loc      0	: { *(.debug_loc) }
   .debug_macinfo  0	: { *(.debug_macinfo) }
Index: src/ld/scripttempl/xstormy16.sc
===================================================================
--- src.orig/ld/scripttempl/xstormy16.sc	2011-02-26 23:07:28.711909100 +0100
+++ src/ld/scripttempl/xstormy16.sc	2011-02-27 12:08:12.005925600 +0100
@@ -159,7 +159,7 @@ SECTIONS
   ${RELOCATING+${CTOR}}
   ${RELOCATING+${DTOR}}
   .jcr : { KEEP (*(.jcr)) } ${RELOCATING+> ROM}
-  .eh_frame : { KEEP (*(.eh_frame)) } ${RELOCATING+> ROM}
+  .eh_frame : { KEEP (*(.eh_frame) *(.eh_frame\$*) *(.eh_frame.*)) } ${RELOCATING+> ROM}
   .gcc_except_table : { *(.gcc_except_table) *(.gcc_except_table.*) } ${RELOCATING+> ROM}
   .plt : { *(.plt) } ${RELOCATING+> ROM}
 
@@ -222,7 +222,7 @@ SECTIONS
   .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
   .debug_abbrev   0 : { *(.debug_abbrev) }
   .debug_line     0 : { *(.debug_line) }
-  .debug_frame    0 : { *(.debug_frame) }
+  .debug_frame    0 : { *(.debug_frame*) }
   .debug_str      0 : { *(.debug_str) }
   .debug_loc      0 : { *(.debug_loc) }
   .debug_macinfo  0 : { *(.debug_macinfo) }


More information about the Binutils mailing list