mirror of
https://frontier.innolan.net/github/amigaos-binutils.git
synced 2025-11-19 19:40:19 +00:00
@R with multiple defined symbols now the first definition is retained (was: last definition), thus object file definition have precedence over libs
This commit is contained in:
21
bfd/linker.c
21
bfd/linker.c
@ -1621,14 +1621,19 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value,
|
||||
break;
|
||||
|
||||
case CDEF:
|
||||
/* We have found a definition for a symbol which was
|
||||
previously common. */
|
||||
BFD_ASSERT (h->type == bfd_link_hash_common);
|
||||
if (! ((*info->callbacks->multiple_common)
|
||||
(info, h->root.string,
|
||||
h->u.c.p->section->owner, bfd_link_hash_common, h->u.c.size,
|
||||
abfd, bfd_link_hash_defined, (bfd_vma) 0)))
|
||||
return FALSE;
|
||||
{
|
||||
/* We have found a definition for a symbol which was
|
||||
previously common. */
|
||||
int rr = ((*info->callbacks->multiple_common)
|
||||
(info, h->root.string,
|
||||
h->u.c.p->section->owner, bfd_link_hash_common, h->u.c.size,
|
||||
abfd, bfd_link_hash_defined, (bfd_vma)0));
|
||||
BFD_ASSERT(h->type == bfd_link_hash_common);
|
||||
if (!rr)
|
||||
return FALSE;
|
||||
if (rr == 2)
|
||||
break;
|
||||
}
|
||||
/* Fall through. */
|
||||
case DEF:
|
||||
case DEFW:
|
||||
|
||||
@ -1018,7 +1018,7 @@ multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize)
|
||||
bfd_vma nsize;
|
||||
{
|
||||
if (! config.warn_common)
|
||||
return TRUE;
|
||||
return 2;
|
||||
|
||||
if (ntype == bfd_link_hash_defined
|
||||
|| ntype == bfd_link_hash_defweak
|
||||
|
||||
Reference in New Issue
Block a user