diff options
author | Jake Ehrlich <jakehehrlich@google.com> | 2017-10-11 18:09:18 +0000 |
---|---|---|
committer | Jake Ehrlich <jakehehrlich@google.com> | 2017-10-11 18:09:18 +0000 |
commit | f03384dce7cff4b250c4814380c03ea6440ebd3b (patch) | |
tree | 768ac227c01d86aa6adc7ab10bcd28014ce4a602 /llvm/tools/llvm-objcopy/Object.h | |
parent | 3500f5e3bf1c5818913d5b6a675f3cae3daee808 (diff) | |
download | bcm5719-llvm-f03384dce7cff4b250c4814380c03ea6440ebd3b.tar.gz bcm5719-llvm-f03384dce7cff4b250c4814380c03ea6440ebd3b.zip |
Reland "[llvm-objcopy] Add support for --strip-sections to remove all section headers leaving only program headers and loadable segment data"
ubsan caught an issue I made where I was converting a null pointer to a
reference.
elf utils implements a particularly extreme form of stripping that I'd
like to support. eu-strip has an option called "strip-sections" that
removes all section headers and leaves only program headers and the
segment data. I have implemented this option partly as a test but mainly
because in Fuchsia we would like to use this option to minimize the size
of our executables. The other strip options that are on my list include
--strip-all and --strip-debug. This is a preliminary implementation that
I'd like to start using in Fuchsia builds if possible. This change
implements such a stripping option for llvm-objcopy
Differential Revision: https://reviews.llvm.org/D38335
llvm-svn: 315484
Diffstat (limited to 'llvm/tools/llvm-objcopy/Object.h')
-rw-r--r-- | llvm/tools/llvm-objcopy/Object.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objcopy/Object.h b/llvm/tools/llvm-objcopy/Object.h index 391465db65e..f6088434805 100644 --- a/llvm/tools/llvm-objcopy/Object.h +++ b/llvm/tools/llvm-objcopy/Object.h @@ -346,6 +346,7 @@ public: uint32_t Machine; uint32_t Version; uint32_t Flags; + bool WriteSectionHeaders = true; Object(const llvm::object::ELFObjectFile<ELFT> &Obj); void removeSections(std::function<bool(const SectionBase &)> ToRemove); |