bin2obj using llvm

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

bin2obj using llvm

Jochen Wilhelmy
Hi!

as a compiler can generate object files (COFF, ELF etc.) I wonder if
it is possible to create a bin to object converter (e.g. for image data)
using llvm.

I have found the classes TargetLoweringObjectFileCOFF but
I don't know how to fill it with data and save it. Can you give me a hint
how it works or where in clang I can see how it works.

Thanks,
Jochen
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: bin2obj using llvm

William Lynch
As an aside, if you're find with using an alternative tool, I've found gnu ld to work fine for this.

ld -r -b binary -o foo.o foo.png
objcopy --rename-section .data=.rodata,alloc,load,readonly,data,contents foo.o

-Bill Lynch

On Wed, Jan 13, 2010 at 12:34 PM, Jochen Wilhelmy <[hidden email]> wrote:
Hi!

as a compiler can generate object files (COFF, ELF etc.) I wonder if
it is possible to create a bin to object converter (e.g. for image data)
using llvm.

I have found the classes TargetLoweringObjectFileCOFF but
I don't know how to fill it with data and save it. Can you give me a hint
how it works or where in clang I can see how it works.

Thanks,
Jochen
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: bin2obj using llvm

Jochen Wilhelmy
Hi!

I'd like to use llvm since it is library based and supports multiple
targets.

Jochen

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev