]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rtld: set osrel when in the direct exec mode.
authorkib <kib@FreeBSD.org>
Fri, 12 Jun 2020 22:10:03 +0000 (22:10 +0000)
committerkib <kib@FreeBSD.org>
Fri, 12 Jun 2020 22:10:03 +0000 (22:10 +0000)
commit2f9345080e51c0dc27ad83f1f85f1cd1bcb5baea
tree5e8a64bf094b2ff8d74363e5799c87f34656736c
parentc88c40a35e19996f1e80fa566e41b60f73e927b7
rtld: set osrel when in the direct exec mode.

Rtld itself is a shared object which does not have vendor note, so
after the direct exec of ld-elf.so.1 process has p_osrel set to zero.
This affects the ABI of syscalls.

Set osrel to the __FreeBSD_version value at compile time right after
rtld identified direct exec mode.  Then, switch to the osrel read from
the binary note or zero if no note, right before starting calling
ifunc resolvers, which is the first byte of the user code.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
libexec/rtld-elf/rtld-libc/Makefile.inc
libexec/rtld-elf/rtld.c