1997-04-16 11:31:32 +00:00
|
|
|
# $Id: Makefile,v 1.23 1997/02/22 15:46:46 peter Exp $
|
1993-11-03 23:41:59 +00:00
|
|
|
|
|
|
|
PROG= ld.so
|
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
|
|
|
SRCS= mdprologue.S rtld.c malloc.c shlib.c md.c support.c sbrk.c
|
1995-08-26 13:17:39 +00:00
|
|
|
MAN1= rtld.1
|
1993-11-03 23:41:59 +00:00
|
|
|
LDDIR?= $(.CURDIR)/..
|
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
|
1994-02-13 20:43:13 +00:00
|
|
|
CFLAGS+=-I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) $(PICFLAG) -DRTLD
|
1997-04-16 11:31:32 +00:00
|
|
|
LDFLAGS+=-nostdlib -Wl,-Bshareable -Wl,-Bsymbolic -Wl,-assert -Wl,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
|
1993-11-03 23:41:59 +00:00
|
|
|
BINDIR= /usr/libexec
|
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
|
|
|
|
1994-02-13 20:43:13 +00:00
|
|
|
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
|
|
|
|
|
1993-11-03 23:41:59 +00:00
|
|
|
.include <bsd.prog.mk>
|