[LLVMdev] LLVM object file creation

Reid Kleckner rnk at google.com
Mon Aug 11 13:20:19 PDT 2014


What you are describing sounds a lot like debug info, so you might be able
to find pointers there.

LLVM code generation looks like:
IR -> CodeGenPrepare -> SelectionDAG -> MachineInstrs (MI) -> MC -> object
file

So, if you want to get as close as possible to the actual instruction
layout in the binary, you need to add logic (maybe directives) in the MC
layer.  You may need to pass your data down through the other layers if it
isn't already available from debug info or CFI.


On Mon, Aug 11, 2014 at 6:48 AM, Konstantinos Parasyris <koparasy at uth.gr>
wrote:

> Hello,
>
> I am new in the llvm project and as I was reading the llvm documentation
> llvm does not support binary creation, however it allows to create object
> files (*.o) and afterwards link them using the gcc linker.
> When compiling a source file I would like to create a second binary file
> which contains information for each instruction inside the original object
> file. To be more precise as the instruction stream is written to the object
> file I would like to write the metadata into a second stream. I would like
> to ask which llvm source files should I look into  to find the object file
> creation and writing?
>
> Thank You
>
> Konstantinos Parasyris.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140811/0b985772/attachment.html>


More information about the llvm-dev mailing list