summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorSeiya Nuta <nuta@seiya.me>2019-08-20 08:49:07 +0000
committerSeiya Nuta <nuta@seiya.me>2019-08-20 08:49:07 +0000
commit522377494b3d7c4bfcaa9a632497231ac3c19143 (patch)
tree04b3f4e044f0b13d3518de9865b2b50ab81ce652 /llvm/lib/Object/MachOObjectFile.cpp
parent9c371309f38cfe1fe1bf52af2e70dd448044e7e2 (diff)
downloadbcm5719-llvm-522377494b3d7c4bfcaa9a632497231ac3c19143.tar.gz
bcm5719-llvm-522377494b3d7c4bfcaa9a632497231ac3c19143.zip
[yaml2obj/obj2yaml][MachO] Allow setting custom section data
Reviewers: alexshap, jhenderson, rupprecht Reviewed By: alexshap, jhenderson Subscribers: abrachet, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65799 llvm-svn: 369348
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index be1950e08ed..fdba3442af2 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -1945,6 +1945,11 @@ uint64_t MachOObjectFile::getSectionSize(DataRefImpl Sec) const {
return SectSize;
}
+ArrayRef<uint8_t> MachOObjectFile::getSectionContents(uint32_t Offset,
+ uint64_t Size) const {
+ return arrayRefFromStringRef(getData().substr(Offset, Size));
+}
+
Expected<ArrayRef<uint8_t>>
MachOObjectFile::getSectionContents(DataRefImpl Sec) const {
uint32_t Offset;
@@ -1960,7 +1965,7 @@ MachOObjectFile::getSectionContents(DataRefImpl Sec) const {
Size = Sect.size;
}
- return arrayRefFromStringRef(getData().substr(Offset, Size));
+ return getSectionContents(Offset, Size);
}
uint64_t MachOObjectFile::getSectionAlignment(DataRefImpl Sec) const {
OpenPOWER on IntegriCloud