You are not logged in.

#1 2009-12-17 18:52:31

LiteHacker
Member
Registered: 2008-11-27
Posts: 38
Website

Compiling a raw binary with llvm/clang

Hello again.
The following code creates a raw binary (no ELF or PE.. just raw):

gcc -nostartfiles -c -o hello.o hello.c
ld -o hello1 hello.o --oformat binary

You can try the following code out with it:

void _start()
{
  while(1);
}

The resulting raw binary is 5 bytes.

Now how do you do this in clang/llvm?
Apparently llvm-ld doesn't have a "--oformat binary" option.
Anybody know how to do this with llvm?

Last edited by LiteHacker (2009-12-17 18:56:11)

Offline

Board footer

Powered by FluxBB