aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-07-25 13:52:32 +0930
committerAlan Modra <amodra@gmail.com>2017-07-25 15:14:39 +0930
commitd4aaa2a0744a28143f0b923802b6d1fa8db15887 (patch)
tree29a6410366e5a99161ed99b3a8756c1f9d7e8d1b /ld/testsuite
parentaafd38357af0c9c225f56afcb93cc3a4da763ccd (diff)
downloadgdb-d4aaa2a0744a28143f0b923802b6d1fa8db15887.zip
gdb-d4aaa2a0744a28143f0b923802b6d1fa8db15887.tar.gz
gdb-d4aaa2a0744a28143f0b923802b6d1fa8db15887.tar.bz2
__tls_get_addr_opt stub eh_frame info
Since the __tls_get_addr_opt stub saves LR and makes a call, eh_frame info should be generated to describe how to unwind through the stub. The patch also changes the way the backend iterates over stubs, from looking at all sections in stub_bfd to which all dynamic sections are attached as well, to iterating over the group list, which gets just the stub sections. Most binaries will have just one or two stub groups, so this is a little faster. bfd/ * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl. (stub_eh_frame_size): New function. (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl. (group_sections): Init group tls_get_addr_opt_bctrl. (ppc64_elf_size_stubs): Update sizing and initialization of .eh_frame. Iteration over stubs via group list. (ppc64_elf_build_stubs): Iterate over stubs via group list. (ppc64_elf_finish_dynamic_sections): Update finalization of .eh_frame. ld/ * testsuite/ld-powerpc/tlsopt5.s: Add cfi. * testsuite/ld-powerpc/tlsopt5.d: Update. * testsuite/ld-powerpc/tlsopt5.wf: New file. * testsuite/ld-powerpc/powerpc.exp: Perform new tlsopt5 test.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-powerpc/powerpc.exp2
-rw-r--r--ld/testsuite/ld-powerpc/tlsopt5.d4
-rw-r--r--ld/testsuite/ld-powerpc/tlsopt5.s2
-rw-r--r--ld/testsuite/ld-powerpc/tlsopt5.wf32
4 files changed, 37 insertions, 3 deletions
diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp
index 9816eff..6249ccb 100644
--- a/ld/testsuite/ld-powerpc/powerpc.exp
+++ b/ld/testsuite/ld-powerpc/powerpc.exp
@@ -211,7 +211,7 @@ set ppc64elftests {
{"TLS DLL" "-shared -melf64ppc --version-script tlsdll.ver" "" "-a64" {tlsdll.s}
{} "tlsdll.so"}
{"TLS opt 5" "-melf64ppc -shared --gc-sections --no-plt-localentry tmpdir/tlsdll.so" "" "-a64" {tlsopt5.s}
- {{objdump -dr tlsopt5.d}}
+ {{objdump -dr tlsopt5.d} {readelf -wf tlsopt5.wf}}
"tlsopt5"}
{"sym@tocbase" "-shared -melf64ppc" "" "-a64" {symtocbase-1.s symtocbase-2.s}
{{objdump -dj.data symtocbase.d}} "symtocbase.so"}
diff --git a/ld/testsuite/ld-powerpc/tlsopt5.d b/ld/testsuite/ld-powerpc/tlsopt5.d
index 7a74679..3c85185 100644
--- a/ld/testsuite/ld-powerpc/tlsopt5.d
+++ b/ld/testsuite/ld-powerpc/tlsopt5.d
@@ -31,8 +31,8 @@ Disassembly of section \.text:
.*: (08 80 62 38|38 62 80 08) addi r3,r2,-32760
.*: (b9 ff ff 4b|4b ff ff b9) bl .*
.*: (00 00 00 60|60 00 00 00) nop
-.*: (f8 01 01 00|00 00 00 00) .*
-.*: (00 00 00 00|00 01 01 f8) .*
+.*: (f8 02 01 00|00 00 00 00) .*
+.*: (00 00 00 00|00 01 02 f8) .*
0+318 <__glink_PLTresolve>:
.*: (a6 02 08 7c|7c 08 02 a6) mflr r0
diff --git a/ld/testsuite/ld-powerpc/tlsopt5.s b/ld/testsuite/ld-powerpc/tlsopt5.s
index 598bbd9..70902ef 100644
--- a/ld/testsuite/ld-powerpc/tlsopt5.s
+++ b/ld/testsuite/ld-powerpc/tlsopt5.s
@@ -1,5 +1,7 @@
.globl _start
_start:
+ .cfi_startproc
addi 3,2,gd@got@tlsgd
bl __tls_get_addr(gd@tlsgd)
nop
+ .cfi_endproc
diff --git a/ld/testsuite/ld-powerpc/tlsopt5.wf b/ld/testsuite/ld-powerpc/tlsopt5.wf
new file mode 100644
index 0000000..05ef7e0
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/tlsopt5.wf
@@ -0,0 +1,32 @@
+Contents of the \.eh_frame section:
+
+0+ 0+10 0+ CIE
+ Version: 1
+ Augmentation: "zR"
+ Code alignment factor: 4
+ Data alignment factor: -8
+ Return address column: 65
+ Augmentation data: 1b
+
+ DW_CFA_def_cfa: r1 ofs 0
+
+0+14 0+14 0+18 FDE cie=0+ pc=0+2c0\.\.0+304
+ DW_CFA_advance_loc: 48 to 0+2f0
+ DW_CFA_offset_extended_sf: r65 at cfa\+8
+ DW_CFA_advance_loc: 16 to 0+300
+ DW_CFA_restore_extended: r65
+
+0+2c 0+18 0+30 FDE cie=0+ pc=0+318\.\.0+354
+ DW_CFA_advance_loc: 4 to 0+31c
+ DW_CFA_register: r65 in r0
+ DW_CFA_advance_loc: 28 to 0+338
+ DW_CFA_restore_extended: r65
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop
+
+0+48 0+10 0+4c FDE cie=0+ pc=0+304\.\.0+310
+ DW_CFA_nop
+ DW_CFA_nop
+ DW_CFA_nop