Matt Austern <austern@apple.com> writes:
Perhaps one of the things that I'm missing is the documentation. I
couldn't find anything in the ld documentation that said exactly what
it did with gnu.linkonce sections. In the compiler documentation I
did find a brief discussion in the user manual
(http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Vague-
Linkage.html#Vague%20Linkage) and nothing in the internals manual. So
mostly I'm just trying to trace this through the source code. If
there's somewhere better for me to be looking, I'd appreciate a
pointer.
I think that this is the complete existing linker documentation, from
bfd/elf.c:
/* As a GNU extension, if the name begins with .gnu.linkonce, we
only link a single copy of the section. This is used to support
g++. g++ will emit each template expansion in its own section.
The symbols will be defined as weak, so that multiple definitions
are permitted. The GNU linker extension is to actually discard
all but one of the sections. */