diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2002-05-22 05:06:18 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2002-05-22 05:06:18 +0000 |
commit | c5a43a5dc59c58726cde44ba374c66434ef75bc5 (patch) | |
tree | a5baf30af7478e6a86aa71b9cd041a2a5e567374 /bfd | |
parent | fcf4f89174eb264391b74f5b39b15ec354c3a2f7 (diff) | |
download | gdb-c5a43a5dc59c58726cde44ba374c66434ef75bc5.zip gdb-c5a43a5dc59c58726cde44ba374c66434ef75bc5.tar.gz gdb-c5a43a5dc59c58726cde44ba374c66434ef75bc5.tar.bz2 |
2002-05-21 H.J. Lu (hjl@gnu.org)
* linker.c (_bfd_generic_link_add_one_symbol): Allow multiple
definition.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/linker.c | 57 |
2 files changed, 34 insertions, 28 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9470bc5..25af58b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-05-21 H.J. Lu (hjl@gnu.org) + + * linker.c (_bfd_generic_link_add_one_symbol): Allow multiple + definition. + 2002-05-22 Alan Modra <amodra@bigpond.net.au> * elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt. diff --git a/bfd/linker.c b/bfd/linker.c index 8d22872..228f088 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -1813,37 +1813,38 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, /* Fall through. */ case MDEF: /* Handle a multiple definition. */ - { - asection *msec = NULL; - bfd_vma mval = 0; + if (!info->allow_multiple_definition) + { + asection *msec = NULL; + bfd_vma mval = 0; - switch (h->type) - { - case bfd_link_hash_defined: - msec = h->u.def.section; - mval = h->u.def.value; - break; - case bfd_link_hash_indirect: - msec = bfd_ind_section_ptr; - mval = 0; - break; - default: - abort (); - } + switch (h->type) + { + case bfd_link_hash_defined: + msec = h->u.def.section; + mval = h->u.def.value; + break; + case bfd_link_hash_indirect: + msec = bfd_ind_section_ptr; + mval = 0; + break; + default: + abort (); + } - /* Ignore a redefinition of an absolute symbol to the same - value; it's harmless. */ - if (h->type == bfd_link_hash_defined - && bfd_is_abs_section (msec) - && bfd_is_abs_section (section) - && value == mval) - break; + /* Ignore a redefinition of an absolute symbol to the + same value; it's harmless. */ + if (h->type == bfd_link_hash_defined + && bfd_is_abs_section (msec) + && bfd_is_abs_section (section) + && value == mval) + break; - if (! ((*info->callbacks->multiple_definition) - (info, h->root.string, msec->owner, msec, mval, abfd, - section, value))) - return false; - } + if (! ((*info->callbacks->multiple_definition) + (info, h->root.string, msec->owner, msec, mval, + abfd, section, value))) + return false; + } break; case CIND: |