mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-03-01 13:26:47 +08:00
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.
128 lines
5.8 KiB
Plaintext
128 lines
5.8 KiB
Plaintext
|
|
.*
|
|
|
|
|
|
Disassembly of section \.plt:
|
|
|
|
00009000 <.plt>:
|
|
9000: e52de004 push {lr} @ \(str lr, \[sp, #-4\]!\)
|
|
9004: e59fe004 ldr lr, \[pc, #4\] @ 9010 <.*>
|
|
9008: e08fe00e add lr, pc, lr
|
|
900c: e5bef008 ldr pc, \[lr, #8\]!
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of .got.plt
|
|
#------------------------------------------------------------------------------
|
|
9010: 00007ff0 \.word 0x00007ff0
|
|
#------------------------------------------------------------------------------
|
|
#------ f2's .plt entry
|
|
#------------------------------------------------------------------------------
|
|
00009014 <f2@plt>:
|
|
9014: e28fc600 add ip, pc, #0, 12
|
|
9018: e28cca07 add ip, ip, #28672 @ 0x7000
|
|
901c: e5bcfff0 ldr pc, \[ip, #4080\]! @ 0xff0
|
|
|
|
Disassembly of section \.iplt:
|
|
|
|
00009020 <\.iplt>:
|
|
#------------------------------------------------------------------------------
|
|
#------ f1's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
9020: e28fc600 add ip, pc, #0, 12
|
|
9024: e28cca07 add ip, ip, #28672 @ 0x7000
|
|
9028: e5bcffe8 ldr pc, \[ip, #4072\]! @ 0xfe8
|
|
#------------------------------------------------------------------------------
|
|
#------ f3's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
902c: e28fc600 add ip, pc, #0, 12
|
|
9030: e28cca07 add ip, ip, #28672 @ 0x7000
|
|
9034: e5bcffe0 ldr pc, \[ip, #4064\]! @ 0xfe0
|
|
#------------------------------------------------------------------------------
|
|
#------ f4's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
9038: e28fc600 add ip, pc, #0, 12
|
|
903c: e28cca07 add ip, ip, #28672 @ 0x7000
|
|
9040: e5bcffd8 ldr pc, \[ip, #4056\]! @ 0xfd8
|
|
|
|
Disassembly of section \.text:
|
|
|
|
0000a000 <f1>:
|
|
a000: e1a0f00e mov pc, lr
|
|
|
|
0000a004 <f2>:
|
|
a004: e1a0f00e mov pc, lr
|
|
|
|
0000a008 <f3>:
|
|
a008: e1a0f00e mov pc, lr
|
|
|
|
0000a00c <f4>:
|
|
a00c: e1a0f00e mov pc, lr
|
|
|
|
0000a010 <arm>:
|
|
a010: eb0017fa bl 10000 <foo>
|
|
a014: e59f4000 ldr r4, \[pc\] @ a01c <arm\+0xc>
|
|
a018: e59f4000 ldr r4, \[pc\] @ a020 <arm\+0x10>
|
|
#------------------------------------------------------------------------------
|
|
#------ .got offset for foo
|
|
#------------------------------------------------------------------------------
|
|
a01c: 00000020 \.word 0x00000020
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of .got entry for foo
|
|
#------------------------------------------------------------------------------
|
|
a020: 00006ffc \.word 0x00006ffc
|
|
#------------------------------------------------------------------------------
|
|
#------ f1's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a024: ebfffbfd bl 9020 <f2@plt\+0xc>
|
|
a028: e59f4000 ldr r4, \[pc\] @ a030 <arm\+0x20>
|
|
a02c: e59f4000 ldr r4, \[pc\] @ a034 <arm\+0x24>
|
|
#------------------------------------------------------------------------------
|
|
#------ GP-relative offset of f1's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a030: 00000010 \.word 0x00000010
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of f1's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a034: 00006fdc \.word 0x00006fdc
|
|
#------------------------------------------------------------------------------
|
|
#------ f2's .plt entry
|
|
#------------------------------------------------------------------------------
|
|
a038: ebfffbf5 bl 9014 <f2@plt>
|
|
a03c: e59f4000 ldr r4, \[pc\] @ a044 <arm\+0x34>
|
|
a040: e59f4000 ldr r4, \[pc\] @ a048 <arm\+0x38>
|
|
#------------------------------------------------------------------------------
|
|
#------ .got offset for f2
|
|
#------------------------------------------------------------------------------
|
|
a044: 00000024 \.word 0x00000024
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of .got entry for f2
|
|
#------------------------------------------------------------------------------
|
|
a048: 00006fdc \.word 0x00006fdc
|
|
#------------------------------------------------------------------------------
|
|
#------ f3's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a04c: ebfffbf6 bl 902c <f2@plt\+0x18>
|
|
a050: e59f4000 ldr r4, \[pc\] @ a058 <arm\+0x48>
|
|
a054: e59f4000 ldr r4, \[pc\] @ a05c <arm\+0x4c>
|
|
#------------------------------------------------------------------------------
|
|
#------ GP-relative offset of f3's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a058: 00000014 \.word 0x00000014
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of f3's .igot.plt entry
|
|
#------------------------------------------------------------------------------
|
|
a05c: 00006fb8 \.word 0x00006fb8
|
|
#------------------------------------------------------------------------------
|
|
#------ f4's .iplt entry
|
|
#------------------------------------------------------------------------------
|
|
a060: ebfffbf4 bl 9038 <f2@plt\+0x24>
|
|
a064: e59f4000 ldr r4, \[pc\] @ a06c <arm\+0x5c>
|
|
a068: e59f4000 ldr r4, \[pc\] @ a070 <arm\+0x60>
|
|
#------------------------------------------------------------------------------
|
|
#------ .got offset for f4
|
|
#------------------------------------------------------------------------------
|
|
a06c: 00000028 \.word 0x00000028
|
|
#------------------------------------------------------------------------------
|
|
#------ PC-relative offset of .got entry for f4
|
|
#------------------------------------------------------------------------------
|
|
a070: 00006fb8 \.word 0x00006fb8
|