llvmllvm-irgoogle-nativeclient

How to parse PNaCl as human readable LLVM IR?


I have a .pexe and want to get the LLVM IR code. How can this be done? This is the file I want to convert to LLVM IR: NaClAMBullet.pexe

I don't understand why it is not already readable LLVM IR code:

A PNaCl portable executable (pexe in short) is a single LLVM IR module.

Source: Google Native Client Reference


Solution

  • The PNaCl toolchain contains many tools to manipulate PNaCl and LLVM files, including pnacl-dis and pnacl-bcdis. A .pexe is indeed create from a single LLVM IR module, but it ins't the same as an LLVM IR module: the PNaCl bitcode is stable and different from LLVM IR.