+2011-06-22 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_merge_symbol): Allow type changes for
+ plugin symbols. Fix segfault on linker scrip defined syms.
+
2011-06-20 Jakub Jelinek <jakub@redhat.com>
PR ld/12570
return TRUE;
}
+ /* Plugin symbol type isn't currently set. Stop bogus errors. */
+ if (oldbfd != NULL && (oldbfd->flags & BFD_PLUGIN) != 0)
+ *type_change_ok = TRUE;
+
/* Check TLS symbol. We don't check undefined symbol introduced by
"ld -u". */
- if ((ELF_ST_TYPE (sym->st_info) == STT_TLS || h->type == STT_TLS)
- && ELF_ST_TYPE (sym->st_info) != h->type
- && oldbfd != NULL)
+ else if (oldbfd != NULL
+ && ELF_ST_TYPE (sym->st_info) != h->type
+ && (ELF_ST_TYPE (sym->st_info) == STT_TLS || h->type == STT_TLS))
{
bfd *ntbfd, *tbfd;
bfd_boolean ntdef, tdef;
if (newdef && olddef && newweak)
{
/* Don't skip new non-IR weak syms. */
- if (!((oldbfd->flags & BFD_PLUGIN) != 0
+ if (!(oldbfd != NULL
+ && (oldbfd->flags & BFD_PLUGIN) != 0
&& (abfd->flags & BFD_PLUGIN) == 0))
*skip = TRUE;