[LLVMdev] llvm-objdump disassembling jmp

Stephen Checkoway s at pahtak.org
Thu Oct 17 16:10:08 PDT 2013


On Oct 17, 2013, at 7:05 PM, Sean Silva <chisophugis at gmail.com> wrote:

> I haven't looked at the source code but I'm guessing that llvm-objdump is
> just being "dumb" in the sense that the disassembly API's probably just
> return the imm8 as the raw field value and llvm-objdump is just printing
> that, rather than actually interpreting it as an address (relative to the
> instruction). In other words, binutils objdump is printing the operand of
> the JMP as the address it jumps to, while llvm-objdump is printing the raw
> imm8 field value. The binutils behavior is the desirable behavior, because
> the semantics of the written operand to a JMP instruction in assembler is
> the actual address (usually represented as a symbolic label), not the raw
> displacement.

I agree that binutils has more desirable behavior. If I get a chance, I'll take a look at it. I just wanted to make sure that it wasn't intended behavior before I spent time on it.

>> As an aside, obj2yaml can't handle this object file:
>> [secdev:/tmp] s$ ~/build-master/bin/obj2yaml a.o
>> LLVM ERROR: The end of the file was unexpectedly encountered
>> 
> 
> FYI, obj2yaml only handles COFF currently. It should probably diagnose
> being fed and ELF file better than dying randomly though.


Ah, good to know. I think I was trying to use it to produce a test case that I ended up doing by hand.

-- 
Stephen Checkoway









More information about the llvm-dev mailing list