aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-04-17 13:08:32 +0930
committerAlan Modra <amodra@gmail.com>2014-04-17 13:10:35 +0930
commit4c34aff883e4fcc958a2d2c98874a035efc07651 (patch)
tree67c369bb3c5341233abcc2e6ea687c5cf51a7c22 /bfd/elflink.c
parent389b98f7d880c8551bec64f9e7fb0b05fa941de6 (diff)
downloadgdb-4c34aff883e4fcc958a2d2c98874a035efc07651.zip
gdb-4c34aff883e4fcc958a2d2c98874a035efc07651.tar.gz
gdb-4c34aff883e4fcc958a2d2c98874a035efc07651.tar.bz2
Fix LTO mismatched TLS reference
PR 16846 * elflink.c (_bfd_elf_merge_symbol): Ignore TLS mismatch when current bfd is a plugin. Don't always set type_change_ok when old bfd is a plugin.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 3de00e1..6756fb1 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1105,15 +1105,14 @@ _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". */
- else if (oldbfd != NULL
- && ELF_ST_TYPE (sym->st_info) != h->type
- && (ELF_ST_TYPE (sym->st_info) == STT_TLS || h->type == STT_TLS))
+ /* Check TLS symbols. We don't check undefined symbols introduced
+ by "ld -u" which have no type (and oldbfd NULL), and we don't
+ check symbols from plugins because they also have no type. */
+ if (oldbfd != NULL
+ && (oldbfd->flags & BFD_PLUGIN) == 0
+ && (abfd->flags & BFD_PLUGIN) == 0
+ && 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;