[PATCH 16/28] elf: Add glibc-hwcaps support for LD_LIBRARY_PATH

Szabolcs Nagy szabolcs.nagy@arm.com
Fri Oct 9 10:50:56 GMT 2020


The 10/09/2020 11:08, Florian Weimer wrote:
> * Szabolcs Nagy via Libc-alpha:
> > The 10/01/2020 18:33, Florian Weimer via Libc-alpha wrote:
> >> This hacks non-power-set processing into _dl_important_hwcaps.
> >> Once the legacy hwcaps handling goes away, the subdirectory
> >> handling needs to be reworked, but it is premature to do this
> >> while both approaches are still supported.
> > ...
> >> +/* Returns a bitmap of active subdirectories in _dl_hwcaps_subdirs.
> >> +   Bit 0 (the LSB) corresponds to the first substring in
> >> +   _dl_hwcaps_subdirs, bit 1 to the second substring, and so on.
> >> +   There is no direct correspondence between HWCAP bitmasks and this
> >> +   bitmask.  */
> >> +int32_t _dl_hwcaps_subdirs_active (void) attribute_hidden;
> >
> > if this returns a bitmask i would use uint32_t
> >
> > to avoid overflowing shifts and have 32bits available.
> 
> I did this for alignment with _dl_hwcaps_split_masked_init, where it
> would convenient to shift in one bits (so that -1 always means “all
> ones”).  But I guess I can turn this into a typedef and use an unsigned
> type.

-1 converted to uint32_t is "all ones" so i don't see a problem there.

i don't think this should be a typedef (that hides
important details about the type where it is used)



More information about the Libc-alpha mailing list