OSDN Git Service

[llvm-objcopy] Add support for --strip-sections to remove all section headers leaving...
authorJake Ehrlich <jakehehrlich@google.com>
Wed, 11 Oct 2017 01:59:06 +0000 (01:59 +0000)
committerJake Ehrlich <jakehehrlich@google.com>
Wed, 11 Oct 2017 01:59:06 +0000 (01:59 +0000)
commit0ac357a2385d76e185679bdb1811443783cd9cd5
tree6c5206cc1982ed9152800458a367a5785332d02e
parent445025a87541e2d274d23eab8e3951d56969df11
[llvm-objcopy] Add support for --strip-sections to remove all section headers leaving only program headers and loadable segment data

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315412 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-objcopy/strip-sections.test [new file with mode: 0644]
tools/llvm-objcopy/Object.cpp
tools/llvm-objcopy/Object.h
tools/llvm-objcopy/llvm-objcopy.cpp