This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Expanding the hwcap


> When the rtld_global_ro.hwcap is populated (elf/dl-sysdeps.c) the auxv
> is walked. Due to struct element ordering (and the fact that we won't
> change it) we always know that AT_HWCAP will precede any instances of
> AT_HWCAP2 so the AT_HWCAP assignment can be left as-is.

The ABI is that auxv elements can be in any order.  Even if the kernel
happens always to put AT_HWCAP first, we should not assume so in userland.

> I've tested a prototype for AT_HWCAP2 with powerpc32 and powerpc64
> that preserves the low 32-bits.
>         case AT_HWCAP2:
>            GLRO(dl_hwcap) = (0x00000000ffffffff & GLRO(dl_hwcap)) |
> (((uint64_t) av->a_un.a_val) << 32);
>           break;

If the same a_type were to appear twice that would be an ABI violation and
so it really doesn't matter much how we treat it.  Might as well simply
make it |= in both case AT_HWCAP and case AT_HWCAP2.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]