diff options
author | nate <nate@FreeBSD.org> | 1995-03-22 19:38:07 +0000 |
---|---|---|
committer | nate <nate@FreeBSD.org> | 1995-03-22 19:38:07 +0000 |
commit | f5476ed249dfef61a5253cfdb8b93053d71f1410 (patch) | |
tree | 71b70e57ac342458873fbbc0d0a4f813af456812 /gnu/usr.bin/ld/lib.c | |
parent | 8aa41de73432c33b1098c09ce7024f78f89faa17 (diff) | |
download | FreeBSD-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/lib.c')
-rw-r--r-- | gnu/usr.bin/ld/lib.c | 21 |
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; } } |