On Tue, Dec 7, 2010 at 3:53 PM, H.J. Lu <[email protected]> wrote: > On Tue, Dec 7, 2010 at 3:15 PM, Cary Coutant <[email protected]> wrote: >>> Here is my proposal. Any comments? >> >> We talked about ld -r a while back during the WHOPR project, and the >> two ways that the linker could work: (1) combine all the .o files and >> use the plugin to run LTRANS on the IR files, producing a pure, >> optimized, object file; and (2) combine the non-IR object files as ld >> -r normally would, and combine that result somehow with the IR from >> the other files, for later optimization. If I remember correctly, >> there was support for both modes of operation. The first mode is >> easily handled with the current design (untested as far as I know -- >> there are probably bugs, and I'm not sure if we get the symbol >> visibility correct in those cases). > > We considered it. The problem is LTO performs the best when > generating the final executable/DSO. That is we want the full IR in the > output of "ld -r".
What happens when ld -r is the final link? Think loadable linux kernel modules and some other stuff that abuse elf relocatable objects? Thanks, Andrew Pinski
