<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Aug 6, 2018 at 4:30 PM Quentin Colombet <<a href="mailto:quentin.colombet@gmail.com">quentin.colombet@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Bill,<br>
<br>
<br>
2018-08-06 16:13 GMT-07:00 Bill Wendling via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>:<br>
> Is there a way to get object files from the LTO step before the linker<br>
> performs the final link phase? What I'd like to do is given these bitcode<br>
> files:<br>
><br>
>   a.lto.o, b.lto.o, c.lto.o<br>
><br>
> run LTO on them and get out the object files:<br>
><br>
>   a.o, b.o, c.o<br>
><br>
> (These .o files hold the code that is sent directly to the final link<br>
> phase.)<br>
><br>
> If there doesn't currently exist a way, is such a thing possible?<br>
<br>
I don't think that's possible, because basically the LTO pipeline will<br>
put all the input files into one module and we have no way to track<br>
back what came from what, nor it made much sense after LTO does<br>
inlining and such.<br>
That said, for thin-LTO we may still have some of the information around.<br>
<br>
+ Teresa, she should know.<br><br></blockquote><div>That's what I feared might be the answer. Another question then, would the function ordering be deterministic? I.e., if a.o had functions "foo", "bar", and "baz", and b.o had functions "mux", "nux", and bork", would the function order before it went off to the final link phase be:</div><div><br></div><div>  foo, bar, baz, mux, nux, bork</div><div><br></div><div>(This assumes that none of those functions were inlined or otherwise deleted.)</div><div><br></div><div>-bw </div></div></div>