5 reloc.c rtld.c rtld_lock.c map_object.c \
6 malloc.c xmalloc.c debug.c libmap.c
9 CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD
10 CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}
11 LDFLAGS+= -nostdlib -e .rtld_start
15 SYMLINKS= ${BINDIR}/${PROG} /usr/libexec/${PROG}
16 MLINKS= rtld.1 ld-elf.so.1.1 \
19 .if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
20 .include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
23 # If LDSCRIPT is defined, we build the dynamic linker as an
24 # executable. Otherwise we build it as a shared object. We ignore
25 # LDSCRIPT if the running kernel is too old to support it.
27 KERN_OSRELDATE!= /sbin/sysctl -n kern.osreldate 2>/dev/null || echo 0
28 .if ${KERN_OSRELDATE} >= 400001
33 .ifdef LDSO_IS_EXECUTABLE
35 LDFLAGS+= -Wl,-T,${LDSCRIPT} -Wl,-E -Wl,-Bstatic
40 LDFLAGS+= -shared -Wl,-Bsymbolic
46 ${CC} -shared -nostdlib -o dyn_hack.so -x c /dev/null
48 # Since moving rtld-elf to /libexec, we need to create a symlink.
49 # Fixup the existing binary that's there so we can symlink over it.
51 .if exists(${DESTDIR}/usr/libexec/${PROG})
52 -chflags noschg ${DESTDIR}/usr/libexec/${PROG}
55 .PATH: ${.CURDIR}/${MACHINE_ARCH}
57 .include <bsd.prog.mk>