[llvm-dev] Executing code changed with LLVM

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Sat May 18 23:43:18 PDT 2019


On Sat, 18 May 2019 at 19:01, Holland Vosijk <holland.vosijk09 at gmail.com> wrote:
> Thanks a lot for the response. Upon using g++ or gcc with -lstdc++ flag I get the original error I was getting without the "--relocation-model=pic" flag for llc.i.e

I'm not sure why that would be. PIC should eliminate those kinds of
relocations entirely.

> Is there another way I can try to save the modified program to a file and then execute it? Without using "llc" maybe?

You might have more luck using Clang itself to compile the modified IR
(it knows how to, if they have the correct .ll or .bc extension);
you'd have to give it the -fPIC option. But it's a bit of a long shot,
llc should be able to do the job.

Cheers.

Tim.


More information about the llvm-dev mailing list