This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] tile: Remove the __tls_get_addr check from gc_mark_hook
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Tue, 17 Oct 2017 14:27:36 -0700
- Subject: [PATCH] tile: Remove the __tls_get_addr check from gc_mark_hook
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Reference to __tls_get_addr is created by check_relocs. Since check_relocs
is called after garbage collection now, the __tls_get_addr check should be
removed from gc_mark_hook.
Tested with glibc build-many-glibcs.py. OK for master?
* elf32-tilepro.c (tilepro_elf_gc_mark_hook): Remove the
__tls_get_addr check.
* elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
---
bfd/elf32-tilepro.c | 22 ----------------------
bfd/elfxx-tilegx.c | 22 ----------------------
2 files changed, 44 deletions(-)
diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c
index 7ab60bbaca..5c40f0f405 100644
--- a/bfd/elf32-tilepro.c
+++ b/bfd/elf32-tilepro.c
@@ -1860,28 +1860,6 @@ tilepro_elf_gc_mark_hook (asection *sec,
}
}
- /* FIXME: The test here, in check_relocs and in relocate_section
- dealing with TLS optimization, ought to be !bfd_link_executable (info). */
- if (bfd_link_pic (info))
- {
- switch (ELF32_R_TYPE (rel->r_info))
- {
- case R_TILEPRO_TLS_GD_CALL:
- /* This reloc implicitly references __tls_get_addr. We know
- another reloc will reference the same symbol as the one
- on this reloc, so the real symbol and section will be
- gc marked when processing the other reloc. That lets
- us handle __tls_get_addr here. */
- h = elf_link_hash_lookup (elf_hash_table (info), "__tls_get_addr",
- FALSE, FALSE, TRUE);
- BFD_ASSERT (h != NULL);
- h->mark = 1;
- if (h->u.weakdef != NULL)
- h->u.weakdef->mark = 1;
- sym = NULL;
- }
- }
-
return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
}
diff --git a/bfd/elfxx-tilegx.c b/bfd/elfxx-tilegx.c
index c9e860a70c..3927f552a0 100644
--- a/bfd/elfxx-tilegx.c
+++ b/bfd/elfxx-tilegx.c
@@ -2099,28 +2099,6 @@ tilegx_elf_gc_mark_hook (asection *sec,
}
}
- /* FIXME: The test here, in check_relocs and in relocate_section
- dealing with TLS optimization, ought to be !bfd_link_executable (info). */
- if (bfd_link_pic (info))
- {
- switch (TILEGX_ELF_R_TYPE (rel->r_info))
- {
- case R_TILEGX_TLS_GD_CALL:
- /* This reloc implicitly references __tls_get_addr. We know
- another reloc will reference the same symbol as the one
- on this reloc, so the real symbol and section will be
- gc marked when processing the other reloc. That lets
- us handle __tls_get_addr here. */
- h = elf_link_hash_lookup (elf_hash_table (info), "__tls_get_addr",
- FALSE, FALSE, TRUE);
- BFD_ASSERT (h != NULL);
- h->mark = 1;
- if (h->u.weakdef != NULL)
- h->u.weakdef->mark = 1;
- sym = NULL;
- }
- }
-
return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
}
--
2.13.6