+2013-01-15 Alan Modra <amodra@gmail.com>
+
+ * elf64-ppc.c (ppc64_elf_size_stubs): Default shared libs to
+ plt-thread-safe.
+
2013-01-14 Alan Modra <amodra@gmail.com>
PR binutils/14813
htab->plt_static_chain = plt_static_chain;
htab->plt_stub_align = plt_stub_align;
+ if (plt_thread_safe == -1 && !info->executable)
+ plt_thread_safe = 1;
if (plt_thread_safe == -1)
{
- const char *const thread_starter[] =
+ static const char *const thread_starter[] =
{
"pthread_create",
/* libstdc++ */
+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.
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++ */
"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;
+2013-01-15 Alan Modra <amodra@gmail.com>
+
+ * 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.
+
2013-01-15 Alan Modra <amodra@gmail.com>
* ld-plugin/lto-16a.d: Match powerpc64 function symbol type.
.* (e9 62 80 78|78 80 62 e9) ld r11,-32648\(r2\)
.* (7d 69 03 a6|a6 03 69 7d) mtctr r11
.* (e8 42 80 80|80 80 42 e8) ld r2,-32640\(r2\)
-.* (4e 80 04 20|20 04 80 4e) bctr
+.* (28 22 00 00|00 00 22 28) cmpldi r2,0
+.* (4c e2 04 20|20 04 e2 4c) bnectr\+
+.* (48 00 00 ..|.. 00 00 48) b .* <__glink_PLTresolve\+0x38>
.* <_start>:
.* (38 62 80 20|20 80 62 38) addi r3,r2,-32736
-.* (4b ff ff e9|e9 ff ff 4b) bl .*
+.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.*
.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\)
.* (38 62 80 50|50 80 62 38) addi r3,r2,-32688
-.* (4b ff ff dd|dd ff ff 4b) bl .*
+.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.*
.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\)
.* (38 62 80 38|38 80 62 38) addi r3,r2,-32712
-.* (4b ff ff d1|d1 ff ff 4b) bl .*
+.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.*
.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\)
.* (38 62 80 50|50 80 62 38) addi r3,r2,-32688
-.* (4b ff ff c5|c5 ff ff 4b) bl .*
+.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.*
.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\)
.* (39 23 80 40|40 80 23 39) addi r9,r3,-32704
.* (3d 23 00 00|00 00 23 3d) addis r9,r3,0
.* (3d 2d 00 00|00 00 2d 3d) addis r9,r13,0
.* (99 49 00 00|00 00 49 99) stb r10,0\(r9\)
.* (38 62 80 08|08 80 62 38) addi r3,r2,-32760
-.* (4b ff ff 91|91 ff ff 4b) bl .*
+.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.*
.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\)
.* (38 62 80 50|50 80 62 38) addi r3,r2,-32688
-.* (4b ff ff 85|85 ff ff 4b) bl .*
+.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.*
.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\)
.* (f9 43 80 08|08 80 43 f9) std r10,-32760\(r3\)
.* (3d 23 00 00|00 00 23 3d) addis r9,r3,0
.*: +file format elf64-powerpc
Contents of section \.got:
-.* (00000000|80870100) (00018780|00000000) 00000000 00000000 .*
+ 10788 (00000000|88870100) (00018788|00000000) 00000000 00000000 .*
.* 00000000 00000000 00000000 00000000 .*
.* 00000000 00000000 00000000 00000000 .*
.* 00000000 00000000 00000000 00000000 .*
[0-9a-f ]+R_PPC64_TPREL16 +0+60 le0 \+ 0
[0-9a-f ]+R_PPC64_TPREL16_HA +0+68 le1 \+ 0
[0-9a-f ]+R_PPC64_TPREL16_LO +0+68 le1 \+ 0
-[0-9a-f ]+R_PPC64_TPREL16_DS +0+105f8 \.tdata \+ 28
-[0-9a-f ]+R_PPC64_TPREL16_HA +0+105f8 \.tdata \+ 30
-[0-9a-f ]+R_PPC64_TPREL16_LO +0+105f8 \.tdata \+ 30
+[0-9a-f ]+R_PPC64_TPREL16_DS +[0-9a-f]+ \.tdata \+ 28
+[0-9a-f ]+R_PPC64_TPREL16_HA +[0-9a-f]+ \.tdata \+ 30
+[0-9a-f ]+R_PPC64_TPREL16_LO +[0-9a-f]+ \.tdata \+ 30
[0-9a-f ]+R_PPC64_DTPMOD64 +0
[0-9a-f ]+R_PPC64_DTPREL64 +0
[0-9a-f ]+R_PPC64_DTPREL64 +18
.* (e9 62 80 70|70 80 62 e9) ld r11,-32656\(r2\)
.* (7d 69 03 a6|a6 03 69 7d) mtctr r11
.* (e8 42 80 78|78 80 42 e8) ld r2,-32648\(r2\)
-.* (4e 80 04 20|20 04 80 4e) bctr
+.* (28 22 00 00|00 00 22 28) cmpldi r2,0
+.* (4c e2 04 20|20 04 e2 4c) bnectr\+
+.* (48 00 00 ..|.. 00 00 48) b .* <__glink_PLTresolve\+0x38>
.* <_start>:
.* (38 62 80 08|08 80 62 38) addi r3,r2,-32760
-.* (4b ff ff e9|e9 ff ff 4b) bl .*
+.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.*
.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\)
.* (38 62 80 18|18 80 62 38) addi r3,r2,-32744
-.* (4b ff ff dd|dd ff ff 4b) bl .*
+.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.*
.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\)
.* (38 62 80 28|28 80 62 38) addi r3,r2,-32728
-.* (4b ff ff d1|d1 ff ff 4b) bl .*
+.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.*
.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\)
.* (38 62 80 38|38 80 62 38) addi r3,r2,-32712
-.* (4b ff ff c5|c5 ff ff 4b) bl .*
+.* (4b ff ff ..|.. ff ff 4b) bl .*plt_call.__tls_get_addr.*
.* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\)
.* (39 23 80 40|40 80 23 39) addi r9,r3,-32704
.* (3d 23 00 00|00 00 23 3d) addis r9,r3,0
.*
Contents of section \.got:
-.* 00000000 (000186c0|c0860100) 00000000 00000000 .*
+ 106c8 00000000 (000186c8|c8860100) 00000000 00000000 .*
.* 00000000 00000000 00000000 00000000 .*
.* 00000000 00000000 00000000 00000000 .*
.* 00000000 00000000 00000000 00000000 .*