diff options
| author | Seiya Nuta <nuta@seiya.me> | 2019-06-08 01:22:54 +0000 |
|---|---|---|
| committer | Seiya Nuta <nuta@seiya.me> | 2019-06-08 01:22:54 +0000 |
| commit | b728e53b957f0edea000c6169448be226f0b8e6f (patch) | |
| tree | 0abb4c44e74d5cd79588d0dfdc348525e4920498 /llvm/tools/llvm-objcopy/MachO/MachOWriter.h | |
| parent | 5ada887bf2411f4a53a468642e520e2c8c13b2c3 (diff) | |
| download | bcm5719-llvm-b728e53b957f0edea000c6169448be226f0b8e6f.tar.gz bcm5719-llvm-b728e53b957f0edea000c6169448be226f0b8e6f.zip | |
[llvm-objcopy][MachO] Recompute and update offset/size fields in the writer
Summary:
Recompute and update offset/size fields so that we can implement llvm-objcopy options like --only-section.
This patch is the first step and focuses on supporting load commands that covered by existing tests: executable files and
dynamic libraries are not supported.
Reviewers: alexshap, rupprecht, jhenderson
Reviewed By: alexshap, rupprecht
Subscribers: compnerd, jakehehrlich, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62652
llvm-svn: 362863
Diffstat (limited to 'llvm/tools/llvm-objcopy/MachO/MachOWriter.h')
| -rw-r--r-- | llvm/tools/llvm-objcopy/MachO/MachOWriter.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objcopy/MachO/MachOWriter.h b/llvm/tools/llvm-objcopy/MachO/MachOWriter.h index 9c91452a2ad..ce5bb560b9f 100644 --- a/llvm/tools/llvm-objcopy/MachO/MachOWriter.h +++ b/llvm/tools/llvm-objcopy/MachO/MachOWriter.h @@ -29,8 +29,14 @@ class MachOWriter { size_t symTableSize() const; size_t strTableSize() const; + void updateDySymTab(MachO::macho_load_command &MLC); + void updateSizeOfCmds(); + Error layout(); + void writeHeader(); void writeLoadCommands(); + template <typename StructType> + void writeSectionInLoadCommand(const Section &Sec, uint8_t *&Out); void writeSections(); void writeSymbolTable(); void writeStringTable(); @@ -46,6 +52,7 @@ public: : O(O), Is64Bit(Is64Bit), IsLittleEndian(IsLittleEndian), B(B) {} size_t totalSize() const; + Error finalize(); Error write(); }; |

