5 SRCS= rtld_start.S rtld.c lockdflt.c map_object.c malloc.c \
6 xmalloc.c debug.c reloc.c
8 CFLAGS+= -Wall -DFREEBSD_ELF -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}
9 LDFLAGS+= -nostdlib -e .rtld_start
10 INSTALLFLAGS= -fschg -C -b
11 MLINKS= rtld.1 ld-elf.so.1.1
13 .if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
14 .include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
17 # If LDSCRIPT is defined, we build the dynamic linker as an
18 # executable. Otherwise we build it as a shared object. We ignore
19 # LDSCRIPT if the running kernel is too old to support it.
21 KERN_OSRELDATE!= /sbin/sysctl -n kern.osreldate 2>/dev/null || echo 0
22 .if ${KERN_OSRELDATE} >= 400001
23 LDSO_IS_EXECUTABLE= yes
27 .ifdef LDSO_IS_EXECUTABLE
29 LDFLAGS+= -Wl,-T,${LDSCRIPT} -Wl,-E -Wl,-Bstatic
34 LDFLAGS+= -shared -Wl,-Bsymbolic
40 ${CC} -shared -nostdlib -o dyn_hack.so -x c /dev/null
42 .PATH: ${.CURDIR}/${MACHINE_ARCH}
44 .include <bsd.prog.mk>