LLD: Calling from within LLVM

Hello everyone

I was wondering if there was a way to call LLD from code within LLVM. More concrete: I am working in Polly, and I am trying to link an ELF relocatable object file into an ELF shared object file. Is there a way to run an LLD pass from within the code?

Thank you in advance for any pointers!
Best,
Philipp Schaad

There currently isn’t any way - the layering isn’t really setup that way for one thing (lld depends on llvm, not the other way around). But it might be nice to sink some.of lld’s libraries into llvm(they’d need a bunch of refactoring to become reusable libraries) for use in the jit or other places.

I see, too bad! Indeed, I agree that this would be a very useful thing to do at some point.
Thank you a lot for pointing this out!

Best,
Philipp Schaad