summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-07-16 22:01:01 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2020-07-16 22:01:01 +0000
commite9751a84dd2d177a1ebd6ca58b3b8f7dbc6f6220 (patch)
tree97cfebc9d5c8b0e9ef5f9f716d03849b141d1036 /libexec
parent0bfad4329818423960a75ed0a305005098e237ac (diff)
downloadsrc-test2-e9751a84dd2d177a1ebd6ca58b3b8f7dbc6f6220.tar.gz
src-test2-e9751a84dd2d177a1ebd6ca58b3b8f7dbc6f6220.zip
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/Makefile4
-rw-r--r--libexec/rtld-elf/rtld.c13
2 files changed, 3 insertions, 14 deletions
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index 23a0f99af2c2..40ad7a7ffc2f 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -17,6 +17,7 @@ PROG?= ld-elf.so.1
TAGS+= lib32
.endif
SRCS= \
+ crtbrand.S \
rtld_start.S \
reloc.c \
rtld.c \
@@ -29,6 +30,7 @@ SRCS= \
libmap.c
MAN?= rtld.1
CSTD?= gnu99
+ACFLAGS+= -DLOCORE
CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding
CFLAGS+= -I${SRCTOP}/lib/csu/common
.if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH})
@@ -75,7 +77,7 @@ beforeinstall:
-chflags -h noschg ${DESTDIR}/usr/libexec/${PROG}
.endif
-.PATH: ${RTLD_ELF_DIR}/${RTLD_ARCH}
+.PATH: ${RTLD_ELF_DIR}/${RTLD_ARCH} ${SRCTOP}/lib/csu/common
.if ${.CURDIR} == ${RTLD_ELF_DIR}
HAS_TESTS=
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index e15aee68ace6..48de9506154c 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -470,19 +470,6 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
}
direct_exec = true;
- /*
- * Set osrel for us, it is later reset to the binary'
- * value before first instruction of code from the binary
- * is executed.
- */
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_OSREL;
- mib[3] = getpid();
- osrel = __FreeBSD_version;
- sz = sizeof(old_osrel);
- (void)sysctl(mib, 4, &old_osrel, &sz, &osrel, sizeof(osrel));
-
dbg("opening main program in direct exec mode");
if (argc >= 2) {
rtld_argc = parse_args(argv, argc, &search_in_path, &fd, &argv0);