[llvm-dev] Getting Object Files During LTO

Steven Wu via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 6 16:40:36 PDT 2018



> On Aug 6, 2018, at 4:13 PM, Bill Wendling via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Is there a way to get object files from the LTO step before the linker performs the final link phase? What I'd like to do is given these bitcode files:
> 
>   a.lto.o, b.lto.o, c.lto.o
> 

I assume you are asking for thinLTO because the fullLTO will merge all the bitcode file into one module and there will be only one object file output.

> run LTO on them and get out the object files:
> 
>   a.o, b.o, c.o
> 
> (These .o files hold the code that is sent directly to the final link phase.)
> 
> If there doesn't currently exist a way, is such a thing possible?

For both thinLTO and fullLTO, there exists APIs to write object file output before sending it to the linker. Depending on which linker you use, linker might provide you with different options.

Steven

> 
> -bw
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list