[LLVMdev] invalid bytecode signature

Reid Spencer rspencer at reidspencer.com
Fri Dec 1 16:56:58 PST 2006


Hi Ryan,

On Fri, 2006-12-01 at 18:06 -0600, Ryan M. Lefever wrote:
> I am trying to disassemble some bytecode using llvm-dis:
> llvm-dis -f -o llvmtest/sliceme2.cbc.ll llvmtest/sliceme2.cbc
> 
> However, I am getting the following error.
> 
> llvm-dis: Invalid bytecode signature: 464C457F (Vers=0, Pos=4)

The problem is most likely that sliceme2.cbc is *not* bytecode. Open the
file and see. This message is checking for llvm or llvc (bytecode
signature) in the first four bytes of the file. Its not finding it and
reporting an error.
> 
> How do I go about figuring out what the problem is? 

Edit the file (don't cat it, or you'll mess up your screen settings if
it is bytecode).

> llvmtest/sliceme2.cbc is newly compiled using the same version of 
> llvm-gcc as llvm-dis.

Okay, this is the problem :)

llvm-gcc4 doesn't emit bytecode any more. It emits object code, just
like plain-old-gcc.

If you want it to emit bytecode or llvm assembly, pass -emit-llvm

Reid.

> 




More information about the llvm-dev mailing list