mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Fix misaligned access in MachO object file reader: despite containing an
int64_t, Symbol64TableEntry is actually only stored with 4-byte alignment within the file. The usage of #pragma pack here is copied from the corresponding code in Support/Endian.h, so shouldn't introduce any new portability problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162312 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -273,6 +273,10 @@ namespace macho {
|
|||||||
uint16_t Flags;
|
uint16_t Flags;
|
||||||
uint32_t Value;
|
uint32_t Value;
|
||||||
};
|
};
|
||||||
|
// Despite containing a uint64_t, this structure is only 4-byte aligned within
|
||||||
|
// a MachO file.
|
||||||
|
#pragma pack(push)
|
||||||
|
#pragma pack(4)
|
||||||
struct Symbol64TableEntry {
|
struct Symbol64TableEntry {
|
||||||
uint32_t StringIndex;
|
uint32_t StringIndex;
|
||||||
uint8_t Type;
|
uint8_t Type;
|
||||||
@@ -280,6 +284,7 @@ namespace macho {
|
|||||||
uint16_t Flags;
|
uint16_t Flags;
|
||||||
uint64_t Value;
|
uint64_t Value;
|
||||||
};
|
};
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Data-in-code Table Entry
|
/// @name Data-in-code Table Entry
|
||||||
|
Reference in New Issue
Block a user