ld fix for STB_GNU_UNIQUE PR10549

Mark Wielaard mjw@redhat.com
Thu Apr 7 21:32:00 GMT 2011


On Thu, 2011-04-07 at 13:03 -0700, H.J. Lu wrote:
> On Thu, Apr 7, 2011 at 1:01 PM, Mark Wielaard <mjw@redhat.com> wrote:
> > This is the ld part of the fix for PR 10549. Nick Clifton already fixed
> > the assembler part. If STB_GNU_UNIQUE is used ELFOSABI_LINUX should be
> > set.
> >
> > 2011-04-07  Mark Wielaard  <mjw@redhat.com>
> >
> >    PR 10549
> >    * elf-bfd.h (has_ifunc_symbols): Renamed to has_gnu_symbols.
> >    (has_gnu_symbols): Renamed from has_ifunc_symbols.
> >    * bfd/elf.c (_bfd_elf_set_osabi): Use new has_gnu_symbols name.
> >    * bfd/elf32-arm.c (elf32_arm_add_symbol_hook): Set has_gnu_symbols
> >    also if STB_GNU_UNIQUE symbol binding was seen.
> >    * bfd/elf32-i386.c (elf_i386_add_symbol_hook): Likewise.
> >    * bfd/elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
> >    * bfd/elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
> >    * bfd/elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
> >    * bfd/elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
> >    * bfd/elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise.
> >
> > Build and tested on x86_64 GNU/Linux with --enable-targets=all.
> >
> > If this is good, could someone commit it for me?
> 
> Please include the testcase from
> 
> http://sourceware.org/bugzilla/show_bug.cgi?id=10549

OK, I wrapped it in an expect test based on ifunc.exp slightly adapted
to check for UNIQUE instead.

ld/testsuite/ChangeLog
2011-04-08  Mark Wielaard  <mjw@redhat.com>

        * ld-unique: New directory.
        * ld-unique/unique.exp: New file: Run the UNIQUE tests.
        * ld-ifunc/unique.s: New test file.

This fails without my patch and passes with the patch applied.

Please commit it together with the original patch if it is OK.

Thanks,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unique-test.patch
Type: text/x-patch
Size: 5233 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20110407/51e2cf5c/attachment.bin>


More information about the Binutils mailing list