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/lib/Transforms/Utils/BasicBlockUtils.cpp | |
parent | 076ad57f8dbb7a26b6c17d5d2de0060f9f1e0ad6 (diff) | |
download | llvm-8d58a98c594bb472b01158ba825cd632650ec2be.zip llvm-8d58a98c594bb472b01158ba825cd632650ec2be.tar.gz llvm-8d58a98c594bb472b01158ba825cd632650ec2be.tar.bz2 |
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/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions