diff options
Diffstat (limited to 'bfd/elf32-tilepro.c')
-rw-r--r-- | bfd/elf32-tilepro.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c index fc49e2b..db37403 100644 --- a/bfd/elf32-tilepro.c +++ b/bfd/elf32-tilepro.c @@ -1868,11 +1868,33 @@ tilepro_elf_gc_mark_hook (asection *sec, if (h != NULL) { switch (ELF32_R_TYPE (rel->r_info)) - { - case R_TILEPRO_GNU_VTINHERIT: - case R_TILEPRO_GNU_VTENTRY: - break; - } + { + case R_TILEPRO_GNU_VTINHERIT: + case R_TILEPRO_GNU_VTENTRY: + return NULL; + } + } + + /* FIXME: The test here, in check_relocs and in relocate_section + dealing with TLS optimization, ought to be !info->executable. */ + if (info->shared) + { + 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); |