invalid bytecode signature

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)

How do I go about figuring out what the problem is? llvmtest/sliceme2.cbc is newly compiled using the same version of llvm-gcc as llvm-dis.

Hi Ryan,

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 :slight_smile:

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.

Thank you for the help. There seem to be several things in my makefiles that are messed up as a result of switching from the gcc3.4 front end to the gcc4 frontend. Is there any documentation listing the things that have changed?

Thanks,
Ryan

Ryan M. Lefever [http://www.ews.uiuc.edu/~lefever]

Nope, unfortunately there isn't.

-Chris

Hi Ryan,

llvm-dis: Invalid bytecode signature: 464C457F (Vers=0, Pos=4)

That's hex for `F', `L', `E', which backwards spells `ELF', so it looks
like an executable file. Try running file(1) on it.

Cheers,

Ralph.