Fix llvm-readobj tests on big endian hosts.

llvm-svn: 179298
This commit is contained in:
Rafael Espindola 2013-04-11 17:23:23 +00:00
parent 1ab09cc883
commit 4c8ea76b6b
1 changed files with 8 additions and 1 deletions

View File

@ -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;