Why does Ghidra disassembler use x86 data mnemonics on aarch64? #8793
Replies: 1 comment
-
|
Ghidra is independent of any particular ISA or assembler. So what you consider "natural" may make no sense for a different platform binary. But you're talking about raw data, not disassembly, so that's even further removed. What you get is Ghidra's base type annotations. And there's a key semantic difference between "db", which is simply 8 bits with no information about how it's interpreted (and in fact may just be part of a longer type), and "byte", "char" or "undefined1", which imply that there's some interpretation information present - yes, even "undefined1", because that means a 1-byte wide reference to that location was found from code, but there isn't enough information to infer a stronger type. ?? is even less information than "db", because it means no information has been applied to that memory location at all, not automatically and not manually. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have to say that I am not good at either x86, aarch64, Ghidra, or assembly in general, but I am a bit confused by the disassembler output in case of "raw data".
This is my source:
I am building it with GNU as and lld from LLVM. (Actually, from Android Ndk)
It is not really important what is inside, but there is a symbol table entry in the resulting ELF, and here is how Ghidra disassembles it:
Why are the
db,dw,ddw,dqmnemonics used here?Would not it be more natural to have GNU_As-native pseudo-ops:
The naive loop code is decompiled as:
Do the last
.byte 0xFEis disassembled asundefined1, not asdb, whereas in the.datasection it is disassembled aswell,
??is even less specific thanundefined1. Perhaps a.byte 0xFEand.byte 0xFFwould have made more sense?Beta Was this translation helpful? Give feedback.
All reactions