]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rtld: set osrel when in the direct exec mode.
authorKonstantin Belousov <kib@FreeBSD.org>
Fri, 12 Jun 2020 22:10:03 +0000 (22:10 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Fri, 12 Jun 2020 22:10:03 +0000 (22:10 +0000)
commit510b525fa5fd77d2d52a6e72c848c1cb9a04f8e1
tree5e8a64bf094b2ff8d74363e5799c87f34656736c
parent3e6e3de0aa0a25d4e2ddc43e19ed4686353ceb44
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