2
0
mirror of https://frontier.innolan.net/github/amigaos-binutils.git synced 2025-11-19 21:21:20 +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:
bebbo
2017-02-13 18:59:08 +01:00
parent 6372b0a52e
commit 742d6bb698
2 changed files with 14 additions and 9 deletions

View File

@ -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:

View File

@ -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