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.
This commit is contained in:
nate 1995-03-22 19:38:07 +00:00
parent 8aa41de734
commit f5476ed249

View File

@ -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;
}
}