summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gnu/usr.bin/ld/Makefile4
-rw-r--r--gnu/usr.bin/ld/ld.c23
-rw-r--r--gnu/usr.bin/ld/ldconfig/Makefile4
-rw-r--r--gnu/usr.bin/ld/lib.c11
-rw-r--r--gnu/usr.bin/ld/rtld/Makefile6
-rw-r--r--gnu/usr.bin/ld/rtld/rtld.c7
-rw-r--r--gnu/usr.bin/ld/shlib.c7
-rw-r--r--gnu/usr.bin/ld/sparc/md.c10
-rw-r--r--gnu/usr.bin/ld/warnings.c4
-rw-r--r--libexec/rtld-aout/Makefile6
-rw-r--r--libexec/rtld-aout/rtld.c7
-rw-r--r--libexec/rtld-aout/shlib.c7
-rw-r--r--sbin/ldconfig/Makefile4
13 files changed, 61 insertions, 39 deletions
diff --git a/gnu/usr.bin/ld/Makefile b/gnu/usr.bin/ld/Makefile
index 8b43337..ff87a39 100644
--- a/gnu/usr.bin/ld/Makefile
+++ b/gnu/usr.bin/ld/Makefile
@@ -1,9 +1,9 @@
-# $Id: Makefile,v 1.2 1993/11/03 23:40:52 paul Exp $
+# $Id: Makefile,v 1.8 1993/11/03 13:01:36 cgd Exp $
#
PROG= ld
SRCS= ld.c symbol.c lib.c shlib.c warnings.c etc.c rrs.c xbits.c md.c
-CFLAGS += -I$(.CURDIR) -I$(.CURDIR)/$(MACHINE)
+CFLAGS += -g -I$(.CURDIR) -I$(.CURDIR)/$(MACHINE)
LDADD+= -lgnumalloc
DPADD+= /usr/lib/libgnumalloc.a
diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c
index a22d256..00de228 100644
--- a/gnu/usr.bin/ld/ld.c
+++ b/gnu/usr.bin/ld/ld.c
@@ -29,13 +29,10 @@ static char sccsid[] = "@(#)ld.c 6.10 (Berkeley) 5/22/91";
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Written by Richard Stallman with some help from Eric Albert.
- Set, indirect, and warning symbol features added by Randy Smith.
-
- NOTE: Set and indirect symbols are no longer supported by this
- version. (pk) */
+ Set, indirect, and warning symbol features added by Randy Smith. */
/*
- * $Id: ld.c,v 1.10 1993/11/01 16:26:13 pk Exp $
+ * $Id: ld.c,v 1.11 1993/11/05 12:47:11 pk Exp $
*/
/* Define how to initialize system-dependent header fields. */
@@ -1597,7 +1594,7 @@ digest_pass2()
/*
* It's data from shared object with size info.
*/
- if (sp->so_defined != (N_DATA + N_EXT))
+ if (!sp->so_defined)
fatal("%s: Bogus N_SIZE item", sp->name);
} else
@@ -1761,14 +1758,24 @@ consider_relocation (entry, dataseg)
continue;
}
- if (force_alias_definition &&
+ /*
+ * Only allocate an alias for function calls. Use
+ * sp->size here as a heuristic to discriminate
+ * between function definitions and data residing
+ * in the text segment.
+ * NOTE THAT THE COMPILER MUST NOT GENERATE ".size"
+ * DIRECTIVES FOR FUNCTIONS.
+ * In the future we might go for ".type" directives.
+ */
+ if (force_alias_definition && sp->size == 0 &&
sp->so_defined == N_TEXT + N_EXT) {
/* Call to shared library procedure */
alloc_rrs_jmpslot(sp);
} else if (sp->size &&
- sp->so_defined == N_DATA + N_EXT) {
+ (sp->so_defined == N_DATA + N_EXT ||
+ sp->so_defined == N_TEXT + N_EXT)) {
/* Reference to shared library data */
alloc_rrs_cpy_reloc(sp);
diff --git a/gnu/usr.bin/ld/ldconfig/Makefile b/gnu/usr.bin/ld/ldconfig/Makefile
index 231fec0..e655e26 100644
--- a/gnu/usr.bin/ld/ldconfig/Makefile
+++ b/gnu/usr.bin/ld/ldconfig/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1 1993/11/03 23:41:32 paul Exp $
+# $Id: Makefile,v 1.2 1993/11/03 05:20:49 cgd Exp $
PROG= ldconfig
SRCS= ldconfig.c shlib.c etc.c
@@ -6,7 +6,7 @@ LDDIR?= $(.CURDIR)/..
LDFLAGS += -static
CFLAGS += -I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) -O
BINDIR= ${DESTDIR}/sbin
-MAN8 = ldconfig.8
+MAN8 = ldconfig.0
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
diff --git a/gnu/usr.bin/ld/lib.c b/gnu/usr.bin/ld/lib.c
index 2ce8efb..d66f3df 100644
--- a/gnu/usr.bin/ld/lib.c
+++ b/gnu/usr.bin/ld/lib.c
@@ -1,5 +1,5 @@
/*
- * $Id: lib.c,v 1.3 1993/11/01 16:26:17 pk Exp $ - library routines
+ * $Id: lib.c,v 1.4 1993/11/05 12:43:11 pk Exp $ - library routines
*/
#include <sys/param.h>
@@ -228,7 +228,8 @@ symdef_library(desc, entry, member_length)
* global common 'utime' linked to a function).
*/
if (!(link_mode & FORCEARCHIVE) &&
- (!sp || !sp->referenced || sp->defined))
+ (!sp || sp->defined ||
+ (!sp->referenced && !sp->sorefs)) )
continue;
/*
@@ -478,14 +479,16 @@ subfile_wanted_p(entry)
if ( (type & N_EXT) &&
(type & N_STAB) == 0 &&
type != (N_UNDF | N_EXT))
- goto xxx;
+ break; /* We need it */
}
+ if (lsp != NULL)
+ continue; /* We don't need it */
+
if (write_map) {
print_file_name(entry, stdout);
fprintf(stdout, " needed due to shared lib ref %s\n", sp->name);
}
return 1;
- xxx: ;
}
}
diff --git a/gnu/usr.bin/ld/rtld/Makefile b/gnu/usr.bin/ld/rtld/Makefile
index 31283d7..a7975f6 100644
--- a/gnu/usr.bin/ld/rtld/Makefile
+++ b/gnu/usr.bin/ld/rtld/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1 1993/11/03 23:41:46 paul Exp $
+# $Id: Makefile,v 1.3 1993/11/08 13:20:39 pk Exp $
PROG= ld.so
SRCS= mdprologue.S rtld.c shlib.c etc.c md.c
@@ -8,7 +8,7 @@ LDDIR?= $(.CURDIR)/..
PICFLAG=-fpic
CFLAGS += -I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) -O $(PICFLAG) -DRTLD
LDFLAGS = -Bshareable -Bsymbolic -assert nosymbolic
-LIBS = -lc_pic -lgcc_pic
+LIBS = -lc_pic
BINDIR= /usr/libexec
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
@@ -16,7 +16,7 @@ BINDIR= /usr/libexec
.SUFFIXES: .S
$(PROG):
- $(LD) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIBS)
+ $(LD) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIBS) $(LDADD)
.S.o:
$(CPP) $(.IMPSRC) | $(AS) -k -o $(.TARGET) -
diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c
index 433820a..e833787 100644
--- a/gnu/usr.bin/ld/rtld/rtld.c
+++ b/gnu/usr.bin/ld/rtld/rtld.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: rtld.c,v 1.7 1993/11/03 21:35:54 pk Exp $
+ * $Id: rtld.c,v 1.8 1993/11/08 13:20:40 pk Exp $
*/
#include <sys/param.h>
@@ -888,10 +888,11 @@ int *usehints;
if (ld_path != NULL) {
/* Prefer paths from LD_LIBRARY_PATH */
- while ((cp = strtok(ld_path, ":")) != NULL) {
+ while ((cp = strsep(&ld_path, ":")) != NULL) {
- ld_path = NULL;
hint = findhint(name, major, minor, cp);
+ if (ld_path)
+ *(ld_path-1) = ':';
if (hint)
return hint;
}
diff --git a/gnu/usr.bin/ld/shlib.c b/gnu/usr.bin/ld/shlib.c
index 4be8354..55cd8c3 100644
--- a/gnu/usr.bin/ld/shlib.c
+++ b/gnu/usr.bin/ld/shlib.c
@@ -1,5 +1,5 @@
/*
- * $Id: shlib.c,v 1.3 1993/10/23 00:34:26 pk Exp $
+ * $Id: shlib.c,v 1.4 1993/11/08 13:21:23 pk Exp $
*/
#include <sys/param.h>
@@ -48,9 +48,10 @@ char *paths;
if (paths != NULL)
/* Add search directories from `paths' */
- while ((cp = strtok(paths, ":")) != NULL) {
- paths = NULL;
+ while ((cp = strsep(&paths, ":")) != NULL) {
add_search_dir(cp);
+ if (paths)
+ *(paths-1) = ':';
}
/* Append standard search directories */
diff --git a/gnu/usr.bin/ld/sparc/md.c b/gnu/usr.bin/ld/sparc/md.c
index 2fe093b..5424f15 100644
--- a/gnu/usr.bin/ld/sparc/md.c
+++ b/gnu/usr.bin/ld/sparc/md.c
@@ -1,5 +1,5 @@
/*
- * $Id: md.c,v 1.2 1993/10/27 00:56:17 pk Exp $
+ * $Id: md.c,v 1.3 1993/11/06 19:15:31 pk Exp $
*/
#include <sys/param.h>
@@ -148,6 +148,13 @@ md_init_header(hp, magic, flags)
struct exec *hp;
int magic, flags;
{
+#ifdef NetBSD
+ N_SETMAGIC((*hp), magic, MID_MACHINE, flags);
+
+ /* TEXT_START depends on the value of outheader.a_entry. */
+ if (!(link_mode & SHAREABLE)) /*WAS: if (entry_symbol) */
+ hp->a_entry = PAGSIZ;
+#else
hp->a_magic = magic;
hp->a_machtype = M_SPARC;
hp->a_toolversion = 1;
@@ -156,6 +163,7 @@ int magic, flags;
/* SunOS 4.1 N_TXTADDR depends on the value of outheader.a_entry. */
if (!(link_mode & SHAREABLE)) /*WAS: if (entry_symbol) */
hp->a_entry = N_PAGSIZ(*hp);
+#endif
}
/*
diff --git a/gnu/usr.bin/ld/warnings.c b/gnu/usr.bin/ld/warnings.c
index abce79e..e191074 100644
--- a/gnu/usr.bin/ld/warnings.c
+++ b/gnu/usr.bin/ld/warnings.c
@@ -1,5 +1,5 @@
/*
- * $Id: warnings.c,v 1.3 1993/11/01 16:26:20 pk Exp $
+ * $Id: warnings.c,v 1.4 1993/11/05 12:45:25 pk Exp $
*/
#include <sys/param.h>
@@ -685,7 +685,7 @@ do_file_warnings (entry, outfile)
} else if (BIT_SET_P (nlist_bitvector, i))
continue;
- else if (list_unresolved_refs && !g->defined) {
+ else if (list_unresolved_refs && !g->defined && !g->so_defined) {
if (g->undef_refs >= MAX_UREFS_PRINTED)
continue;
diff --git a/libexec/rtld-aout/Makefile b/libexec/rtld-aout/Makefile
index 31283d7..a7975f6 100644
--- a/libexec/rtld-aout/Makefile
+++ b/libexec/rtld-aout/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1 1993/11/03 23:41:46 paul Exp $
+# $Id: Makefile,v 1.3 1993/11/08 13:20:39 pk Exp $
PROG= ld.so
SRCS= mdprologue.S rtld.c shlib.c etc.c md.c
@@ -8,7 +8,7 @@ LDDIR?= $(.CURDIR)/..
PICFLAG=-fpic
CFLAGS += -I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) -O $(PICFLAG) -DRTLD
LDFLAGS = -Bshareable -Bsymbolic -assert nosymbolic
-LIBS = -lc_pic -lgcc_pic
+LIBS = -lc_pic
BINDIR= /usr/libexec
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
@@ -16,7 +16,7 @@ BINDIR= /usr/libexec
.SUFFIXES: .S
$(PROG):
- $(LD) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIBS)
+ $(LD) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIBS) $(LDADD)
.S.o:
$(CPP) $(.IMPSRC) | $(AS) -k -o $(.TARGET) -
diff --git a/libexec/rtld-aout/rtld.c b/libexec/rtld-aout/rtld.c
index 433820a..e833787 100644
--- a/libexec/rtld-aout/rtld.c
+++ b/libexec/rtld-aout/rtld.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: rtld.c,v 1.7 1993/11/03 21:35:54 pk Exp $
+ * $Id: rtld.c,v 1.8 1993/11/08 13:20:40 pk Exp $
*/
#include <sys/param.h>
@@ -888,10 +888,11 @@ int *usehints;
if (ld_path != NULL) {
/* Prefer paths from LD_LIBRARY_PATH */
- while ((cp = strtok(ld_path, ":")) != NULL) {
+ while ((cp = strsep(&ld_path, ":")) != NULL) {
- ld_path = NULL;
hint = findhint(name, major, minor, cp);
+ if (ld_path)
+ *(ld_path-1) = ':';
if (hint)
return hint;
}
diff --git a/libexec/rtld-aout/shlib.c b/libexec/rtld-aout/shlib.c
index 4be8354..55cd8c3 100644
--- a/libexec/rtld-aout/shlib.c
+++ b/libexec/rtld-aout/shlib.c
@@ -1,5 +1,5 @@
/*
- * $Id: shlib.c,v 1.3 1993/10/23 00:34:26 pk Exp $
+ * $Id: shlib.c,v 1.4 1993/11/08 13:21:23 pk Exp $
*/
#include <sys/param.h>
@@ -48,9 +48,10 @@ char *paths;
if (paths != NULL)
/* Add search directories from `paths' */
- while ((cp = strtok(paths, ":")) != NULL) {
- paths = NULL;
+ while ((cp = strsep(&paths, ":")) != NULL) {
add_search_dir(cp);
+ if (paths)
+ *(paths-1) = ':';
}
/* Append standard search directories */
diff --git a/sbin/ldconfig/Makefile b/sbin/ldconfig/Makefile
index 231fec0..e655e26 100644
--- a/sbin/ldconfig/Makefile
+++ b/sbin/ldconfig/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1 1993/11/03 23:41:32 paul Exp $
+# $Id: Makefile,v 1.2 1993/11/03 05:20:49 cgd Exp $
PROG= ldconfig
SRCS= ldconfig.c shlib.c etc.c
@@ -6,7 +6,7 @@ LDDIR?= $(.CURDIR)/..
LDFLAGS += -static
CFLAGS += -I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) -O
BINDIR= ${DESTDIR}/sbin
-MAN8 = ldconfig.8
+MAN8 = ldconfig.0
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
OpenPOWER on IntegriCloud