View all files | ||||
Retrieves Bitcode from Mach-O binaries
Bitcode stores as an xar archive inside of a Mach-O binary.
This tool extracts the archive and puts it near the binary, so it can be easily discovered using xar and llvm-dis
Clone the repo and run make, built binary lays inside of build directory
Note: currently is does not work with static libraries, there is an opened issue #1, if you need this feature please a comment there, it will bump prioity of this project at my personal todo-list.
To use bitcode_retriever simple feed him your binary and it'll produce archive with bitcode.
It accepts both fat and non-fat binaries. For fat binaries it produces separate archive for each slice, e.g.:
for non-fat binaries it produces just one archive with the bitcode:
To skip the xar archive and obtain the bitcode immediately, pass the -e argument.
The project provides a sample binaries, you can play a bit with them:
The xar archive stores set of files with bitcode:
You can dump LLVM IR from each file (1, 2) using llvm-dis
If you have any problems or found some bug - feel free to open an issue and/or send a pull request