binutils-gdb/ld/testsuite/ld-arm/ifunc-13.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

90 lines
4.4 KiB
Plaintext

.*
Disassembly of section \.text:
0000a000 <f1>:
a000: e1a0f00e mov pc, lr
0000a004 <f3>:
a004: e1a0f00e mov pc, lr
0000a008 <f1t>:
a008: 46f7 mov pc, lr
0000a00a <f3t>:
a00a: 46f7 mov pc, lr
0000a00c <_start>:
a00c: 4c00 ldr r4, \[pc, #0\] @ \(a010 <_start\+0x4>\)
a00e: 4c01 ldr r4, \[pc, #4\] @ \(a014 <_start\+0x8>\)
#------------------------------------------------------------------------------
#------ .got offset for foo
#------------------------------------------------------------------------------
a010: 00000018 \.word 0x00000018
#------------------------------------------------------------------------------
#------ PC-relative offset of .got entry for foo
#------------------------------------------------------------------------------
a014: 00006ff8 \.word 0x00006ff8
a018: 4c00 ldr r4, \[pc, #0\] @ \(a01c <_start\+0x10>\)
a01a: 4c01 ldr r4, \[pc, #4\] @ \(a020 <_start\+0x14>\)
#------------------------------------------------------------------------------
#------ .got offset for f1
#------------------------------------------------------------------------------
a01c: 00000010 \.word 0x00000010
#------------------------------------------------------------------------------
#------ PC-relative offset of .got entry for f1
#------------------------------------------------------------------------------
a020: 00006ff0 \.word 0x00006ff0
a024: 4c00 ldr r4, \[pc, #0\] @ \(a028 <_start\+0x1c>\)
a026: 4c01 ldr r4, \[pc, #4\] @ \(a02c <_start\+0x20>\)
#------------------------------------------------------------------------------
#------ .got offset for f2
#------------------------------------------------------------------------------
a028: 00000024 \.word 0x00000024
#------------------------------------------------------------------------------
#------ PC-relative offset of .got entry for f2
#------------------------------------------------------------------------------
a02c: 00006ff8 \.word 0x00006ff8
a030: 4c00 ldr r4, \[pc, #0\] @ \(a034 <_start\+0x28>\)
a032: 4c01 ldr r4, \[pc, #4\] @ \(a038 <_start\+0x2c>\)
#------------------------------------------------------------------------------
#------ .got offset for f3
#------------------------------------------------------------------------------
a034: 00000020 \.word 0x00000020
#------------------------------------------------------------------------------
#------ PC-relative offset of .got entry for f3
#------------------------------------------------------------------------------
a038: 00006fe8 \.word 0x00006fe8
a03c: 4c00 ldr r4, \[pc, #0\] @ \(a040 <_start\+0x34>\)
a03e: 4c01 ldr r4, \[pc, #4\] @ \(a044 <_start\+0x38>\)
#------------------------------------------------------------------------------
#------ .got offset for f1t
#------------------------------------------------------------------------------
a040: 00000014 \.word 0x00000014
#------------------------------------------------------------------------------
#------ PC-relative offset of .got entry for f1t
#------------------------------------------------------------------------------
a044: 00006fd0 \.word 0x00006fd0
a048: 4c00 ldr r4, \[pc, #0\] @ \(a04c <_start\+0x40>\)
a04a: 4c01 ldr r4, \[pc, #4\] @ \(a050 <_start\+0x44>\)
#------------------------------------------------------------------------------
#------ .got offset for f2t
#------------------------------------------------------------------------------
a04c: 0000001c \.word 0x0000001c
#------------------------------------------------------------------------------
#------ PC-relative offset of .got entry for f2t
#------------------------------------------------------------------------------
a050: 00006fcc \.word 0x00006fcc
a054: 4c00 ldr r4, \[pc, #0\] @ \(a058 <_start\+0x4c>\)
a056: 4c01 ldr r4, \[pc, #4\] @ \(a05c <_start\+0x50>\)
#------------------------------------------------------------------------------
#------ .got offset for f3t
#------------------------------------------------------------------------------
a058: 00000028 \.word 0x00000028
#------------------------------------------------------------------------------
#------ PC-relative offset of .got entry for f3t
#------------------------------------------------------------------------------
a05c: 00006fcc \.word 0x00006fcc