diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2019-06-07 17:57:48 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2019-06-07 17:57:48 +0000 |
commit | 8d58a98c594bb472b01158ba825cd632650ec2be (patch) | |
tree | 732ab6f7744e8e10e3f791d336d68550a35aee08 /llvm/tools/llvm-objcopy/CopyConfig.h | |
parent | 076ad57f8dbb7a26b6c17d5d2de0060f9f1e0ad6 (diff) | |
download | bcm5719-llvm-8d58a98c594bb472b01158ba825cd632650ec2be.tar.gz bcm5719-llvm-8d58a98c594bb472b01158ba825cd632650ec2be.zip |
llvm-objcopy: Implement --extract-partition and --extract-main-partition.
This implements the functionality described in
https://lld.llvm.org/Partitions.html. It works as follows:
- Reads the section headers using the ELF header at file offset 0;
- If extracting a loadable partition:
- Finds the section containing the required partition ELF header by looking it up in the section table;
- Reads the ELF and program headers from the section.
- If extracting the main partition:
- Reads the ELF and program headers from file offset 0.
- Filters the section table according to which sections are in the program headers that it read:
- If ParentSegment != nullptr or section is not SHF_ALLOC, then it goes in.
- Sections containing partition ELF headers or program headers are excluded as there are no headers for these in ordinary ELF files.
Differential Revision: https://reviews.llvm.org/D62364
llvm-svn: 362818
Diffstat (limited to 'llvm/tools/llvm-objcopy/CopyConfig.h')
-rw-r--r-- | llvm/tools/llvm-objcopy/CopyConfig.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objcopy/CopyConfig.h b/llvm/tools/llvm-objcopy/CopyConfig.h index 7607d3b34a3..06b3efddb5a 100644 --- a/llvm/tools/llvm-objcopy/CopyConfig.h +++ b/llvm/tools/llvm-objcopy/CopyConfig.h @@ -120,6 +120,7 @@ struct CopyConfig { StringRef BuildIdLinkDir; Optional<StringRef> BuildIdLinkInput; Optional<StringRef> BuildIdLinkOutput; + Optional<StringRef> ExtractPartition; StringRef SplitDWO; StringRef SymbolsPrefix; StringRef AllocSectionsPrefix; @@ -155,6 +156,7 @@ struct CopyConfig { bool AllowBrokenLinks = false; bool DeterministicArchives = true; bool ExtractDWO = false; + bool ExtractMainPartition = false; bool KeepFileSymbols = false; bool LocalizeHidden = false; bool OnlyKeepDebug = false; |