LTO: introduce object file-based on-disk module format.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 18 Sep 2014 21:28:49 +0000 (21:28 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 18 Sep 2014 21:28:49 +0000 (21:28 +0000)
commit394be6c159d16417edd71dd97531d7dfe2f1e32c
treeefc36bbc23dc86b4aa75bc77c2ce572e29f7248f
parent65edced76b8e1a3fdccb136fb33288b0ed150477
LTO: introduce object file-based on-disk module format.

This format is simply a regular object file with the bitcode stored in a
section named ".llvmbc", plus any number of other (non-allocated) sections.

One immediate use case for this is to accommodate compilation processes
which expect the object file to contain metadata in non-allocated sections,
such as the ".go_export" section used by some Go compilers [1], although I
imagine that in the future we could consider compiling parts of the module
(such as large non-inlinable functions) directly into the object file to
improve LTO efficiency.

[1] http://golang.org/doc/install/gccgo#Imports

Differential Revision: http://reviews.llvm.org/D4371

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218078 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
docs/BitCodeFormat.rst
docs/ReleaseNotes.rst
include/llvm/Object/Error.h
include/llvm/Object/IRObjectFile.h
lib/LTO/LTOModule.cpp
lib/Object/Error.cpp
lib/Object/IRObjectFile.cpp
lib/Object/SymbolicFile.cpp
test/LTO/Inputs/bcsection.macho.s [new file with mode: 0644]
test/LTO/Inputs/bcsection.s [new file with mode: 0644]
test/LTO/bcsection.ll [new file with mode: 0644]
test/tools/gold/Inputs/bcsection.s [new file with mode: 0644]
test/tools/gold/bcsection.ll [new file with mode: 0644]
tools/gold/gold-plugin.cpp
tools/llvm-nm/llvm-nm.cpp