[PATCH] D16599: ELF: Define another entry point.

Arseny Kapoulkine via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 20:09:22 PST 2016

arseny.kapoulkine added a comment.

I *believe* (although I have not tested this) that the original version of this patch with fork() will work for me as is.

The existing version assumes that the executable-to-call is lld which is not installed on my system. Since the use case for lld-as-a-library involves linking lld into the calling process this probably makes sense.

I tried replacing getLldExecutable() body with "return std::string(Arg0)" as a hack; passing argv[0] from my compiler driver into elf2::link and handling -flavor gnu -lld-no-exec prefix as a signal to call linkOrFail works fine. Of course this requires parent process to actively participate in this form of dispatch :( I was originally assuming that we'd be able to fork() and then everything will just work without extra setup.


More information about the llvm-commits mailing list