[LLVMdev] Compiling a raw binary with llvm/clang

LiteHacker vilmer88 at gmail.com
Thu Dec 17 19:42:34 PST 2009

$ clang -ffunction-sections -fdata-sections -Os -nostartfiles -c -o hello.o
$ clang -ffunction-sections -fdata-sections -Os -nostartfiles -c -o test.o
$ llvm-ld -s -o hello2 hello.o
$ llc hello2.bc -o hello3
$ ld -o hello_B hello3 --oformat binary
ld:hello3: file format not recognized; treating as linker script
ld:hello3:1: syntax error

I am guessing that is what you meant by the "then use the same procedure you
were originally using." right?

Sorry for the hasle. Thank you for your help,

Eli Friedman-2 wrote:
> Take the .bc file produced by llvm-ld, compile it to assembly with
> llc, then use the same procedure you were originally using.
> -Eli
View this message in context: http://old.nabble.com/Compiling-a-raw-binary-with-llvm-clang-tp26834182p26838687.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.

More information about the llvm-dev mailing list