aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-04-06 19:03:35 +0930
committerAlan Modra <amodra@gmail.com>2021-04-09 16:56:43 +0930
commitc3f72de4f53bc3e5f13762633d78d8a7efb8dd79 (patch)
treed1be8ec3633ed86a3451c392d0202444f9a72f6e /gas
parent39178037a1cd78fed67b82aeec0313817c079c2a (diff)
downloadgdb-c3f72de4f53bc3e5f13762633d78d8a7efb8dd79.zip
gdb-c3f72de4f53bc3e5f13762633d78d8a7efb8dd79.tar.gz
gdb-c3f72de4f53bc3e5f13762633d78d8a7efb8dd79.tar.bz2
PowerPC disassembly of pcrel references
This adds some annotation to Power10 pcrel instructions, displaying the target address (ie. pc + D34 field) plus a symbol if there is one at exactly that target address. pld from the .got or .plt will also look up the entry and display it, symbolically if there is a dynamic relocation on the entry. include/ * dis-asm.h (struct disassemble_info): Add dynrelbuf and dynrelcount. binutils/ * objdump.c (struct objdump_disasm_info): Delete dynrelbuf and dynrelcount. (find_symbol_for_address): Adjust for dynrelbuf and dynrelcount move. (disassemble_section, disassemble_data): Likewise. opcodes/ * ppc-dis.c (struct dis_private): Add "special". (POWERPC_DIALECT): Delete. Replace uses with.. (private_data): ..this. New inline function. (disassemble_init_powerpc): Init "special" names. (skip_optional_operands): Add is_pcrel arg, set when detecting R field of prefix instructions. (bsearch_reloc, print_got_plt): New functions. (print_insn_powerpc): For pcrel instructions, print target address and symbol if known, and decode plt and got loads too. gas/ * testsuite/gas/ppc/prefix-pcrel.d: Update expected output. * testsuite/gas/ppc/prefix-reloc.d: Likewise. * gas/testsuite/gas/ppc/vsx_32byte.d: Likewise. ld/ * testsuite/ld-powerpc/inlinepcrel-1.d: Update expected output. * testsuite/ld-powerpc/inlinepcrel-2.d: Likewise. * testsuite/ld-powerpc/notoc2.d: Likewise. * testsuite/ld-powerpc/notoc3.d: Likewise. * testsuite/ld-powerpc/pcrelopt.d: Likewise. * testsuite/ld-powerpc/startstop.d: Likewise. * testsuite/ld-powerpc/tlsget.d: Likewise. * testsuite/ld-powerpc/tlsget2.d: Likewise. * testsuite/ld-powerpc/tlsld.d: Likewise. * testsuite/ld-powerpc/weak1.d: Likewise. * testsuite/ld-powerpc/weak1so.d: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/testsuite/gas/ppc/prefix-pcrel.d84
-rw-r--r--gas/testsuite/gas/ppc/prefix-reloc.d10
-rw-r--r--gas/testsuite/gas/ppc/vsx_32byte.d8
4 files changed, 57 insertions, 51 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ba23cc2..4efdc33 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2021-04-09 Alan Modra <amodra@gmail.com>
+
+ * testsuite/gas/ppc/prefix-pcrel.d: Update expected output.
+ * testsuite/gas/ppc/prefix-reloc.d: Likewise.
+ * gas/testsuite/gas/ppc/vsx_32byte.d: Likewise.
+
2021-04-08 Alan Modra <amodra@gmail.com>
* testsuite/gas/ppc/pr27676.d,
diff --git a/gas/testsuite/gas/ppc/prefix-pcrel.d b/gas/testsuite/gas/ppc/prefix-pcrel.d
index ad6abfb..0d10424 100644
--- a/gas/testsuite/gas/ppc/prefix-pcrel.d
+++ b/gas/testsuite/gas/ppc/prefix-pcrel.d
@@ -40,27 +40,27 @@ Disassembly of section \.text:
.*: (39 a9 00 00|00 00 a9 39)
.*: (06 02 00 00|00 00 02 06) paddi r13,r9,-8589934592
.*: (39 a9 00 00|00 00 a9 39)
-.*: (06 10 00 00|00 00 10 06) pla r14,0
+.*: (06 10 00 00|00 00 10 06) pla r14,0 # 80
.*: (39 c0 00 00|00 00 c0 39)
-.*: (06 10 00 00|00 00 10 06) pla r14,0
+.*: (06 10 00 00|00 00 10 06) pla r14,0 # 88
.*: (39 c0 00 00|00 00 c0 39)
-.*: (06 13 ff ff|ff ff 13 06) pla r15,-32769
+.*: (06 13 ff ff|ff ff 13 06) pla r15,-32769 # f+808f
.*: (39 e0 7f ff|ff 7f e0 39)
-.*: (06 13 ff ff|ff ff 13 06) pla r15,-32769
+.*: (06 13 ff ff|ff ff 13 06) pla r15,-32769 # f+8097
.*: (39 e0 7f ff|ff 7f e0 39)
-.*: (06 13 ff ff|ff ff 13 06) pla r15,-32769
+.*: (06 13 ff ff|ff ff 13 06) pla r15,-32769 # f+809f
.*: (39 e0 7f ff|ff 7f e0 39)
-.*: (06 11 ff ff|ff ff 11 06) pla r16,8589934591
+.*: (06 11 ff ff|ff ff 11 06) pla r16,8589934591 # 2000000a7
.*: (3a 00 ff ff|ff ff 00 3a)
-.*: (06 11 ff ff|ff ff 11 06) pla r16,8589934591
+.*: (06 11 ff ff|ff ff 11 06) pla r16,8589934591 # 2000000af
.*: (3a 00 ff ff|ff ff 00 3a)
-.*: (06 11 ff ff|ff ff 11 06) pla r16,8589934591
+.*: (06 11 ff ff|ff ff 11 06) pla r16,8589934591 # 2000000b7
.*: (3a 00 ff ff|ff ff 00 3a)
-.*: (06 12 00 00|00 00 12 06) pla r17,-8589934592
+.*: (06 12 00 00|00 00 12 06) pla r17,-8589934592 # f+e000000c0
.*: (3a 20 00 00|00 00 20 3a)
-.*: (06 12 00 00|00 00 12 06) pla r17,-8589934592
+.*: (06 12 00 00|00 00 12 06) pla r17,-8589934592 # f+e000000c8
.*: (3a 20 00 00|00 00 20 3a)
-.*: (06 12 00 00|00 00 12 06) pla r17,-8589934592
+.*: (06 12 00 00|00 00 12 06) pla r17,-8589934592 # f+e000000d0
.*: (3a 20 00 00|00 00 20 3a)
.*: (06 00 00 00|00 00 00 06) pli r20,13
.*: (3a 80 00 0d|0d 00 80 3a)
@@ -118,118 +118,118 @@ Disassembly of section \.text:
.*: (88 61 00 00|00 00 61 88)
.*: (06 00 00 00|00 00 00 06) plbz r3,0\(0\)
.*: (88 60 00 00|00 00 60 88)
-.*: (06 10 00 00|00 00 10 06) plbz r4,0
+.*: (06 10 00 00|00 00 10 06) plbz r4,0 # 1b8
.*: (88 80 00 00|00 00 80 88)
-.*: (06 10 00 00|00 00 10 06) plbz r4,0
+.*: (06 10 00 00|00 00 10 06) plbz r4,0 # 1c0
.*: (88 80 00 00|00 00 80 88)
.*: (06 03 ff ff|ff ff 03 06) plbz r3,-32769\(0\)
.*: (88 60 7f ff|ff 7f 60 88)
-.*: (06 13 ff ff|ff ff 13 06) plbz r4,-32769
+.*: (06 13 ff ff|ff ff 13 06) plbz r4,-32769 # f+81cf
.*: (88 80 7f ff|ff 7f 80 88)
-.*: (06 13 ff ff|ff ff 13 06) plbz r4,-32769
+.*: (06 13 ff ff|ff ff 13 06) plbz r4,-32769 # f+81d7
.*: (88 80 7f ff|ff 7f 80 88)
.*: (06 01 ff ff|ff ff 01 06) plbz r3,8589934591\(0\)
.*: (88 60 ff ff|ff ff 60 88)
-.*: (06 11 ff ff|ff ff 11 06) plbz r4,8589934591
+.*: (06 11 ff ff|ff ff 11 06) plbz r4,8589934591 # 2000001e7
.*: (88 80 ff ff|ff ff 80 88)
-.*: (06 11 ff ff|ff ff 11 06) plbz r4,8589934591
+.*: (06 11 ff ff|ff ff 11 06) plbz r4,8589934591 # 2000001ef
.*: (88 80 ff ff|ff ff 80 88)
.*: (06 02 00 00|00 00 02 06) plbz r3,-8589934592\(0\)
.*: (88 60 00 00|00 00 60 88)
-.*: (06 12 00 00|00 00 12 06) plbz r4,-8589934592
+.*: (06 12 00 00|00 00 12 06) plbz r4,-8589934592 # f+e00000200
.*: (88 80 00 00|00 00 80 88)
-.*: (06 12 00 00|00 00 12 06) plbz r4,-8589934592
+.*: (06 12 00 00|00 00 12 06) plbz r4,-8589934592 # f+e00000208
.*: (88 80 00 00|00 00 80 88)
.*: (06 00 00 00|00 00 00 06) plhz r5,4\(r10\)
.*: (a0 aa 00 04|04 00 aa a0)
-.*: (06 10 00 00|00 00 10 06) plhz r5,4
+.*: (06 10 00 00|00 00 10 06) plhz r5,4 # 21c
.*: (a0 a0 00 04|04 00 a0 a0)
.*: (06 00 00 00|00 00 00 06) plha r6,8\(r10\)
.*: (a8 ca 00 08|08 00 ca a8)
-.*: (06 10 00 00|00 00 10 06) plha r6,8
+.*: (06 10 00 00|00 00 10 06) plha r6,8 # 230
.*: (a8 c0 00 08|08 00 c0 a8)
.*: (06 00 00 00|00 00 00 06) plwz r7,12\(r10\)
.*: (80 ea 00 0c|0c 00 ea 80)
-.*: (06 10 00 00|00 00 10 06) plwz r7,12
+.*: (06 10 00 00|00 00 10 06) plwz r7,12 # 244
.*: (80 e0 00 0c|0c 00 e0 80)
.*: (04 00 00 00|00 00 00 04) plwa r8,16\(r10\)
.*: (a5 0a 00 10|10 00 0a a5)
-.*: (04 10 00 00|00 00 10 04) plwa r8,16
+.*: (04 10 00 00|00 00 10 04) plwa r8,16 # 258
.*: (a5 00 00 10|10 00 00 a5)
.*: (04 00 00 00|00 00 00 04) pld r9,20\(r10\)
.*: (e5 2a 00 14|14 00 2a e5)
-.*: (04 10 00 00|00 00 10 04) pld r9,20
+.*: (04 10 00 00|00 00 10 04) pld r9,20 # 26c
.*: (e5 20 00 14|14 00 20 e5)
.*: (06 00 00 00|00 00 00 06) plfs f10,24\(r10\)
.*: (c1 4a 00 18|18 00 4a c1)
-.*: (06 10 00 00|00 00 10 06) plfs f10,24
+.*: (06 10 00 00|00 00 10 06) plfs f10,24 # 280
.*: (c1 40 00 18|18 00 40 c1)
.*: (06 00 00 00|00 00 00 06) plfd f11,28\(r10\)
.*: (c9 6a 00 1c|1c 00 6a c9)
-.*: (06 10 00 00|00 00 10 06) plfd f11,28
+.*: (06 10 00 00|00 00 10 06) plfd f11,28 # 294
.*: (c9 60 00 1c|1c 00 60 c9)
.*: (04 00 00 00|00 00 00 04) plxsd v13,36\(r10\)
.*: (a9 aa 00 24|24 00 aa a9)
-.*: (04 10 00 00|00 00 10 04) plxsd v13,36
+.*: (04 10 00 00|00 00 10 04) plxsd v13,36 # 2ac
.*: (a9 a0 00 24|24 00 a0 a9)
.*: (04 00 00 00|00 00 00 04) plxssp v14,40\(r10\)
.*: (ad ca 00 28|28 00 ca ad)
-.*: (04 10 00 00|00 00 10 04) plxssp v14,40
+.*: (04 10 00 00|00 00 10 04) plxssp v14,40 # 2c0
.*: (ad c0 00 28|28 00 c0 ad)
.*: (04 00 00 00|00 00 00 04) plq r16,48\(r10\)
.*: (e2 0a 00 30|30 00 0a e2)
-.*: (04 10 00 00|00 00 10 04) plq r16,48
+.*: (04 10 00 00|00 00 10 04) plq r16,48 # 2d8
.*: (e2 00 00 30|30 00 00 e2)
.*: (04 00 00 00|00 00 00 04) plxv vs17,64\(r10\)
.*: (ca 2a 00 40|40 00 2a ca)
-.*: (04 10 00 00|00 00 10 04) plxv vs17,64
+.*: (04 10 00 00|00 00 10 04) plxv vs17,64 # 2f8
.*: (ca 20 00 40|40 00 20 ca)
.*: (04 00 00 00|00 00 00 04) plxv vs34,64\(r10\)
.*: (cc 4a 00 40|40 00 4a cc)
-.*: (04 10 00 00|00 00 10 04) plxv vs34,64
+.*: (04 10 00 00|00 00 10 04) plxv vs34,64 # 308
.*: (cc 40 00 40|40 00 40 cc)
.*: (06 00 00 00|00 00 00 06) pstb r3,52\(r11\)
.*: (98 6b 00 34|34 00 6b 98)
-.*: (06 10 00 00|00 00 10 06) pstb r3,52
+.*: (06 10 00 00|00 00 10 06) pstb r3,52 # 30c
.*: (98 60 00 34|34 00 60 98)
.*: (06 00 00 00|00 00 00 06) psth r4,56\(r11\)
.*: (b0 8b 00 38|38 00 8b b0)
-.*: (06 10 00 00|00 00 10 06) psth r4,56
+.*: (06 10 00 00|00 00 10 06) psth r4,56 # 320
.*: (b0 80 00 38|38 00 80 b0)
.*: (06 00 00 00|00 00 00 06) pstw r5,60\(r11\)
.*: (90 ab 00 3c|3c 00 ab 90)
-.*: (06 10 00 00|00 00 10 06) pstw r5,60
+.*: (06 10 00 00|00 00 10 06) pstw r5,60 # 334
.*: (90 a0 00 3c|3c 00 a0 90)
.*: (06 00 00 00|00 00 00 06) pstfs f6,64\(r11\)
.*: (d0 cb 00 40|40 00 cb d0)
-.*: (06 10 00 00|00 00 10 06) pstfs f6,64
+.*: (06 10 00 00|00 00 10 06) pstfs f6,64 # 348
.*: (d0 c0 00 40|40 00 c0 d0)
.*: (06 00 00 00|00 00 00 06) pstfd f7,68\(r11\)
.*: (d8 eb 00 44|44 00 eb d8)
-.*: (06 10 00 00|00 00 10 06) pstfd f7,68
+.*: (06 10 00 00|00 00 10 06) pstfd f7,68 # 35c
.*: (d8 e0 00 44|44 00 e0 d8)
.*: (04 00 00 00|00 00 00 04) pstxsd v9,76\(r11\)
.*: (b9 2b 00 4c|4c 00 2b b9)
-.*: (04 10 00 00|00 00 10 04) pstxsd v9,76
+.*: (04 10 00 00|00 00 10 04) pstxsd v9,76 # 374
.*: (b9 20 00 4c|4c 00 20 b9)
.*: (04 00 00 00|00 00 00 04) pstxssp v10,80\(r11\)
.*: (bd 4b 00 50|50 00 4b bd)
-.*: (04 10 00 00|00 00 10 04) pstxssp v10,80
+.*: (04 10 00 00|00 00 10 04) pstxssp v10,80 # 388
.*: (bd 40 00 50|50 00 40 bd)
.*: (04 00 00 00|00 00 00 04) pstd r11,84\(r11\)
.*: (f5 6b 00 54|54 00 6b f5)
-.*: (04 10 00 00|00 00 10 04) pstd r11,84
+.*: (04 10 00 00|00 00 10 04) pstd r11,84 # 39c
.*: (f5 60 00 54|54 00 60 f5)
.*: (04 00 00 00|00 00 00 04) pstq r12,88\(r11\)
.*: (f1 8b 00 58|58 00 8b f1)
-.*: (04 10 00 00|00 00 10 04) pstq r12,88
+.*: (04 10 00 00|00 00 10 04) pstq r12,88 # 3b0
.*: (f1 80 00 58|58 00 80 f1)
.*: (04 00 00 00|00 00 00 04) pstxv vs13,96\(r11\)
.*: (d9 ab 00 60|60 00 ab d9)
-.*: (04 10 00 00|00 00 10 04) pstxv vs13,96
+.*: (04 10 00 00|00 00 10 04) pstxv vs13,96 # 3c8
.*: (d9 a0 00 60|60 00 a0 d9)
.*: (04 00 00 00|00 00 00 04) pstxv vs63,96\(r11\)
.*: (df eb 00 60|60 00 eb df)
-.*: (04 10 00 00|00 00 10 04) pstxv vs63,96
+.*: (04 10 00 00|00 00 10 04) pstxv vs63,96 # 3d8
.*: (df e0 00 60|60 00 e0 df)
#pass
diff --git a/gas/testsuite/gas/ppc/prefix-reloc.d b/gas/testsuite/gas/ppc/prefix-reloc.d
index 908ff22..b442419 100644
--- a/gas/testsuite/gas/ppc/prefix-reloc.d
+++ b/gas/testsuite/gas/ppc/prefix-reloc.d
@@ -14,22 +14,22 @@ Disassembly of section \.text:
c: (00 00 00 06|06 00 00 00) paddi r9,r9,0
10: (00 00 29 39|39 29 00 00)
c: R_PPC64_D34_LO ext
- 14: (00 00 10 04|04 10 00 00) pld r3,0
+ 14: (00 00 10 04|04 10 00 00) pld r3,0 # 14
18: (00 00 60 e4|e4 60 00 00)
14: R_PPC64_PCREL34 ext
- 1c: (00 00 10 04|04 10 00 00) pld r4,0
+ 1c: (00 00 10 04|04 10 00 00) pld r4,0 # 1c
20: (00 00 80 e4|e4 80 00 00)
1c: R_PPC64_GOT_PCREL34 ext
- 24: (00 00 10 04|04 10 00 00) pld r5,0
+ 24: (00 00 10 04|04 10 00 00) pld r5,0 # 24
28: (00 00 a0 e4|e4 a0 00 00)
24: R_PPC64_PLT_PCREL34 ext
- 2c: (00 00 10 04|04 10 00 00) pld r6,0
+ 2c: (00 00 10 04|04 10 00 00) pld r6,0 # 2c
30: (00 00 c0 e4|e4 c0 00 00)
2c: R_PPC64_PCREL34 ext
34: (00 00 00 04|04 00 00 00) pld r7,0\(0\)
38: (00 00 e0 e4|e4 e0 00 00)
34: R_PPC64_D34 ext
3c: (00 00 00 60|60 00 00 00) nop
- 40: (00 00 10 04|04 10 00 00) pld r8,0
+ 40: (00 00 10 04|04 10 00 00) pld r8,0 # 40
44: (00 00 00 e5|e5 00 00 00)
40: R_PPC64_PCREL34 ext
diff --git a/gas/testsuite/gas/ppc/vsx_32byte.d b/gas/testsuite/gas/ppc/vsx_32byte.d
index fb51cc2..dc02be4 100644
--- a/gas/testsuite/gas/ppc/vsx_32byte.d
+++ b/gas/testsuite/gas/ppc/vsx_32byte.d
@@ -14,9 +14,9 @@ Disassembly of section \.text:
.*: (e8 9e 00 01|01 00 9e e8)
.*: (04 03 ff ff|ff ff 03 04) plxvp vs60,-1\(r9\)
.*: (eb a9 ff ff|ff ff a9 eb)
-.*: (04 10 12 34|34 12 10 04) plxvp vs6,305419896
+.*: (04 10 12 34|34 12 10 04) plxvp vs6,305419896 # 12345690
.*: (e8 c0 56 78|78 56 c0 e8)
-.*: (04 13 ff ff|ff ff 13 04) plxvp vs58,-32
+.*: (04 13 ff ff|ff ff 13 04) plxvp vs58,-32 # 0 <_start>
.*: (eb 60 ff e0|e0 ff 60 eb)
.*: (7f 20 0a 9a|9a 0a 20 7f) lxvpx vs56,0,r1
.*: (19 1d 00 01|01 00 1d 19) stxvp vs8,0\(r29\)
@@ -26,8 +26,8 @@ Disassembly of section \.text:
.*: (60 00 00 00|00 00 00 60) nop
.*: (04 03 ff ff|ff ff 03 04) pstxvp vs52,-1\(r8\)
.*: (fa a8 ff ff|ff ff a8 fa)
-.*: (04 10 12 34|34 12 10 04) pstxvp vs12,305419896
+.*: (04 10 12 34|34 12 10 04) pstxvp vs12,305419896 # 123456c0
.*: (f9 80 56 78|78 56 80 f9)
-.*: (04 13 ff ff|ff ff 13 04) pstxvp vs50,-80
+.*: (04 13 ff ff|ff ff 13 04) pstxvp vs50,-80 # 0 <_start>
.*: (fa 60 ff b0|b0 ff 60 fa)
.*: (7e 20 0b 9a|9a 0b 20 7e) stxvpx vs48,0,r1