Hello, I found that a plain "char" is used when extracting and applying
a relative offset in the Z80 disassembler in objdump:

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=opcodes/z80-dis.c;h=0c0c19092a2845ac6a9ba1ff5f94058ecf54df14;hb=HEAD#l114

I found this when investigating a problem I was having with taking
objdump output and putting it back through gas.  Offsets greater than
0x7F were being flagged as out of the range of the signed relative
offset, and indeed offsets were being generated in excess of this
tolerance.  When replaced with a "signed char" on line 114 as referenced
above, the relative value is offset in the negative direction correctly
when disassembled.

I have not prepared a patch as this may be worth investigating in other
areas of libopcodes and binutils.  In any case my assumption is that
this was likely added from an architecture with signed chars by default,
but in my case I am running aarch64 bearing unsigned.

I have not made but can make a repro case if so desired.

- Matt G.

Reply via email to