1999-08-28 00:22:10 +00:00
|
|
|
# $FreeBSD$
|
1993-11-03 23:41:59 +00:00
|
|
|
PROG= ld.so
|
1997-11-29 03:32:48 +00:00
|
|
|
SRCS= mdprologue.S rtld.c shlib.c md.c support.c
|
1995-08-26 13:17:39 +00:00
|
|
|
MAN1= rtld.1
|
Update to handle new version ld.so.hints and info in executable for
configurable fallback search paths, as well as new crt interface version.
Also:
- even faster getenv(), get all environment variable settings in a single
pass.
- ldd printf-like format specifications
- minor code cleanups, one vsprintf -> vsnprintf (harmless)
The library search sequence is a little more complete now. Before,
it'd search $LD_LIBRARY_PATH (by opendir/readdir/closedir), then read
the hints file, then read /usr/lib (again by scanning thr directory). It
would then fail if there was no "found" library.
Now, it does LD_LIBRARY_PATH and the hints file the same, but then uses
a longer fallback path. The -R path is fetched from the executable if
specified at build time, the ldconfig path is appended, and /usr/lib is
appended to that. Duplicates are suppressed. This means that simply
placing a new library in /usr/local/lib will work (the same as it did in
/usr/lib) without needing ldconfig -m. It will find it quicker if the
ldconfig is run though.
Similar changes have been made to the NetBSD ld.so, but ours is rather
different now due to John Polstra's speedups and fixes from a while back.
The ldd printf-like format support came direct from NetBSD.
Reviewed by: nate, jdp
1996-10-01 01:52:03 +00:00
|
|
|
# As there is relocation going on behind GCC's back, don't cache function addresses.
|
|
|
|
PICFLAG=-fpic -fno-function-cse
|
1998-09-05 08:31:10 +00:00
|
|
|
CFLAGS+=-I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH} ${PICFLAG} -DRTLD -Wall
|
1997-11-29 03:32:48 +00:00
|
|
|
LDFLAGS+=-nostdlib -Wl,-Bshareable,-Bsymbolic,-assert,nosymbolic
|
1994-02-13 20:43:13 +00:00
|
|
|
ASFLAGS+=-k
|
1994-08-28 18:49:06 +00:00
|
|
|
DPADD+= ${LIBC:S/c.a/c_pic.a/} ${LIBC:S/c.a/gcc_pic.a/}
|
1994-03-10 23:19:54 +00:00
|
|
|
LDADD+= -lc_pic -lgcc_pic
|
1996-09-12 03:42:54 +00:00
|
|
|
INSTALLFLAGS+= -fschg -C # -C to install as atomically as possible
|
1995-08-26 13:17:39 +00:00
|
|
|
MLINKS= rtld.1 ld.so.1
|
1993-11-03 23:41:59 +00:00
|
|
|
|
1998-09-05 08:31:10 +00:00
|
|
|
.PATH: ${.CURDIR}/${MACHINE_ARCH}
|
1994-02-13 20:43:13 +00:00
|
|
|
|
1993-11-03 23:41:59 +00:00
|
|
|
.include <bsd.prog.mk>
|