diff options
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 4 | ||||
-rw-r--r-- | gold/ChangeLog | 5 | ||||
-rw-r--r-- | gold/powerpc.cc | 23 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso.d | 16 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso.g | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlsso.r | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlstocso.d | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-powerpc/tlstocso.g | 2 |
10 files changed, 57 insertions, 26 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c296b46..7aeba6f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 151c0ce..9ce20af 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -11334,9 +11334,11 @@ ppc64_elf_size_stubs (struct bfd_link_info *info, bfd_signed_vma group_size, 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++ */ 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; diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index d58f416..fd14adc 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,5 +1,13 @@ 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. * ld-plugin/lto-16b.d: Likewise. * ld-plugin/lto-17a.d: Likewise. diff --git a/ld/testsuite/ld-powerpc/tlsso.d b/ld/testsuite/ld-powerpc/tlsso.d index 38c7d95..e0bc9a0 100644 --- a/ld/testsuite/ld-powerpc/tlsso.d +++ b/ld/testsuite/ld-powerpc/tlsso.d @@ -13,20 +13,22 @@ Disassembly of section \.text: .* (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 @@ -39,10 +41,10 @@ Disassembly of section \.text: .* (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 diff --git a/ld/testsuite/ld-powerpc/tlsso.g b/ld/testsuite/ld-powerpc/tlsso.g index 6ff9837..8536803 100644 --- a/ld/testsuite/ld-powerpc/tlsso.g +++ b/ld/testsuite/ld-powerpc/tlsso.g @@ -7,7 +7,7 @@ .*: +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 .* diff --git a/ld/testsuite/ld-powerpc/tlsso.r b/ld/testsuite/ld-powerpc/tlsso.r index 815e3ac..2475fb4 100644 --- a/ld/testsuite/ld-powerpc/tlsso.r +++ b/ld/testsuite/ld-powerpc/tlsso.r @@ -48,9 +48,9 @@ Relocation section '\.rela\.dyn' at offset .* contains 16 entries: [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 diff --git a/ld/testsuite/ld-powerpc/tlstocso.d b/ld/testsuite/ld-powerpc/tlstocso.d index 32c1682..c91c30b 100644 --- a/ld/testsuite/ld-powerpc/tlstocso.d +++ b/ld/testsuite/ld-powerpc/tlstocso.d @@ -13,20 +13,22 @@ Disassembly of section \.text: .* (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 diff --git a/ld/testsuite/ld-powerpc/tlstocso.g b/ld/testsuite/ld-powerpc/tlstocso.g index 18fb6ac..a22497d 100644 --- a/ld/testsuite/ld-powerpc/tlstocso.g +++ b/ld/testsuite/ld-powerpc/tlstocso.g @@ -7,7 +7,7 @@ .* 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 .* |