diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-11 17:23:23 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-11 17:23:23 +0000 |
commit | 6b281800d2bd2419d3f1c4e282c7c07dd54058f5 (patch) | |
tree | f5936edc887d5bd1873e00ff3cacbe1470d5a2b2 /include/llvm | |
parent | 4edf092787cab37d46da96eb1e9df0677ca30b1d (diff) | |
download | external_llvm-6b281800d2bd2419d3f1c4e282c7c07dd54058f5.zip external_llvm-6b281800d2bd2419d3f1c4e282c7c07dd54058f5.tar.gz external_llvm-6b281800d2bd2419d3f1c4e282c7c07dd54058f5.tar.bz2 |
Fix llvm-readobj tests on big endian hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Object/MachO.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/Object/MachO.h b/include/llvm/Object/MachO.h index 1fd8b6c..7bdb638 100644 --- a/include/llvm/Object/MachO.h +++ b/include/llvm/Object/MachO.h @@ -112,11 +112,18 @@ namespace MachOFormat { MachOInt32 Reserved3; }; + struct MachOInt24 { + uint8_t bytes[3]; + operator uint32_t() const { + return (bytes[2] << 24) | (bytes[1] << 16) | bytes[0]; + } + }; + template<endianness TargetEndianness> struct RelocationEntry { LLVM_MACHOB_IMPORT_TYPES(TargetEndianness) MachOInt32 Address; - unsigned SymbolNum : 24; + MachOInt24 SymbolNum; unsigned PCRel : 1; unsigned Length : 2; unsigned External : 1; |