Add -r option to 6l/8l/5l.
This permits more flexibility with cgo and swig in cases where
the program is run on a machine other than the one on which it
is built. Rather than storing the absolute path to the shared
library in the DT_NEEDED entry, we can store just the name,
and let the dynamic linker find it using DT_RUNPATH or the
LD_LIBRARY_PATH environment variable.
R=rsc
CC=golang-dev
https://golang.org/cl/223068
diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c
index d951696..b75f8be 100644
--- a/src/cmd/6l/obj.c
+++ b/src/cmd/6l/obj.c
@@ -76,7 +76,7 @@
void
usage(void)
{
- fprint(2, "usage: 6l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-o out] main.6\n");
+ fprint(2, "usage: 6l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-r path] [-o out] main.6\n");
exits("usage");
}
@@ -126,6 +126,9 @@
case 'R':
INITRND = atolwhex(EARGF(usage()));
break;
+ case 'r':
+ rpath = EARGF(usage());
+ break;
case 'x': /* produce export table */
doexp = 1;
if(argv[1] != nil && argv[1][0] != '-' && !isobjfile(argv[1]))