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