aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-06-21 14:55:26 +0000
committerAlan Modra <amodra@gmail.com>2011-06-21 14:55:26 +0000
commit3a5dbfb2502e7a49422f13c9cec2becfd46f44f1 (patch)
treedc07f9e2ad579312248d5d3c53ba7e81d48f5a64 /bfd
parent7529d48023d3c40b2ab2644cc4cf42ca75d8a066 (diff)
downloadgdb-3a5dbfb2502e7a49422f13c9cec2becfd46f44f1.zip
gdb-3a5dbfb2502e7a49422f13c9cec2becfd46f44f1.tar.gz
gdb-3a5dbfb2502e7a49422f13c9cec2becfd46f44f1.tar.bz2
* elflink.c (_bfd_elf_merge_symbol): Allow type changes for
plugin symbols. Fix segfault on linker scrip defined syms.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.c13
2 files changed, 14 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 327f83b..48fe504 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/bfd/elflink.c b/bfd/elflink.c
index a4b7a7a..b518da8 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1080,11 +1080,15 @@ _bfd_elf_merge_symbol (bfd *abfd,
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;
@@ -1423,7 +1427,8 @@ _bfd_elf_merge_symbol (bfd *abfd,
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;