Test case which displays problem found in libstdc++-v3 effort

Alan Modra alan@linuxcare.com.au
Sun Jun 18 04:44:00 GMT 2000


On Sun, 18 Jun 2000, Benjamin Kosnik wrote:

> More info on this bug can be found on the libstdc++ list, here:
> 
> http://sourceware.cygnus.com/ml/libstdc++/2000-06/msg00127.html
> http://sourceware.cygnus.com/ml/libstdc++/2000-06/msg00128.html
> 
> in which jason says:
> 
> 
> Or in a relatively mundane way; as it happens, it's simply discarding all
> of the unwind info.  objdump -x a.out shows that the .eh_frame section is
> size 0, which would seem to indicate a problem...
> 
> Definitely seems like a linker bug.

It's a linker script bug.  The linker needs to be told to keep the
.eh_frame contents.  Lack of any reference to symbols defined in a
section normally causes --gc-sections to discard the section.

The following patch should fix this problem.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.


ld/ChangeLog

	* scripttempl/elf.sc: KEEP .eh_frame contents.


Index: ld/scripttempl/elf.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
retrieving revision 1.11
diff -u -p -r1.11 elf.sc
--- elf.sc	2000/04/13 23:38:46	1.11
+++ elf.sc	2000/06/18 11:32:27
@@ -244,7 +244,7 @@ SECTIONS
     ${CONSTRUCTING+SORT(CONSTRUCTORS)}
   }
   .data1 ${RELOCATING-0} : { *(.data1) }
-  .eh_frame : { *(.eh_frame) }
+  .eh_frame : { KEEP (*(.eh_frame)) }
   .gcc_except_table : { *(.gcc_except_table) }
   ${WRITABLE_RODATA+${RODATA}}
   ${RELOCATING+${OTHER_READWRITE_SECTIONS}}




More information about the Binutils mailing list