This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: _bfd_elf_init_private_section_data setting output section type improperly for .stabstr
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Mike Bland <mbland at google dot com>
- Cc: binutils at sourceware dot org, iant at google dot com
- Date: Thu, 11 May 2006 21:45:41 +0930
- Subject: Re: _bfd_elf_init_private_section_data setting output section type improperly for .stabstr
- References: <8b10c78c0605102132p5d7c9403x176fcc760aade19a@mail.google.com>
On Wed, May 10, 2006 at 09:32:22PM -0700, Mike Bland wrote:
> Long and short of it, an update to this conditional in
> _bfd_elf_init_private_section_data was causing the section type of
> .stabstr to get set to SHT_PROGBITS, when it should have been
> SHT_STRTAB.
Yes, it appears that HJ checked this change in without approval.
> Hope this is in an acceptable format; let me know if there are any
> problems, questions, concerns, etc.
We normally want a changelog entry, and the testcase needed a little
teaking for 64-bit targets but other than that this is OK. Thanks!
Committing.
> ==== src/bfd/elf.c#3 - src/bfd/elf.c ====
> --- src/bfd/elf.c#3 2006-05-10 21:10:55.000000000 -0700
> +++ src/bfd/elf.c 2006-05-10 19:52:30.000000000 -0700
> @@ -6054,7 +6054,8 @@ _bfd_elf_init_private_section_data (bfd
> output BFD section flags has been set to something different.
> elf_fake_sections will set ELF section type based on BFD
> section flags. */
> - if (osec->flags == isec->flags || !osec->flags)
> + if (osec->flags == isec->flags
> + || (!osec->flags && elf_section_type (osec) == SHT_NULL))
> elf_section_type (osec) = elf_section_type (isec);
>
> /* Set things up for objcopy and relocatable link. The output
> ==== (added) src/ld/testsuite/ld-elf/stab.d ====
> --- /dev/null 2006-04-17 10:27:56.868292750 -0700
> +++ src/ld/testsuite/ld-elf/stab.d 2006-05-10 19:53:55.000000000 -0700
> @@ -0,0 +1,12 @@
> +#source: start.s
> +#as: -gstabs
> +#readelf: -N
> +#ld:
> +
> +#...
> + \[[0-9 ][0-9]\] \.stab
> + PROGBITS 00000000 0000[0-9a-f][0-9a-f]
> 0000[0-9a-f][0-9a-f] 0c [1-9]+ 0 4
> +#...
> + \[[0-9 ][0-9]\] \.stabstr
> + STRTAB 00000000 0000[0-9a-f][0-9a-f]
> 0000[0-9a-f][0-9a-f] 00 0 0 1
> +#...
--
Alan Modra
IBM OzLabs - Linux Technology Centre