This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Incremental linking, ELF, & templates => REDUNDANT CODE
- To: egcs at cygnus dot com
- Subject: Incremental linking, ELF, & templates => REDUNDANT CODE
- From: "Brad M. Garcia" <bgarcia at fore dot com>
- Date: Fri, 10 Apr 1998 06:56:17 -0400 (EDT)
I've been under the impression for some time now that when a platform
uses the ELF object format, that all redundant template code (weak
symbols) will cancel out.
This is not (necessarily) true!
It appears that when you do an incremental link (ld -r), this
cancellation will occur during that link, but subsequent links will
fail to cancel redundant code.
When a *.o file is created from a C++ source file, it has a number of
sections called .gnu.linkonce.*. When the incremental link is attempted,
it appears that redundant copies of these sections are removed, but then
these sections are simply rolled into the .text section of the resulting
*.o file. Once in the .text section, weak symbols cannot be removed.
This seems like a bug in the linker. Has anyone heard of a fix?
Am I wrong in my analysis? I'm using binutils 2.8.1.
Brad Garcia
___/ __ / __ / ___/ "Being the Linux of digital media
__/ / / / _/ __/ would be a very good life."
_/ ____/ _/ _| ____/ - Jean-Louis Gassee, CEO of Be, Inc.