public inbox for gdb-testers@sourceware.org help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net To: gdb-testers@sourceware.org Subject: [binutils-gdb] Don't touch r11 in __tls_get_addr stub Date: Mon, 20 Jan 2020 15:39:00 -0000 [thread overview] Message-ID: <b9ca1af69e097b8dc15b23a4e12194f9567c4ad7@gdb-build> (raw) *** TEST RESULTS FOR COMMIT b9ca1af69e097b8dc15b23a4e12194f9567c4ad7 *** commit b9ca1af69e097b8dc15b23a4e12194f9567c4ad7 Author: Alan Modra <amodra@gmail.com> AuthorDate: Mon Jan 20 12:33:29 2020 +1030 Commit: Alan Modra <amodra@gmail.com> CommitDate: Mon Jan 20 18:58:05 2020 +1030 Don't touch r11 in __tls_get_addr stub This modifies the special __tls_get_addr stub that checks for a tlsdesc style __tls_index entry and returns early. Not using r11 isn't much benefit at the moment but a followup patch will preserve regs around the first call to __tls_get_addr when the __tls_index entry isn't yet set up for an early return. bfd/ * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1), (MTLR_R11): Don't define. (LD_R0_0R3, CMPDI_R0_0): Define. (build_tls_get_addr_stub): Don't use r11 in stub. ld/ * testsuite/ld-powerpc/tlsexe.d: Match new __tls_get_addr stub. * testsuite/ld-powerpc/tlsexeno.d: Likewise. * testsuite/ld-powerpc/tlsexetoc.d: Likewise. * testsuite/ld-powerpc/tlsexetocno.d: Likewise. * testsuite/ld-powerpc/tlsopt5.d: Likewise. diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 88db1f6a58..4f74a20544 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2020-01-20 Alan Modra <amodra@gmail.com> + + * elf64-ppc.c (LD_R11_0R3, CMPDI_R11_0, STD_R11_0R1, LD_R11_0R1), + (MTLR_R11): Don't define. + (LD_R0_0R3, CMPDI_R0_0): Define. + (build_tls_get_addr_stub): Don't use r11 in stub. + 2020-01-20 Alan Modra <amodra@gmail.com> * elf64-ppc.c (ppc_elf_hash_entry): New function, use throughout file. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 0e906cb481..3ae294b500 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -10885,17 +10885,14 @@ build_plt_stub (struct ppc_link_hash_table *htab, /* Build a special .plt call stub for __tls_get_addr. */ -#define LD_R11_0R3 0xe9630000 +#define LD_R0_0R3 0xe8030000 #define LD_R12_0R3 0xe9830000 #define MR_R0_R3 0x7c601b78 -#define CMPDI_R11_0 0x2c2b0000 +#define CMPDI_R0_0 0x2c200000 #define ADD_R3_R12_R13 0x7c6c6a14 #define BEQLR 0x4d820020 #define MR_R3_R0 0x7c030378 -#define STD_R11_0R1 0xf9610000 #define BCTRL 0x4e800421 -#define LD_R11_0R1 0xe9610000 -#define MTLR_R11 0x7d6803a6 static inline bfd_byte * build_tls_get_addr_stub (struct ppc_link_hash_table *htab, @@ -10905,10 +10902,10 @@ build_tls_get_addr_stub (struct ppc_link_hash_table *htab, bfd *obfd = htab->params->stub_bfd; bfd_byte *loc = p; - bfd_put_32 (obfd, LD_R11_0R3 + 0, p), p += 4; + bfd_put_32 (obfd, LD_R0_0R3 + 0, p), p += 4; bfd_put_32 (obfd, LD_R12_0R3 + 8, p), p += 4; + bfd_put_32 (obfd, CMPDI_R0_0, p), p += 4; bfd_put_32 (obfd, MR_R0_R3, p), p += 4; - bfd_put_32 (obfd, CMPDI_R11_0, p), p += 4; bfd_put_32 (obfd, ADD_R3_R12_R13, p), p += 4; bfd_put_32 (obfd, BEQLR, p), p += 4; bfd_put_32 (obfd, MR_R3_R0, p), p += 4; @@ -10917,8 +10914,8 @@ build_tls_get_addr_stub (struct ppc_link_hash_table *htab, if (stub_entry->stub_type != ppc_stub_plt_call_r2save) return build_plt_stub (htab, stub_entry, p, offset, r); - bfd_put_32 (obfd, MFLR_R11, p), p += 4; - bfd_put_32 (obfd, STD_R11_0R1 + STK_LINKER (htab), p), p += 4; + bfd_put_32 (obfd, MFLR_R0, p), p += 4; + bfd_put_32 (obfd, STD_R0_0R1 + STK_LINKER (htab), p), p += 4; if (r != NULL) r[0].r_offset += 2 * 4; @@ -10926,8 +10923,8 @@ build_tls_get_addr_stub (struct ppc_link_hash_table *htab, bfd_put_32 (obfd, BCTRL, p - 4); bfd_put_32 (obfd, LD_R2_0R1 + STK_TOC (htab), p), p += 4; - bfd_put_32 (obfd, LD_R11_0R1 + STK_LINKER (htab), p), p += 4; - bfd_put_32 (obfd, MTLR_R11, p), p += 4; + bfd_put_32 (obfd, LD_R0_0R1 + STK_LINKER (htab), p), p += 4; + bfd_put_32 (obfd, MTLR_R0, p), p += 4; bfd_put_32 (obfd, BLR, p), p += 4; if (htab->glink_eh_frame != NULL diff --git a/ld/ChangeLog b/ld/ChangeLog index c5f873407d..18d5073895 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2020-01-20 Alan Modra <amodra@gmail.com> + + * testsuite/ld-powerpc/tlsexe.d: Match new __tls_get_addr stub. + * testsuite/ld-powerpc/tlsexeno.d: Likewise. + * testsuite/ld-powerpc/tlsexetoc.d: Likewise. + * testsuite/ld-powerpc/tlsexetocno.d: Likewise. + * testsuite/ld-powerpc/tlsopt5.d: Likewise. + 2020-01-18 Roland McGrath <mcgrathr@google.com> * testsuite/ld-x86-64/align-branch-1.d: Loosen instruction regexps diff --git a/ld/testsuite/ld-powerpc/tlsexe.d b/ld/testsuite/ld-powerpc/tlsexe.d index a455df1802..263551b378 100644 --- a/ld/testsuite/ld-powerpc/tlsexe.d +++ b/ld/testsuite/ld-powerpc/tlsexe.d @@ -9,23 +9,23 @@ Disassembly of section \.text: .* <.*plt_call\.__tls_get_addr(|_opt)>: -.* (e9 63 00 00|00 00 63 e9) ld r11,0\(r3\) +.* (e8 03 00 00|00 00 03 e8) ld r0,0\(r3\) .* (e9 83 00 08|08 00 83 e9) ld r12,8\(r3\) +.* (2c 20 00 00|00 00 20 2c) cmpdi r0,0 .* (7c 60 1b 78|78 1b 60 7c) mr r0,r3 -.* (2c 2b 00 00|00 00 2b 2c) cmpdi r11,0 .* (7c 6c 6a 14|14 6a 6c 7c) add r3,r12,r13 .* (4d 82 00 20|20 00 82 4d) beqlr * .* (7c 03 03 78|78 03 03 7c) mr r3,r0 -.* (7d 68 02 a6|a6 02 68 7d) mflr r11 -.* (f9 61 00 20|20 00 61 f9) std r11,32\(r1\) +.* (7c 08 02 a6|a6 02 08 7c) mflr r0 +.* (f8 01 00 20|20 00 01 f8) std r0,32\(r1\) .* (f8 41 00 28|28 00 41 f8) std r2,40\(r1\) .* (e9 82 80 48|48 80 82 e9) ld r12,-32696\(r2\) .* (7d 89 03 a6|a6 03 89 7d) mtctr r12 .* (e8 42 80 50|50 80 42 e8) ld r2,-32688\(r2\) .* (4e 80 04 21|21 04 80 4e) bctrl .* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) -.* (e9 61 00 20|20 00 61 e9) ld r11,32\(r1\) -.* (7d 68 03 a6|a6 03 68 7d) mtlr r11 +.* (e8 01 00 20|20 00 01 e8) ld r0,32\(r1\) +.* (7c 08 03 a6|a6 03 08 7c) mtlr r0 .* (4e 80 00 20|20 00 80 4e) blr .* <._start>: diff --git a/ld/testsuite/ld-powerpc/tlsexeno.d b/ld/testsuite/ld-powerpc/tlsexeno.d index 4c5248563b..e0abc876bc 100644 --- a/ld/testsuite/ld-powerpc/tlsexeno.d +++ b/ld/testsuite/ld-powerpc/tlsexeno.d @@ -9,23 +9,23 @@ Disassembly of section \.text: .* <.*plt_call\.__tls_get_addr(|_opt)>: -.*: (e9 63 00 00|00 00 63 e9) ld r11,0\(r3\) +.*: (e8 03 00 00|00 00 03 e8) ld r0,0\(r3\) .*: (e9 83 00 08|08 00 83 e9) ld r12,8\(r3\) +.*: (2c 20 00 00|00 00 20 2c) cmpdi r0,0 .*: (7c 60 1b 78|78 1b 60 7c) mr r0,r3 -.*: (2c 2b 00 00|00 00 2b 2c) cmpdi r11,0 .*: (7c 6c 6a 14|14 6a 6c 7c) add r3,r12,r13 -.*: (4d 82 00 20|20 00 82 4d) beqlr +.*: (4d 82 00 20|20 00 82 4d) beqlr * .*: (7c 03 03 78|78 03 03 7c) mr r3,r0 -.*: (7d 68 02 a6|a6 02 68 7d) mflr r11 -.*: (f9 61 00 20|20 00 61 f9) std r11,32\(r1\) +.*: (7c 08 02 a6|a6 02 08 7c) mflr r0 +.*: (f8 01 00 20|20 00 01 f8) std r0,32\(r1\) .*: (f8 41 00 28|28 00 41 f8) std r2,40\(r1\) .*: (e9 82 80 88|88 80 82 e9) ld r12,-32632\(r2\) .*: (7d 89 03 a6|a6 03 89 7d) mtctr r12 .*: (e8 42 80 90|90 80 42 e8) ld r2,-32624\(r2\) .*: (4e 80 04 21|21 04 80 4e) bctrl .*: (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) -.*: (e9 61 00 20|20 00 61 e9) ld r11,32\(r1\) -.*: (7d 68 03 a6|a6 03 68 7d) mtlr r11 +.*: (e8 01 00 20|20 00 01 e8) ld r0,32\(r1\) +.*: (7c 08 03 a6|a6 03 08 7c) mtlr r0 .*: (4e 80 00 20|20 00 80 4e) blr .* <\._start>: diff --git a/ld/testsuite/ld-powerpc/tlsexetoc.d b/ld/testsuite/ld-powerpc/tlsexetoc.d index 4186fa2d2b..ddec3a9adb 100644 --- a/ld/testsuite/ld-powerpc/tlsexetoc.d +++ b/ld/testsuite/ld-powerpc/tlsexetoc.d @@ -9,23 +9,23 @@ Disassembly of section \.text: .* <.*plt_call\.__tls_get_addr(|_opt)>: -.* (e9 63 00 00|00 00 63 e9) ld r11,0\(r3\) +.* (e8 03 00 00|00 00 03 e8) ld r0,0\(r3\) .* (e9 83 00 08|08 00 83 e9) ld r12,8\(r3\) +.* (2c 20 00 00|00 00 20 2c) cmpdi r0,0 .* (7c 60 1b 78|78 1b 60 7c) mr r0,r3 -.* (2c 2b 00 00|00 00 2b 2c) cmpdi r11,0 .* (7c 6c 6a 14|14 6a 6c 7c) add r3,r12,r13 .* (4d 82 00 20|20 00 82 4d) beqlr * .* (7c 03 03 78|78 03 03 7c) mr r3,r0 -.* (7d 68 02 a6|a6 02 68 7d) mflr r11 -.* (f9 61 00 20|20 00 61 f9) std r11,32\(r1\) +.* (7c 08 02 a6|a6 02 08 7c) mflr r0 +.* (f8 01 00 20|20 00 01 f8) std r0,32\(r1\) .* (f8 41 00 28|28 00 41 f8) std r2,40\(r1\) .* (e9 82 80 70|70 80 82 e9) ld r12,-32656\(r2\) .* (7d 89 03 a6|a6 03 89 7d) mtctr r12 .* (e8 42 80 78|78 80 42 e8) ld r2,-32648\(r2\) .* (4e 80 04 21|21 04 80 4e) bctrl .* (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) -.* (e9 61 00 20|20 00 61 e9) ld r11,32\(r1\) -.* (7d 68 03 a6|a6 03 68 7d) mtlr r11 +.* (e8 01 00 20|20 00 01 e8) ld r0,32\(r1\) +.* (7c 08 03 a6|a6 03 08 7c) mtlr r0 .* (4e 80 00 20|20 00 80 4e) blr .* <\._start>: diff --git a/ld/testsuite/ld-powerpc/tlsexetocno.d b/ld/testsuite/ld-powerpc/tlsexetocno.d index 4f3b7a244d..4ef750db2d 100644 --- a/ld/testsuite/ld-powerpc/tlsexetocno.d +++ b/ld/testsuite/ld-powerpc/tlsexetocno.d @@ -9,23 +9,23 @@ Disassembly of section \.text: .* <.*plt_call\.__tls_get_addr(|_opt)>: -.*: (e9 63 00 00|00 00 63 e9) ld r11,0\(r3\) +.*: (e8 03 00 00|00 00 03 e8) ld r0,0\(r3\) .*: (e9 83 00 08|08 00 83 e9) ld r12,8\(r3\) +.*: (2c 20 00 00|00 00 20 2c) cmpdi r0,0 .*: (7c 60 1b 78|78 1b 60 7c) mr r0,r3 -.*: (2c 2b 00 00|00 00 2b 2c) cmpdi r11,0 .*: (7c 6c 6a 14|14 6a 6c 7c) add r3,r12,r13 -.*: (4d 82 00 20|20 00 82 4d) beqlr +.*: (4d 82 00 20|20 00 82 4d) beqlr * .*: (7c 03 03 78|78 03 03 7c) mr r3,r0 -.*: (7d 68 02 a6|a6 02 68 7d) mflr r11 -.*: (f9 61 00 20|20 00 61 f9) std r11,32\(r1\) +.*: (7c 08 02 a6|a6 02 08 7c) mflr r0 +.*: (f8 01 00 20|20 00 01 f8) std r0,32\(r1\) .*: (f8 41 00 28|28 00 41 f8) std r2,40\(r1\) .*: (e9 82 80 70|70 80 82 e9) ld r12,-32656\(r2\) .*: (7d 89 03 a6|a6 03 89 7d) mtctr r12 .*: (e8 42 80 78|78 80 42 e8) ld r2,-32648\(r2\) .*: (4e 80 04 21|21 04 80 4e) bctrl .*: (e8 41 00 28|28 00 41 e8) ld r2,40\(r1\) -.*: (e9 61 00 20|20 00 61 e9) ld r11,32\(r1\) -.*: (7d 68 03 a6|a6 03 68 7d) mtlr r11 +.*: (e8 01 00 20|20 00 01 e8) ld r0,32\(r1\) +.*: (7c 08 03 a6|a6 03 08 7c) mtlr r0 .*: (4e 80 00 20|20 00 80 4e) blr .* <\._start>: diff --git a/ld/testsuite/ld-powerpc/tlsopt5.d b/ld/testsuite/ld-powerpc/tlsopt5.d index a28502797c..596c426bd7 100644 --- a/ld/testsuite/ld-powerpc/tlsopt5.d +++ b/ld/testsuite/ld-powerpc/tlsopt5.d @@ -16,22 +16,22 @@ Disassembly of section \.text: \.\.\. .* <.*\.plt_call\.__tls_get_addr_opt@@GLIBC_2\.22>: -.*: (00 00 63 e9|e9 63 00 00) ld r11,0\(r3\) +.*: (00 00 03 e8|e8 03 00 00) ld r0,0\(r3\) .*: (08 00 83 e9|e9 83 00 08) ld r12,8\(r3\) +.*: (00 00 20 2c|2c 20 00 00) cmpdi r0,0 .*: (78 1b 60 7c|7c 60 1b 78) mr r0,r3 -.*: (00 00 2b 2c|2c 2b 00 00) cmpdi r11,0 .*: (14 6a 6c 7c|7c 6c 6a 14) add r3,r12,r13 -.*: (20 00 82 4d|4d 82 00 20) beqlr +.*: (20 00 82 4d|4d 82 00 20) beqlr * .*: (78 03 03 7c|7c 03 03 78) mr r3,r0 -.*: (a6 02 68 7d|7d 68 02 a6) mflr r11 -.*: (08 00 61 f9|f9 61 00 08) std r11,8\(r1\) +.*: (a6 02 08 7c|7c 08 02 a6) mflr r0 +.*: (08 00 01 f8|f8 01 00 08) std r0,8\(r1\) .*: (18 00 41 f8|f8 41 00 18) std r2,24\(r1\) .*: (30 80 82 e9|e9 82 80 30) ld r12,-32720\(r2\) .*: (a6 03 89 7d|7d 89 03 a6) mtctr r12 .*: (21 04 80 4e|4e 80 04 21) bctrl .*: (18 00 41 e8|e8 41 00 18) ld r2,24\(r1\) -.*: (08 00 61 e9|e9 61 00 08) ld r11,8\(r1\) -.*: (a6 03 68 7d|7d 68 03 a6) mtlr r11 +.*: (08 00 01 e8|e8 01 00 08) ld r0,8\(r1\) +.*: (a6 03 08 7c|7c 08 03 a6) mtlr r0 .*: (20 00 80 4e|4e 80 00 20) blr \.\.\.
next reply other threads:[~2020-01-20 13:14 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-01-20 15:39 gdb-buildbot [this message] 2020-01-20 15:39 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master gdb-buildbot 2020-01-21 17:01 ` Failures on Fedora-x86_64-m32, " gdb-buildbot 2020-01-21 17:31 ` Failures on Fedora-x86_64-cc-with-index, " gdb-buildbot 2020-01-21 17:32 ` Failures on Fedora-i686, " gdb-buildbot 2020-01-21 17:35 ` Failures on Fedora-x86_64-m64, " gdb-buildbot 2020-01-21 17:50 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot 2020-01-21 18:03 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot 2020-01-21 18:22 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot 2020-01-21 18:36 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=b9ca1af69e097b8dc15b23a4e12194f9567c4ad7@gdb-build \ --to=gdb-buildbot@sergiodj.net \ --cc=gdb-testers@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).