From 4c8ea76b6b9d8dde18505951fe884cf6cbad4538 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 11 Apr 2013 17:23:23 +0000 Subject: [PATCH] Fix llvm-readobj tests on big endian hosts. llvm-svn: 179298 --- llvm/include/llvm/Object/MachO.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/Object/MachO.h b/llvm/include/llvm/Object/MachO.h index 1fd8b6c92c31..7bdb638b26fd 100644 --- a/llvm/include/llvm/Object/MachO.h +++ b/llvm/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 struct RelocationEntry { LLVM_MACHOB_IMPORT_TYPES(TargetEndianness) MachOInt32 Address; - unsigned SymbolNum : 24; + MachOInt24 SymbolNum; unsigned PCRel : 1; unsigned Length : 2; unsigned External : 1; -- GitLab