Multiple sections with the same name again

Jakub Jelinek jakub@redhat.com
Mon May 24 11:39:00 GMT 2004


On Mon, May 24, 2004 at 08:18:11PM +0930, Alan Modra wrote:
> bfd/ChangeLog
> 	* elflink.c (elf_link_add_object_symbols): Don't set up merge
> 	section data here..
> 	* elf.c (_bfd_elf_merge_sections): .. Do it here instead.
> 	* merge.c (_bfd_merge_section): Update comment.  Don't test
> 	section name to determine sinfo group, instead test output
> 	section.
> ld/ChangeLog
> 	* ldlang.c (lang_process): Call bfd_merge_sections later, and
> 	only when not a relocatable link.

Actually, thinking about it more, the name check is desirable.
Consider say .rodata.str1.1 and .rodata.str1.32 sections GCC used to
emit until very recently on IA-32.  These sections have both sh_entsize 1,
SHF_MERGE|SHF_STRINGS, the same output section (.rodata), yet you don't
want to merge them together because of the different alignment rules.
If they are merged together, then I'm afraid several strings from the
.rodata.str1.1 input sections will suddenly be forced to have 32-byte
alignment unnecessarily.

Cannot we use the output_section check AND name comparison?

	Jakub



More information about the Binutils mailing list