From DT_GNU_HASH parsing: ========================================================== /* Number of bitmask words is required to be power of 2 */ nmw_power2 = ((nmaskwords & (nmaskwords - 1)) == 0); obj->maskwords_bm_gnu = nmaskwords - 1; ... obj->valid_hash_gnu = nmw_power2 && obj->nbuckets_gnu > 0 && obj->buckets_gnu != NULL; ========================================================== The nmw_power2 statement can be rewritten using the powerof2() macro from sys/param.h: nmw_power2 = powerof2(nmaskwords); And valid_hash_gnu should probably include '&& nmaskwords > 0' (see underflow in obj->maskwords_bm_gnu if nmaskwords is less than 1). I may eventually get around to attaching a patch, but this isn't a priority for us (just something that came up reviewing a similar change to the kernel linker, which will end up on bugzilla sometime soon).
Review: https://reviews.freebsd.org/D1724
r277936