[patch] Symbols in discarded sections.

Paul Brook paul@codesourcery.com
Wed Dec 1 20:33:00 GMT 2004


The ELF specification says that when a COMDAT section is discarded, the global 
symbols defined relative to that section should be converted to undefined 
symbols.

Failure to do this was causing problems problems linking some C++ code from 
different vendors. One object file defined a comdat section with a weak 
definition of a symbol. The other defined the same comdat section with a 
strong definition of the symbol. ld discarded the latter section, but still 
resolved symbol references to the [discarded] strong definition.

Tested on i686-linux and cross to arm-none-eabi.
Ok?

2004-12-01  Paul Brook  <paul@codesourcery.com>

bfd/
 * elflink.c (elf_link_add_object_symbols): Make symbols from discarded
 sections undefined.
ld/testsuite/
 * ld-elf/group1.d: New test.
 * ld-elf/group.ld, ld-elf/group1a.s, ld-elf/group1b.s: New test.
-------------- next part --------------
2004-12-01  Paul Brook  <paul@codesourcery.com>

bfd/
	* elflink.c (elf_link_add_object_symbols): Make symbols from discarded
	sections undefined.
ld/testsuite/
	* ld-elf/group1.d: New test.
	* ld-elf/group.ld, ld-elf/group1a.s, ld-elf/group1b.s: New test.


More information about the Binutils mailing list