The problem with linkonce sections in ELF

H . J . Lu
Thu Feb 3 20:45:00 GMT 2000

On Thu, Feb 03, 2000 at 11:09:24PM -0500, Ian Lance Taylor wrote:
>    Date: Thu, 3 Feb 2000 18:48:52 -0800
>    From: "H . J . Lu" <>
>    For some reason, linker decides to strip the input relocation
>    section, .rel.gnu.linkonce.t._._19srvr_message_list_c.
> The linker always strips all input relocation sections.  That is
> correct behaviour.
> I still don't understand what the actual problem is.

The probelm is the output .rel.text section consists of .rel.text,
.rel.text.* and .rel.gnu.linkonce.t*. All the them are generated
by the linker. With -Bsymbolic, elf_i386_size_dynamic_sections calls

	if (info->shared && info->symbolic)
	  elf_i386_link_hash_traverse (elf_i386_hash_table (info),
				       (PTR) NULL);

It is very possible that one of the .rel.gnu.linkonce.t* relocations
created by the linker will be striped by _bfd_strip_section_from_output.
When it happens, the output .rel.text section will be removed although
there are other .rel.text, .rel.text.* and .rel.gnu.linkonce.t* left.

I think _bfd_strip_section_from_output has to be 100% sure that
all linker generated relocations are striped before it removes
the output relocation section.


More information about the Binutils mailing list