binutils: try to make ppc XCOFF weak symbols behave more like ELF

This commit is contained in:
Wolfgang Thaller 2015-09-08 10:12:37 +02:00
parent 65ffde8261
commit 9f7a6ac3a9
2 changed files with 17 additions and 9 deletions

View File

@ -3394,7 +3394,8 @@ xcoff_ppc_relocate_section (bfd *output_bfd,
else
{
if (info->unresolved_syms_in_objects != RM_IGNORE
&& (h->flags & XCOFF_WAS_UNDEFINED) != 0)
&& (h->flags & XCOFF_WAS_UNDEFINED) != 0
&& h->root.type != bfd_link_hash_undefweak)
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string,
@ -3412,13 +3413,18 @@ xcoff_ppc_relocate_section (bfd *output_bfd,
+ sec->output_section->vma
+ sec->output_offset);
}
else if (h->root.type == bfd_link_hash_common)
{
sec = h->root.u.c.p->section;
val = (sec->output_section->vma
+ sec->output_offset);
else if (h->root.type == bfd_link_hash_common)
{
sec = h->root.u.c.p->section;
val = (sec->output_section->vma
+ sec->output_offset);
}
}
else if (h->root.type == bfd_link_hash_undefweak)
{
sec = 0;
val = 0;
}
else
{
BFD_ASSERT (info->relocatable

View File

@ -2773,8 +2773,10 @@ xcoff_mark_symbol (struct bfd_link_info *info, struct xcoff_link_hash_entry *h)
/* Treat this symbol as undefined if the descriptor was. */
if ((hds->flags & XCOFF_WAS_UNDEFINED) != 0)
h->flags |= XCOFF_WAS_UNDEFINED;
{
if(h->root.type != bfd_link_hash_undefweak)
h->flags |= XCOFF_WAS_UNDEFINED;
}
/* Allocate room for the global linkage code itself. */
sec = xcoff_hash_table (info)->linkage_section;
h->root.type = bfd_link_hash_defined;