diff options
author | Ian Lance Taylor <ian@airs.com> | 1993-01-29 19:47:56 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1993-01-29 19:47:56 +0000 |
commit | f31cb329d51c1344be1d0aaef7276f653ba23c5b (patch) | |
tree | 16b118c5ce5e0c7b53f091e896479c1a1423adf2 /ld | |
parent | 8a3efe67ae7637f8c58d8e65a246b98ac1e0a91d (diff) | |
download | gdb-f31cb329d51c1344be1d0aaef7276f653ba23c5b.zip gdb-f31cb329d51c1344be1d0aaef7276f653ba23c5b.tar.gz gdb-f31cb329d51c1344be1d0aaef7276f653ba23c5b.tar.bz2 |
Fri Jan 29 09:57:58 1993 Ian Lance Taylor (ian@cygnus.com)
* ldmain.c (subfile_wanted_p): If we already have a common
definition of a symbol, don't necessarily pull in an object file
that provides a non-common definition.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 4 | ||||
-rw-r--r-- | ld/ldmain.c | 15 |
2 files changed, 14 insertions, 5 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index d9ea6cb..b7ddaed 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,9 @@ Fri Jan 29 09:57:58 1993 Ian Lance Taylor (ian@cygnus.com) + * ldmain.c (subfile_wanted_p): If we already have a common + definition of a symbol, don't necessarily pull in an object file + that provides a non-common definition. + * ldlex.l (COMMAND): Accept -EB and -EL command line arguments, returning OPTION_EB and OPTION_EL. gcc passes these to a MIPS linker. diff --git a/ld/ldmain.c b/ld/ldmain.c index 207b604..767999b 100644 --- a/ld/ldmain.c +++ b/ld/ldmain.c @@ -958,9 +958,15 @@ subfile_wanted_p (entry) if (sp->srefs_chain != (asymbol **) NULL || sp->scoms_chain != (asymbol **) NULL) { - /* This is a symbol we are looking for. It is either - not yet defined or common. */ - + /* This is a symbol we are looking for. It is + either not yet defined or common. If this is a + common symbol, then if the symbol in the object + file is common, we need to combine sizes. But if + we already have a common symbol, and the symbol + in the object file is not common, we don't want + the object file: it is providing a definition for + a symbol that we already have a definition for + (this is the else condition below). */ if (bfd_is_com_section (p->section)) { @@ -1017,8 +1023,7 @@ subfile_wanted_p (entry) } ASSERT (p->udata == 0); } - - else + else if (sp->scoms_chain == (asymbol **) NULL) { if (write_map) { |