diff options
author | Nick Clifton <nickc@redhat.com> | 2009-08-26 13:35:37 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2009-08-26 13:35:37 +0000 |
commit | e5f2b1de7c60e55d86dab61eaa3750eca33ef367 (patch) | |
tree | 4bc2c1e39f020277f9bdd4e5dad6a0580e54ed53 /bfd/elf32-m68k.c | |
parent | f7922329bf858a53e75d0affc239ce08bea43fb8 (diff) | |
download | gdb-e5f2b1de7c60e55d86dab61eaa3750eca33ef367.zip gdb-e5f2b1de7c60e55d86dab61eaa3750eca33ef367.tar.gz gdb-e5f2b1de7c60e55d86dab61eaa3750eca33ef367.tar.bz2 |
* elf32-m68k.c (elf_m68k_copy_indirect_symbol): Propagate non_got_ref
value.
(elf_m68k_check_relocs): Handle dynamic TLS relocations.
Handle non_got_ref field.
(elf_m68k_adjust_dynamic_symbol): Handle non_got_ref field.
* tls-def-1.s, tls-def-1.d, tls-gd-1.d2, tls-gd-1.d3, tls-main-1.s,
* tls-main-1.d: New files.
* m68k.exp: Run new TLS tests.
Diffstat (limited to 'bfd/elf32-m68k.c')
-rw-r--r-- | bfd/elf32-m68k.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 2957db0..ced19a1 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -2487,6 +2487,10 @@ elf_m68k_copy_indirect_symbol (struct bfd_link_info *info, dir = elf_m68k_hash_entry (_dir); ind = elf_m68k_hash_entry (_ind); + /* Any absolute non-dynamic relocations against an indirect or weak + definition will be against the target symbol. */ + _dir->non_got_ref |= _ind->non_got_ref; + /* We might have a direct symbol already having entries in the GOTs. Update its key only in case indirect symbol has GOT entries and assert that both indirect and direct symbols don't have GOT entries @@ -2581,6 +2585,14 @@ elf_m68k_check_relocs (abfd, info, sec, relocs) case R_68K_TLS_IE16: case R_68K_TLS_IE32: + case R_68K_TLS_TPREL32: + case R_68K_TLS_DTPREL32: + + if (ELF32_R_TYPE (rel->r_info) == R_68K_TLS_TPREL32 + && info->shared) + /* Do the special chorus for libraries with static TLS. */ + info->flags |= DF_STATIC_TLS; + /* This symbol requires a global offset table entry. */ if (dynobj == NULL) @@ -2739,6 +2751,10 @@ elf_m68k_check_relocs (abfd, info, sec, relocs) /* Make sure a plt entry is created for this symbol if it turns out to be a function defined by a dynamic object. */ h->plt.refcount++; + + if (!info->shared) + /* This symbol needs a non-GOT reference. */ + h->non_got_ref = 1; } /* If we are creating a shared library, we need to copy the @@ -2946,6 +2962,9 @@ elf_m68k_gc_sweep_hook (bfd *abfd, case R_68K_TLS_IE16: case R_68K_TLS_IE32: + case R_68K_TLS_TPREL32: + case R_68K_TLS_DTPREL32: + if (got == NULL) { got = elf_m68k_get_bfd2got_entry (elf_m68k_multi_got (info), @@ -3159,6 +3178,11 @@ elf_m68k_adjust_dynamic_symbol (info, h) if (info->shared) return TRUE; + /* If there are no references to this symbol that do not use the + GOT, we don't need to generate a copy reloc. */ + if (!h->non_got_ref) + return TRUE; + if (h->size == 0) { (*_bfd_error_handler) (_("dynamic variable `%s' is zero size"), |