[BinaryFormat] Fix bitfield-ordering of MachO::relocation_info on big-endian.

Hopefully this will fix the JITLink regression test failures on big-endian
testers (e.g.
http://lab.llvm.org:8011/builders/clang-s390x-linux-lnt/builds/12702)

llvm-svn: 358839
This commit is contained in:
Lang Hames 2019-04-21 03:14:43 +00:00
parent 0191531a76
commit 3ccd677bf8
1 changed files with 5 additions and 0 deletions

View File

@ -942,8 +942,13 @@ struct fat_arch_64 {
// Structs from <mach-o/reloc.h> // Structs from <mach-o/reloc.h>
struct relocation_info { struct relocation_info {
int32_t r_address; int32_t r_address;
#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && (BYTE_ORDER == BIG_ENDIAN)
uint32_t r_type : 4, r_extern : 1, r_length : 2, r_pcrel : 1,
r_symbolnum : 24;
#else
uint32_t r_symbolnum : 24, r_pcrel : 1, r_length : 2, r_extern : 1, uint32_t r_symbolnum : 24, r_pcrel : 1, r_length : 2, r_extern : 1,
r_type : 4; r_type : 4;
#endif
}; };
struct scattered_relocation_info { struct scattered_relocation_info {