HomeFreeBSD

rtld: avoid division in __thr_map_stacks_exec()

Description

rtld: avoid division in __thr_map_stacks_exec()

The function is called by rtld with the rtld bind lock write-locked,
when fixing the stack permission during dso load. Not every ARMv7 CPU
supports the div, which causes the recursive entry into rtld to resolve
the __aeabi_uidiv symbol, causing self-lock.

Workaround the problem by using roundup2() instead of open-coding less
efficient formula.

Diagnosed by: mmel
Based on submission by: John F Carr <jfc@mit.edu>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Details

Provenance
kibAuthored on Jul 24 2024, 10:17 AM
Parents
rG860c4d94ac46: rtld: add LD_NO_DL_ITERATE_PHDR_AFTER_FORK env var
Branches
Unknown
Tags
Unknown