mirror of
https://frontier.innolan.net/github/amigaos-binutils.git
synced 2025-11-20 00:01:16 +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;
|
break;
|
||||||
|
|
||||||
case CDEF:
|
case CDEF:
|
||||||
/* We have found a definition for a symbol which was
|
{
|
||||||
previously common. */
|
/* We have found a definition for a symbol which was
|
||||||
BFD_ASSERT (h->type == bfd_link_hash_common);
|
previously common. */
|
||||||
if (! ((*info->callbacks->multiple_common)
|
int rr = ((*info->callbacks->multiple_common)
|
||||||
(info, h->root.string,
|
(info, h->root.string,
|
||||||
h->u.c.p->section->owner, bfd_link_hash_common, h->u.c.size,
|
h->u.c.p->section->owner, bfd_link_hash_common, h->u.c.size,
|
||||||
abfd, bfd_link_hash_defined, (bfd_vma) 0)))
|
abfd, bfd_link_hash_defined, (bfd_vma)0));
|
||||||
return FALSE;
|
BFD_ASSERT(h->type == bfd_link_hash_common);
|
||||||
|
if (!rr)
|
||||||
|
return FALSE;
|
||||||
|
if (rr == 2)
|
||||||
|
break;
|
||||||
|
}
|
||||||
/* Fall through. */
|
/* Fall through. */
|
||||||
case DEF:
|
case DEF:
|
||||||
case DEFW:
|
case DEFW:
|
||||||
|
|||||||
@ -1018,7 +1018,7 @@ multiple_common (info, name, obfd, otype, osize, nbfd, ntype, nsize)
|
|||||||
bfd_vma nsize;
|
bfd_vma nsize;
|
||||||
{
|
{
|
||||||
if (! config.warn_common)
|
if (! config.warn_common)
|
||||||
return TRUE;
|
return 2;
|
||||||
|
|
||||||
if (ntype == bfd_link_hash_defined
|
if (ntype == bfd_link_hash_defined
|
||||||
|| ntype == bfd_link_hash_defweak
|
|| ntype == bfd_link_hash_defweak
|
||||||
|
|||||||
Reference in New Issue
Block a user