diff options
author | Alan Modra <amodra@gmail.com> | 2013-01-15 06:13:26 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2013-01-15 06:13:26 +0000 |
commit | e24587436538578f3ee2dc671a8a619dd7a3f0bd (patch) | |
tree | 15f32d99a1c9191ab4b8432adc32e3a7f38f48fd /gold/powerpc.cc | |
parent | 4d490e4206b627b899f9791efbc3e602b2cb4c5f (diff) | |
download | gdb-e24587436538578f3ee2dc671a8a619dd7a3f0bd.zip gdb-e24587436538578f3ee2dc671a8a619dd7a3f0bd.tar.gz gdb-e24587436538578f3ee2dc671a8a619dd7a3f0bd.tar.bz2 |
bfd/
* elf64-ppc.c (ppc64_elf_size_stubs): Default shared libs to
plt-thread-safe.
gold/
* powerpc.cc (Target_powerpc::do_relax): Default shared libs to
plt-thread-safe.
ld/testsuite/
* ld-powerpc/tlsso.d: Adjust for plt-thread-safe stubs.
* ld-powerpc/tlsso.g: Likewise.
* ld-powerpc/tlsso.r: Likewise.
* ld-powerpc/tlstocso.d: Likewise.
* ld-powerpc/tlstocso.g: Likewise.
Diffstat (limited to 'gold/powerpc.cc')
-rw-r--r-- | gold/powerpc.cc | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/gold/powerpc.cc b/gold/powerpc.cc index 2a2277c..26ae337 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -2182,7 +2182,7 @@ Target_powerpc<size, big_endian>::do_relax(int pass, bool thread_safe = parameters->options().plt_thread_safe(); if (size == 64 && !parameters->options().user_set_plt_thread_safe()) { - const char* const thread_starter[] = + static const char* const thread_starter[] = { "pthread_create", /* libstdc++ */ @@ -2201,14 +2201,21 @@ Target_powerpc<size, big_endian>::do_relax(int pass, "GOMP_parallel_sections_start", }; - for (unsigned int i = 0; - i < sizeof(thread_starter) / sizeof(thread_starter[0]); - i++) + if (parameters->options().shared()) + thread_safe = true; + else { - Symbol* sym = symtab->lookup(thread_starter[i], NULL); - thread_safe = sym != NULL && sym->in_reg() && sym->in_real_elf(); - if (thread_safe) - break; + for (unsigned int i = 0; + i < sizeof(thread_starter) / sizeof(thread_starter[0]); + i++) + { + Symbol* sym = symtab->lookup(thread_starter[i], NULL); + thread_safe = (sym != NULL + && sym->in_reg() + && sym->in_real_elf()); + if (thread_safe) + break; + } } } this->plt_thread_safe_ = thread_safe; |