Files
freebsd/libexec
Daniel Levin 45a0cb52d3 rtld: Check for -1 as an-end-of-section marker
rtld calls functions in the .init_array section one at a time, until
it finds a distinguished sentinel value. The C runtime does the same
thing (in crtend.c). However, that checks for the sentinel -1 and not
1. If one is using a linker that unifies .ctors and .init_array, then
rtld will miss the sentinel value. I believe the author of this code
intended to write -1 instead of 1. Indeed, changing the code to also
check for -1 prevents rtld from attempting to call a non-existent
function. The same is true of .dtors and .fini_array.

Signed-off-by:	Daniel Levin <[email protected]>
Reviewed by:	kib
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2270
2026-06-22 21:52:08 +03:30
..
2026-05-25 18:52:15 +02:00
…
2026-05-22 19:57:35 +02:00
2026-03-29 16:13:09 +00:00