x/arch/x86/x86asm: GNUSyntax rendors relative pc jump targets wrong #18792
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The GNUSyntax uses
.
to denote the address of the next instruction, but that doesn't match GNU as' definition. This makes it impossible to round trip the disassembly (GNU as will not be able to assembleje .-0x80
into two-byte short jump.)Output:
However, in AT&T syntax,
.
means the address of the current instruction, whereas the encoding actually means (conditional) jumps to the address of next instruction - 0x80.I think to better test the disassembler, we need to do round-trip test (disassemble -> use GNU assembler to assemble the instruction -> disassemble again and verify the two Insts are deep equal.)
I want to fix this issue, but the current behavior is locked down the the current testdata/decode.txt.
Should I change the data?
/cc @rsc
The text was updated successfully, but these errors were encountered: