mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-09 04:21:49 +08:00
8cb6e17571
Looking at the ARM disassembler output, every comment seems to start with a ';' character, so I assumed this was the correct character to start an assembler comment. I then spotted a couple of places where there was no ';', but instead, just a '@' character. I thought that this was a case of a missing ';', and proposed a patch to add the missing ';' characters. Turns out I was wrong, '@' is actually the ARM assembler comment character, while ';' is the statement separator. Thus this: nop ;@ comment is two statements, the first is the 'nop' instruction, while the second contains no instructions, just the '@ comment' comment text. This: nop @ comment is a single 'nop' instruction followed by a comment. And finally, this: nop ; comment is two statements, the first contains the 'nop' instruction, while the second contains the instruction 'comment', which obviously isn't actually an instruction at all. Why this matters is that, in the next commit, I would like to add libopcodes syntax styling support for ARM. The question then is how should the disassembler style the three cases above? As '@' is the actual comment start character then clearly the '@' and anything after it can be styled as a comment. But what about ';' in the second example? Style as text? Style as a comment? And the third example is even harder, what about the 'comment' text? Style as an instruction mnemonic? Style as text? Style as a comment? I think the only sensible answer is to move the disassembler to use '@' consistently as its comment character, and remove all the uses of ';'. Then, in the next commit, it's obvious what to do. There's obviously a *lot* of tests that get updated by this commit, the only actual code changes are in opcodes/arm-dis.c.
176 lines
8.7 KiB
Plaintext
176 lines
8.7 KiB
Plaintext
|
|
.*
|
|
|
|
|
|
Disassembly of section \.iplt:
|
|
|
|
00009000 <\.iplt>:
|
|
#------------------------------------------------------------------------------
|
|
#------ thumb entry to f3's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
9000: 4778 bx pc
|
|
9002: e7fd b.n .+ <.+>
|
|
#------------------------------------------------------------------------------
|
|
#------ f3's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
9004: e28fc600 add ip, pc, #0, 12
|
|
9008: e28cca08 add ip, ip, #8, 20 @ 0x8000
|
|
900c: e5bcf000 ldr pc, \[ip, #0\]!
|
|
#------------------------------------------------------------------------------
|
|
#------ f2's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
9010: e28fc600 add ip, pc, #0, 12
|
|
9014: e28cca07 add ip, ip, #28672 @ 0x7000
|
|
9018: e5bcfff8 ldr pc, \[ip, #4088\]! @ 0xff8
|
|
#------------------------------------------------------------------------------
|
|
#------ thumb entry to f4's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
901c: 4778 bx pc
|
|
901e: e7fd b.n .+ <.+>
|
|
#------------------------------------------------------------------------------
|
|
#------ f4's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
9020: e28fc600 add ip, pc, #0, 12
|
|
9024: e28cca07 add ip, ip, #28672 @ 0x7000
|
|
9028: e5bcffec ldr pc, \[ip, #4076\]! @ 0xfec
|
|
#------------------------------------------------------------------------------
|
|
#------ f1's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
902c: e28fc600 add ip, pc, #0, 12
|
|
9030: e28cca07 add ip, ip, #28672 @ 0x7000
|
|
9034: e5bcffe4 ldr pc, \[ip, #4068\]! @ 0xfe4
|
|
|
|
Disassembly of section \.text:
|
|
|
|
0000a000 <f1>:
|
|
a000: e1a0f00e mov pc, lr
|
|
|
|
0000a004 <f2>:
|
|
a004: 46f7 mov pc, lr
|
|
\.\.\.
|
|
|
|
0000a008 <f3>:
|
|
a008: e1a0f00e mov pc, lr
|
|
|
|
0000a00c <f4>:
|
|
a00c: 46f7 mov pc, lr
|
|
\.\.\.
|
|
|
|
0000a010 <_start>:
|
|
a010: eb0017fa bl 10000 <foo>
|
|
a014: ea0017f9 b 10000 <foo>
|
|
a018: 0a0017f8 beq 10000 <foo>
|
|
a01c: e59f4000 ldr r4, \[pc\] @ a024 <_start\+0x14>
|
|
a020: e59f4000 ldr r4, \[pc\] @ a028 <_start\+0x18>
|
|
#------------------------------------------------------------------------------
|
|
#------ .got offset for foo
|
|
#------------------------------------------------------------------------------
|
|
a024: 00000020 \.word 0x00000020
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of .got entry for foo
|
|
#------------------------------------------------------------------------------
|
|
a028: 00006ff4 \.word 0x00006ff4
|
|
#------------------------------------------------------------------------------
|
|
#------ f1's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a02c: ebfffbfe bl 902c <__irel_end\+0x100c>
|
|
#------------------------------------------------------------------------------
|
|
#------ f1's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a030: eafffbfd b 902c <__irel_end\+0x100c>
|
|
#------------------------------------------------------------------------------
|
|
#------ f1's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a034: 0afffbfc beq 902c <__irel_end\+0x100c>
|
|
a038: e59f4000 ldr r4, \[pc\] @ a040 <_start\+0x30>
|
|
a03c: e59f4000 ldr r4, \[pc\] @ a044 <_start\+0x34>
|
|
#------------------------------------------------------------------------------
|
|
#------ GP-relative offset of f1's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a040: 00000018 \.word 0x00000018
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of f1's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a044: 00006fd4 \.word 0x00006fd4
|
|
#------------------------------------------------------------------------------
|
|
#------ f2's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a048: ebfffbf0 bl 9010 <__irel_end\+0xff0>
|
|
#------------------------------------------------------------------------------
|
|
#------ f2's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a04c: eafffbef b 9010 <__irel_end\+0xff0>
|
|
#------------------------------------------------------------------------------
|
|
#------ f2's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a050: 0afffbee beq 9010 <__irel_end\+0xff0>
|
|
a054: e59f4000 ldr r4, \[pc\] @ a05c <_start\+0x4c>
|
|
a058: e59f4000 ldr r4, \[pc\] @ a060 <_start\+0x50>
|
|
#------------------------------------------------------------------------------
|
|
#------ GP-relative offset of f2's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a05c: 00000010 \.word 0x00000010
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of f2's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a060: 00006fb0 \.word 0x00006fb0
|
|
|
|
0000a064 <_thumb>:
|
|
a064: f005 ffcc bl 10000 <foo>
|
|
a068: f005 bfca b\.w 10000 <foo>
|
|
a06c: f005 87c8 beq\.w 10000 <foo>
|
|
a070: 4c00 ldr r4, \[pc, #0\] @ \(a074 <_thumb\+0x10>\)
|
|
a072: 4c01 ldr r4, \[pc, #4\] @ \(a078 <_thumb\+0x14>\)
|
|
#------------------------------------------------------------------------------
|
|
#------ .got offset for foo
|
|
#------------------------------------------------------------------------------
|
|
a074: 00000020 \.word 0x00000020
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of .got entry for foo
|
|
#------------------------------------------------------------------------------
|
|
a078: 00006fa4 \.word 0x00006fa4
|
|
#------------------------------------------------------------------------------
|
|
#------ f3's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a07c: f7fe efc2 blx 9004 <__irel_end\+0xfe4>
|
|
#------------------------------------------------------------------------------
|
|
#------ thumb entry to f3's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a080: f7fe bfbe b\.w 9000 <__irel_end\+0xfe0>
|
|
#------------------------------------------------------------------------------
|
|
#------ thumb entry to f3's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a084: f43e afbc beq\.w 9000 <__irel_end\+0xfe0>
|
|
a088: 4c00 ldr r4, \[pc, #0\] @ \(a08c <_thumb\+0x28>\)
|
|
a08a: 4c01 ldr r4, \[pc, #4\] @ \(a090 <_thumb\+0x2c>\)
|
|
#------------------------------------------------------------------------------
|
|
#------ GP-relative offset of f3's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a08c: 0000000c \.word 0x0000000c
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of f3's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a090: 00006f7c \.word 0x00006f7c
|
|
#------------------------------------------------------------------------------
|
|
#------ f4's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a094: f7fe efc4 blx 9020 <__irel_end\+0x1000>
|
|
#------------------------------------------------------------------------------
|
|
#------ thumb entry to f4's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a098: f7fe bfc0 b\.w 901c <__irel_end\+0xffc>
|
|
#------------------------------------------------------------------------------
|
|
#------ thumb entry to f4's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a09c: f43e afbe beq\.w 901c <__irel_end\+0xffc>
|
|
a0a0: 4c00 ldr r4, \[pc, #0\] @ \(a0a4 <_thumb\+0x40>\)
|
|
a0a2: 4c01 ldr r4, \[pc, #4\] @ \(a0a8 <_thumb\+0x44>\)
|
|
#------------------------------------------------------------------------------
|
|
#------ GP-relative offset of f4's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a0a4: 00000014 \.word 0x00000014
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of f4's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a0a8: 00006f6c \.word 0x00006f6c
|