binutils-gdb/ld/testsuite/ld-arm/ifunc-16.dd
Andrew Burgess 8cb6e17571 opcodes/arm: use '@' consistently for the comment character
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.
2022-11-01 09:32:13 +00:00

89 lines
3.4 KiB
Plaintext

.*
Disassembly of section \.iplt:
00009000 <f2t-0x18>:
#------------------------------------------------------------------------------
#------ f1's .iplt entry
#------------------------------------------------------------------------------
9000: e28fc600 add ip, pc, #0, 12
9004: e28cca08 add ip, ip, #8, 20 @ 0x8000
9008: e5bcf004 ldr pc, \[ip, #4\]!
#------------------------------------------------------------------------------
#------ f1t's .iplt entry
#------------------------------------------------------------------------------
900c: e28fc600 add ip, pc, #0, 12
9010: e28cca07 add ip, ip, #28672 @ 0x7000
9014: e5bcfffc ldr pc, \[ip, #4092\]! @ 0xffc
00009018 <f2t>:
9018: e28fc600 add ip, pc, #0, 12
901c: e28cca07 add ip, ip, #28672 @ 0x7000
9020: e5bcfff4 ldr pc, \[ip, #4084\]! @ 0xff4
00009024 <f3>:
9024: e28fc600 add ip, pc, #0, 12
9028: e28cca07 add ip, ip, #28672 @ 0x7000
902c: e5bcffec ldr pc, \[ip, #4076\]! @ 0xfec
00009030 <f2>:
9030: e28fc600 add ip, pc, #0, 12
9034: e28cca07 add ip, ip, #28672 @ 0x7000
9038: e5bcffe4 ldr pc, \[ip, #4068\]! @ 0xfe4
0000903c <f3t>:
903c: e28fc600 add ip, pc, #0, 12
9040: e28cca07 add ip, ip, #28672 @ 0x7000
9044: e5bcffdc ldr pc, \[ip, #4060\]! @ 0xfdc
Disassembly of section \.text:
0000a000 <f1>:
a000: e1a0f00e mov pc, lr
a004: e1a0f00e mov pc, lr
a008: e1a0f00e mov pc, lr
0000a00c <f1t>:
a00c: 46f7 mov pc, lr
a00e: 46f7 mov pc, lr
a010: 46f7 mov pc, lr
0000a012 <_start>:
a012: 4c00 ldr r4, \[pc, #0\] @ \(a014 <_start\+0x2>\)
#------------------------------------------------------------------------------
#------ foo
#------------------------------------------------------------------------------
a014: 00010000 \.word 0x00010000
a018: f8df 4000 ldr\.w r4, \[pc\] @ a01c <_start\+0xa>
#------------------------------------------------------------------------------
#------ f1's .iplt entry
#------------------------------------------------------------------------------
a01c: 00009000 \.word 0x00009000
a020: f8df 4000 ldr\.w r4, \[pc\] @ a024 <_start\+0x12>
#------------------------------------------------------------------------------
#------ f2
#------------------------------------------------------------------------------
a024: 00009030 \.word 0x00009030
a028: f8df 4000 ldr\.w r4, \[pc\] @ a02c <_start\+0x1a>
#------------------------------------------------------------------------------
#------ f3
#------------------------------------------------------------------------------
a02c: 00009024 \.word 0x00009024
a030: f8df 4000 ldr\.w r4, \[pc\] @ a034 <_start\+0x22>
#------------------------------------------------------------------------------
#------ f1t's .iplt entry
#------------------------------------------------------------------------------
a034: 0000900c \.word 0x0000900c
a038: f8df 4000 ldr\.w r4, \[pc\] @ a03c <_start\+0x2a>
#------------------------------------------------------------------------------
#------ f2t
#------------------------------------------------------------------------------
a03c: 00009018 \.word 0x00009018
a040: f8df 4000 ldr\.w r4, \[pc\] @ a044 <_start\+0x32>
#------------------------------------------------------------------------------
#------ f3t
#------------------------------------------------------------------------------
a044: 0000903c \.word 0x0000903c