+2008-03-03 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-ppc.c (allocate_dynrelocs): Discard relocs on
+ undefined symbols with internal or hidden visibility.
+ (ppc_elf_relocate_section): Likewise. Use SYMBOL_CALLS_LOCAL
+ rather than SYMBOL_REFERENCES_LOCAL on branches. Don't
+ return immediately on dynamic reloc error.
+
2008-03-01 Alan Modra <amodra@bigpond.net.au>
* elf64-ppc.c (build_plt_stub): Add relocs on plt call stubs
}
}
+ /* Discard relocs on undefined symbols that must be local. */
+ if (eh->dyn_relocs != NULL
+ && h->root.type == bfd_link_hash_undefined
+ && (ELF_ST_VISIBILITY (h->other) == STV_HIDDEN
+ || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL))
+ eh->dyn_relocs = NULL;
+
/* Also discard relocs on undefined weak syms with non-default
visibility. */
if (eh->dyn_relocs != NULL
case R_PPC_REL14_BRNTAKEN:
/* If these relocations are not to a named symbol, they can be
handled right here, no need to bother the dynamic linker. */
- if (SYMBOL_REFERENCES_LOCAL (info, h)
+ if (SYMBOL_CALLS_LOCAL (info, h)
|| h == htab->elf.hgot)
break;
/* fall through */
break;
if ((info->shared
- && (h == NULL
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
+ && !(h != NULL
+ && ((h->root.type == bfd_link_hash_undefined
+ && (ELF_ST_VISIBILITY (h->other) == STV_HIDDEN
+ || ELF_ST_VISIBILITY (h->other) == STV_INTERNAL))
+ || (h->root.type == bfd_link_hash_undefweak
+ && ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)))
&& (MUST_BE_DYN_RELOC (r_type)
|| !SYMBOL_CALLS_LOCAL (info, h)))
|| (ELIMINATE_COPY_RELOCS
}
skip = 0;
-
outrel.r_offset =
_bfd_elf_section_offset (output_bfd, info, input_section,
rel->r_offset);
if (skip)
memset (&outrel, 0, sizeof outrel);
- else if (!SYMBOL_REFERENCES_LOCAL (info, h))
+ else if ((h != NULL
+ && (h->root.type == bfd_link_hash_undefined
+ || h->root.type == bfd_link_hash_undefweak))
+ || !SYMBOL_REFERENCES_LOCAL (info, h))
{
unresolved_reloc = FALSE;
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE);
else
{
- long indx;
+ long indx = 0;
if (bfd_is_abs_section (sec))
- indx = 0;
+ ;
else if (sec == NULL || sec->owner == NULL)
{
bfd_set_error (bfd_error_bad_value);
- return FALSE;
+ ret = FALSE;
}
else
{