[PATCH v5 2/2] aarch64: helper function to access hwcap elements in ifunc resolver

Yury Khrustalev yury.khrustalev@arm.com
Tue May 6 14:42:50 GMT 2025


On Tue, May 06, 2025 at 10:29:43AM -0400, enh wrote:
> On Tue, May 6, 2025 at 10:27 AM enh <enh@google.com> wrote:
> >
> > On Mon, Apr 28, 2025 at 7:32 AM Yury Khrustalev <yury.khrustalev@arm.com> wrote:
> > >
> > > +/* A helper function to obtain HWCAP element by its ID from the
> > > +   parameters ARG0 and ARG1 passed to the ifunc resolver.  Note that
> > > +   ID 1 corresponds to AT_HWCAP, ID 2 corresponds to AT_HWCAP2, etc.
> > > +   If there is no element available for the requested ID then 0 is
> > > +   returned.  If ID doesn't much any supported AT_HWCAP{,2,...} value,
> > > +   then 0 is also returned.  */
> > > +static __inline unsigned long __attribute__ ((unused, always_inline))
> > > +__ifunc_hwcap (unsigned long __id,
> > > +              unsigned long __arg0,
> >
> > is there any reason for this special case, since it's also available
> > from the array? this just seems to make caller and callee slightly
> > more complex for no significant advantage?
> 
> oh, it's to support the historical accident where glibc has versions
> that _do_ pass arg0 but _don't_ pass arg1? (bionic went straight from
> passing nothing to passing both arguments.)

Yes, this is correct. I tried to capture both cases in one go as resovlers
need to do both checks: for the bit set and for the size of the 2nd arg if
it is present.

Thanks,
Yury



More information about the Libc-alpha mailing list