aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Object
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-05 15:15:22 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-05 15:15:22 +0000
commitf16c2bb320f4d5b33dfaf8df8865f547e6d66005 (patch)
tree551e576e9809d1729da4aaadc72b33fa1d5fb8bb /include/llvm/Object
parent332edeb1dc9e6aed5229091bb56a914e78f177c2 (diff)
Don't fetch pointers from a InMemoryStruct.
InMemoryStruct is extremely dangerous as it returns data from an internal buffer when the endiannes doesn't match. This should fix the tests on big endian hosts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178875 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Object')
-rw-r--r--include/llvm/Object/MachO.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h
index ed7aabd2c8..83e9c013ca 100644
--- a/include/llvm/Object/MachO.h
+++ b/include/llvm/Object/MachO.h
@@ -15,6 +15,7 @@
#ifndef LLVM_OBJECT_MACHO_H
#define LLVM_OBJECT_MACHO_H
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Object/MachOObject.h"
#include "llvm/Object/ObjectFile.h"
@@ -47,7 +48,12 @@ public:
// In a MachO file, sections have a segment name. This is used in the .o
// files. They have a single segment, but this field specifies which segment
// a section should be put in in the final object.
- error_code getSectionFinalSegmentName(DataRefImpl Sec, StringRef &Res) const;
+ StringRef getSectionFinalSegmentName(DataRefImpl Sec) const;
+
+ // Names are stored as 16 bytes. These returns the raw 16 bytes without
+ // interpreting them as a C string.
+ ArrayRef<char> getSectionRawName(DataRefImpl Sec) const;
+ ArrayRef<char>getSectionRawFinalSegmentName(DataRefImpl Sec) const;
MachOObject *getObject() { return MachOObj.get(); }