This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libatomic IFUNC question (arm & libat_have_strexbhd)
- From: Steve Ellcey <sellcey at cavium dot com>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 06 Jun 2017 09:01:53 -0700
- Subject: Re: libatomic IFUNC question (arm & libat_have_strexbhd)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: deneb.enyo.de; dkim=none (message not signed) header.d=none;deneb.enyo.de; dmarc=none action=none header.from=cavium.com;
- References: <201706052232.v55MW7Jj022346@sellcey-dt.caveonetworks.com> <87a85lmzqt.fsf@mid.deneb.enyo.de>
- Reply-to: sellcey at cavium dot com
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Tue, 2017-06-06 at 07:50 +0200, Florian Weimer wrote:
> * Steve Ellcey:
>
> >
> > I have a question about the use of IFUNCs in libatomic. I was
> > looking at the
> > arm implementation and in gcc/libatomic/config/linux/arm/host-
> > config.h I see:
> >
> > extern bool libat_have_strexbhd HIDDEN;
> > # define IFUNC_COND_1 libat_have_strexbhd
> >
> > I also see that gcc/libatomic/config/linux/arm/init.c has:
> >
> > bool libat_have_strexbhd;
> > static void __attribute__((constructor))
> > init_cpu_revision (void)
> > {
> > }
> >
> > What I don't see is any place that libat_have_strexbhd would ever get
> > set. What am I missing here? init_cpu_revision is going to get called
> > when libatomic is first loaded since it is a constructor but it doesn't
> > seem to do anything and it isn't going to set libat_have_strexbhd as far
> > as I can see.
> Setting the variable in the constructor wouldn't influence IFUNC
> resolver behavior because those can run before ELF constructors
> (even with lazy binding).
So the question remains, where is libat_have_strexbhd set? As near as
I can tell it isn't set, which would make the libatomic IFUNC pointless
on arm.
Steve Ellcey