2002-05-21 H.J. Lu (hjl@gnu.org)
* linker.c (_bfd_generic_link_add_one_symbol): Allow multiple definition.
This commit is contained in:
parent
fcf4f89174
commit
c5a43a5dc5
2 changed files with 34 additions and 28 deletions
|
@ -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.
|
||||
|
|
57
bfd/linker.c
57
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;
|
||||
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;
|
||||
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;
|
||||
|
||||
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:
|
||||
|
|
Loading…
Reference in a new issue