This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] Symbols in discarded sections.
- From: Paul Brook <paul at codesourcery dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 1 Dec 2004 20:32:07 +0000
- Subject: [patch] Symbols in discarded sections.
- Organization: CodeSourcery
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.
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.