summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/ld
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1995-03-22 19:38:07 +0000
committernate <nate@FreeBSD.org>1995-03-22 19:38:07 +0000
commitf5476ed249dfef61a5253cfdb8b93053d71f1410 (patch)
tree71b70e57ac342458873fbbc0d0a4f813af456812 /gnu/usr.bin/ld
parent8aa41de73432c33b1098c09ce7024f78f89faa17 (diff)
downloadFreeBSD-src-f5476ed249dfef61a5253cfdb8b93053d71f1410.zip
FreeBSD-src-f5476ed249dfef61a5253cfdb8b93053d71f1410.tar.gz
Modify the default behavior of the linker to no longer prefer static
members over shared library members. This modification causes the linker to use the first definition it sees for a symbol instead of having priorities based on the library type. This modification should allow gdb to compile again. Obtained from: Email conversation with Paul Kranenbury, but implemented completely by me. If it doesn't work, it's my fault not his.
Diffstat (limited to 'gnu/usr.bin/ld')
-rw-r--r--gnu/usr.bin/ld/lib.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gnu/usr.bin/ld/lib.c b/gnu/usr.bin/ld/lib.c
index 25512bb..e1e15d2 100644
--- a/gnu/usr.bin/ld/lib.c
+++ b/gnu/usr.bin/ld/lib.c
@@ -1,5 +1,5 @@
/*
- * $Id: lib.c,v 1.11 1994/12/23 22:30:45 nate Exp $ - library routines
+ * $Id: lib.c,v 1.12 1995/03/04 17:46:08 nate Exp $ - library routines
*/
#include <sys/param.h>
@@ -558,12 +558,9 @@ subfile_wanted_p(entry)
}
/*
- * At this point, either the new symbol is a common
- * and the shared object reference is undefined --
- * in which case we note the common -- or the shared
- * object reference has a definition -- in which case
- * the library member takes precedence.
- */
+ * If the shared object referenced is undefined
+ * then note is as a common.
+ */
if (iscommon) {
/*
* New symbol is common, just takes its
@@ -585,11 +582,17 @@ subfile_wanted_p(entry)
if (write_map) {
print_file_name(entry, stdout);
fprintf(stdout,
- " needed due to shared lib ref %s (%d)\n",
+ " uneeded due to shared lib ref %s (%d)\n",
sp->name,
lsp ? lsp->nzlist.nlist.n_type : -1);
}
- return 1;
+ /*
+ * The shared object reference has a definition.
+ * Since it was previously defined in a shlib, it
+ * takes precedence over the new definition in the
+ * library member.
+ */
+ return 0;
}
}
OpenPOWER on IntegriCloud