Generating executable by llc.

is it possible in llvm infrastructure to integrate an actual linker with llc? rather than using the native linker.
Can it be done by adding a Module pass?
How difficult it would be to read-in and link the traditional COFF/ELF object files with this integrated linker?
I am looking to do something like this:

a.c, b.c ----> llvm-gcc —> a.bc, b.bc —> llvm-link —> combined.bc , native.o ------> llc + integrated linker —> final exeutable

TIA,
Sanjiv

Sanjiv,

You can use llvm-ld to link .o files together with .bc files to produce a native binary by passing it the -native flag. In you case, you would replace llc with llvm-ld.

Regards,

John

Sanjiv Gupta schreef: