RFC: AArch64 Disassembler: Annotate undefined instructions

Nick Clifton nickc@redhat.com
Tue Apr 28 13:51:37 GMT 2026


Hi Richard,

>>>    So for example without the option being enabled, disassembling
>>>    non-code sections might produce results like this:
>>>
>>>      000000000041fdd8 <__frame_dummy_init_array_entry>:
>>>        41fdd8:	00400764 	.inst	0x00400764 ; undefined
>>>        41fddc:	00000000 	udf	#0
>>>
>>>    Whereas with the option enabled this changes to:
>>>    
>>>      000000000041fdd8 <__frame_dummy_init_array_entry>:
>>>        41fdd8:	00400764 	.inst	0x00400764 ; [frame_dummy]
>>>        41fddc:	00000000 	udf	#0

>> This is what mapping symbols are supposed to address.  If the user writes '.word' in a code section then the value will be tagged with $d and the output should then disassemble as data.  '.inst' means 'this is an instruction'.

True.

> For example:
> 
>          .text
>          .inst 0x12345678
>          .word 0x12345678
> 
> gives:
> 
>   objdump -d test.o
> 
> test.o:     file format elf64-littleaarch64
> 
> 
> Disassembly of section .text:
> 
> 0000000000000000 <.text>:
>     0:   12345678        and     w24, w19, #0xfffff003
>     4:   12345678        .word   0x12345678
> 
> Maybe .word should be annotated with a suitable label, but I don't think .inst should.

OK, that makes sense.  So the disassembler should check to see if closest
previous mapping symbol is $d and only proceed with the annotation in this
case, yes ?

Cheers
   Nick




More information about the Binutils mailing list