This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Symbol refcounting for STT_GNU_IFUNC symbols
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Stephen Clarke <stephen dot clarke at st dot com>
- Cc: binutils at sourceware dot org
- Date: Sat, 3 Jul 2010 07:26:17 -0700
- Subject: Re: Symbol refcounting for STT_GNU_IFUNC symbols
- References: <4C2DFBEC.4050606@st.com>
On Fri, Jul 2, 2010 at 7:47 AM, Stephen Clarke <stephen.clarke@st.com> wrote:
> In bfd/elf32-386.c, elf_i386_check_relocs(), for R_386_GOT32 and
> R_386_GOTOFF relocations with a symbol with STT_GNU_IFUNC type, the
> h->got.refcount is incremented:
>
> ? ? ? ? ? ? ? ?case R_386_GOT32:
> ? ? ? ? ? ? ? ?case R_386_GOTOFF:
> ? ? ? ? ? ? ? ? ?h->got.refcount += 1;
>
> I guess this is because the mechanism for IFUNC symbols requires a GOT
> entry (even for a GOTOFF relocation which does not normally require a
> GOT entry).
>
> However, there is no corresponding decrement in the
> elf_i386_gc_sweep_hook() if the relocation is removed.
> Is this just a minor (safe) inaccuracy, or is there some reason why the
> refcount cannot be decremented in elf_i386_gc_sweep_hook()?
>
It could be an oversight. Do you have an testcase?
Thanks.
--
H.J.