diff options
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 5 | ||||
-rw-r--r-- | gold/powerpc.cc | 23 |
2 files changed, 20 insertions, 8 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index cb6ec9e..f5969f0 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,5 +1,10 @@ 2013-01-15 Alan Modra <amodra@gmail.com> + * powerpc.cc (Target_powerpc::do_relax): Default shared libs to + plt-thread-safe. + +2013-01-15 Alan Modra <amodra@gmail.com> + * testsuite/Makefile.am (final_layout_script.lds): Handle .got section. * testsuite/Makefile.in: Regenerate. 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; |