1999-08-28 02:22:10 +02:00
|
|
|
# $FreeBSD$
|
1993-11-04 00:41:59 +01:00
|
|
|
PROG= ld.so
|
1997-11-29 04:32:48 +01:00
|
|
|
SRCS= mdprologue.S rtld.c shlib.c md.c support.c
|
2001-03-26 16:22:12 +02:00
|
|
|
MAN= rtld.1aout
|
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 03:52:03 +02:00
|
|
|
# As there is relocation going on behind GCC's back, don't cache function addresses.
|
|
|
|
PICFLAG=-fpic -fno-function-cse
|
1998-09-05 10:31:10 +02:00
|
|
|
CFLAGS+=-I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH} ${PICFLAG} -DRTLD -Wall
|
1997-11-29 04:32:48 +01:00
|
|
|
LDFLAGS+=-nostdlib -Wl,-Bshareable,-Bsymbolic,-assert,nosymbolic
|
1994-02-13 21:43:13 +01:00
|
|
|
ASFLAGS+=-k
|
1994-08-28 20:49:06 +02:00
|
|
|
DPADD+= ${LIBC:S/c.a/c_pic.a/} ${LIBC:S/c.a/gcc_pic.a/}
|
1994-03-11 00:19:54 +01:00
|
|
|
LDADD+= -lc_pic -lgcc_pic
|
2001-09-12 12:04:42 +02:00
|
|
|
INSTALLFLAGS= -fschg -C # -C to install as atomically as possible
|
2000-01-29 04:13:49 +01:00
|
|
|
MLINKS= rtld.1aout ld.so.1aout
|
1993-11-04 00:41:59 +01:00
|
|
|
|
1998-09-05 10:31:10 +02:00
|
|
|
.PATH: ${.CURDIR}/${MACHINE_ARCH}
|
1994-02-13 21:43:13 +01:00
|
|
|
|
1993-11-04 00:41:59 +01:00
|
|
|
.include <bsd.prog.mk>
|