From c5a43a5dc59c58726cde44ba374c66434ef75bc5 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 22 May 2002 05:06:18 +0000 Subject: [PATCH] 2002-05-21 H.J. Lu (hjl@gnu.org) * linker.c (_bfd_generic_link_add_one_symbol): Allow multiple definition. --- bfd/ChangeLog | 5 +++++ bfd/linker.c | 57 ++++++++++++++++++++++++++------------------------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9470bc53cc1..25af58b0793 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 * elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt. diff --git a/bfd/linker.c b/bfd/linker.c index 8d2287239ad..228f088a017 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: -- 2.30.2