mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
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
This commit is contained in:
parent
860c4d94ac
commit
31f688a26d
1 changed files with 1 additions and 4 deletions
|
|
@ -126,10 +126,7 @@ static char *last_stack = NULL;
|
|||
static inline size_t
|
||||
round_up(size_t size)
|
||||
{
|
||||
if (size % _thr_page_size != 0)
|
||||
size = ((size / _thr_page_size) + 1) *
|
||||
_thr_page_size;
|
||||
return size;
|
||||
return (roundup2(size, _thr_page_size));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in a new issue