glibc clears AT_HWCAP and set only HW_CAP_X86_64 (0x2)

Carlos O'Donell carlos@redhat.com
Fri Oct 18 21:24:00 GMT 2019


On 10/17/19 5:06 PM, H.J. Lu wrote:
> dl_hwcap is used to load DSO optimized for a platform.  On i386, we use
> AT_HWCAP passed from kernel.  On x86-64, we use a different approach
> since AT_HWCAP passed from kernel isn't very useful:

The use of dl_hwcap to load DSOs is orthogonal to what getauxval() returns.
They need not be the same.

The question I have is: Why isn't AT_HWCAP returned by getauxval() for x86_64?

We could store AT_HWCAP into dl_hwcap_real, and return that in getauxval()
while still using the *processed* AT_HWCAP in dl_hwcap.

It seems confusing to return an altered AT_AUXVAL from getauxval()?

What do you think?

-- 
Cheers,
Carlos.



More information about the Libc-help mailing list