[llvm-dev] Generating completely position agnostic code

Hayden Livingston via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 7 19:17:48 PDT 2019


Because I don't think it is required. All I want to do is generate
machine code for a single function that has all its references coming
in as pointers on the stack and it's just calling functions and doing
math. I'm literally asking LLVM convert text in the form of C to x86
ASM.

Maybe I'll paste LLVM IR to make it clear what I'm asking for.



On Mon, Jul 1, 2019 at 4:25 PM Joerg Sonnenberger via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> On Sun, Jun 30, 2019 at 09:07:21PM -0700, Hayden Livingston via llvm-dev wrote:
> > I'm on a mission to generate code that can be loaded from disk without
> > any modifications. This means no relocations can occur.
>
> Why? Implementing self relocation is not that difficult really. It's
> also quite difficult to avoid unless you can make sure that no pointer
> variables are statically initialized. That means no arrays of strings,
> no vtables etc.
>
> Joerg
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list