Skip to content

Commit

Permalink
Include FreeBSD ABI tag note in the ELF runtime loader.
Browse files Browse the repository at this point in the history
Reviewed by:	kib
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D25306
  • Loading branch information
bsdjhb committed Jul 16, 2020
1 parent 0bfad43 commit e9751a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
4 changes: 3 additions & 1 deletion libexec/rtld-elf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ PROG?= ld-elf.so.1
TAGS+= lib32
.endif
SRCS= \
crtbrand.S \
rtld_start.S \
reloc.c \
rtld.c \
Expand All @@ -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})
Expand Down Expand Up @@ -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=
Expand Down
13 changes: 0 additions & 13 deletions libexec/rtld-elf/rtld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e9751a8

Please sign in to comment.