This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld: linking to GNU_UNIQUE symbol does not set ELFOSABI_GNU
- From: Alan Modra <amodra at gmail dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 24 Jan 2013 23:58:18 +1030
- Subject: Re: ld: linking to GNU_UNIQUE symbol does not set ELFOSABI_GNU
- References: <51011B99.40309@redhat.com>
On Thu, Jan 24, 2013 at 12:31:37PM +0100, Florian Weimer wrote:
> I think this might be the appropriate fix:
>
> if (((abfd->flags & DYNAMIC) == 0
> && (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)
> || ELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE))
> elf_tdata (info->output_bfd)->has_gnu_symbols = TRUE;
This would mark a binary that merely linked against a shared library
having gnu_unique symbols. The binary would not even have to
reference such symbols.
I'm not sure your premise is correct anyway. STB_GNU_UNIQUE seems to
be relevant to the definition of a symbol, not a reference. Which
leads me to think that ld probably should not give undefined symbols
an STB_GNU_UNIQUE binding.
--
Alan Modra
Australia Development Lab, IBM