[LLVMdev] Proposal: support object file-based on-disk module format

Peter Collingbourne peter at pcc.me.uk
Tue Jul 8 11:43:47 PDT 2014


On Tue, Jul 08, 2014 at 07:21:00PM +0100, Dan Liew wrote:
> Hi Peter,
> 
> This sounds sensible to me.
> 
> There is one thing that does concern me though. IIRC when you create
> object files with additional sections the GNU ld linker (possibly
> others too) will concatenate sections it doesn't recognise into the
> final executable.
> There is actually a hacky tool called whole-program-llvm [1] which
> actually uses this to get a list of paths to LLVM bitcode files that
> make up the final executable.
> 
> If I've understood your proposal correctly then when compiling and
> using the GNU ld linker you would end up with all the bitcode files
> embedded in the final executable. Is this intentional?
> 
> [1] https://github.com/travitch/whole-program-llvm

If the linker never sees the intermediate object files, this will not
happen. This is the case under the current proposal. However, if we codegen
into the object files, we might want to make those object files visible to
the linker. In which case, the compiler can use an object-format-specific
exclude flag [1] to exclude those sections from the executable or DSO.

Thanks,
-- 
Peter

[1] https://sourceware.org/binutils/docs/as/Section.html



More information about the llvm-dev mailing list