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

Peter Collingbourne peter at pcc.me.uk
Wed Jul 9 11:06:37 PDT 2014


On Wed, Jul 09, 2014 at 08:35:18AM +0100, David Chisnall wrote:
> On 8 Jul 2014, at 19:43, Peter Collingbourne <peter at pcc.me.uk> wrote:
> 
> > 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.
> 
> We (current hat: FreeBSD) would like to be able to leave the LLVM IR in programs and shared libraries so that packaging tools can run microarchitecure-specific optimisations on the result, either offline or at install time (and a few other things, including applying software diversity techniques and so on).

That's an interesting use case, but I think it is to some extent orthogonal
to changes to the intermediate object format. It should be possible to
teach the LTO plugin to emit the combined bitcode in a (non-excluded)
.llvmbc section into the object file that the linker sees.

Thanks,
-- 
Peter



More information about the llvm-dev mailing list