diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 19:34:23 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 19:34:23 +0000 |
commit | 721c201bd55ffb73cb2ba8d39e0570fa38c44e15 (patch) | |
tree | eacfc83d988e4b9d11114387ae7dc41243f2a363 /lib/Object/MachOObject.cpp | |
parent | 2b2816e083a455f7a656ae88b0fd059d1688bb36 (diff) | |
download | FreeBSD-src-721c201bd55ffb73cb2ba8d39e0570fa38c44e15.zip FreeBSD-src-721c201bd55ffb73cb2ba8d39e0570fa38c44e15.tar.gz |
Vendor import of llvm trunk r161861:
http://llvm.org/svn/llvm-project/llvm/trunk@161861
Diffstat (limited to 'lib/Object/MachOObject.cpp')
-rw-r--r-- | lib/Object/MachOObject.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Object/MachOObject.cpp b/lib/Object/MachOObject.cpp index b7e5cdc..00dea3f 100644 --- a/lib/Object/MachOObject.cpp +++ b/lib/Object/MachOObject.cpp @@ -357,6 +357,19 @@ void MachOObject::ReadSymbol64TableEntry(uint64_t SymbolTableOffset, ReadInMemoryStruct(*this, Buffer->getBuffer(), Offset, Res); } +template<> +void SwapStruct(macho::DataInCodeTableEntry &Value) { + SwapValue(Value.Offset); + SwapValue(Value.Length); + SwapValue(Value.Kind); +} +void MachOObject::ReadDataInCodeTableEntry(uint64_t TableOffset, + unsigned Index, + InMemoryStruct<macho::DataInCodeTableEntry> &Res) const { + uint64_t Offset = (TableOffset + + Index * sizeof(macho::DataInCodeTableEntry)); + ReadInMemoryStruct(*this, Buffer->getBuffer(), Offset, Res); +} void MachOObject::ReadULEB128s(uint64_t Index, SmallVectorImpl<uint64_t> &Out) const { |