Explicitly handle endianness to ensure that bytes are read properly on
big-endian systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198847
91177308-0d34-0410-b5e6-
96231b3b80d8
/// +-+---+----+-----------------------+
/// | more personality routine data |
/// +-+---+----+-----------------------+
/// | more personality routine data |
- const uint32_t Word =
- *reinterpret_cast<const uint32_t *>(Contents->data() + TableEntryOffset);
+ const support::ulittle32_t Word =
+ *reinterpret_cast<const support::ulittle32_t *>(Contents->data() + TableEntryOffset);
if (Word & 0x80000000) {
SW.printString("Model", StringRef("Compact"));
if (Word & 0x80000000) {
SW.printString("Model", StringRef("Compact"));
/// - The special bit pattern EXIDX_CANTUNWIND, indicating that associated
/// frames cannot be unwound
/// - The special bit pattern EXIDX_CANTUNWIND, indicating that associated
/// frames cannot be unwound
- const uint32_t *Data = reinterpret_cast<const uint32_t *>(Contents->data());
+ const support::ulittle32_t *Data =
+ reinterpret_cast<const support::ulittle32_t *>(Contents->data());
const unsigned Entries = IT->sh_size / IndexTableEntrySize;
ListScope E(SW, "Entries");
for (unsigned Entry = 0; Entry < Entries; ++Entry) {
DictScope E(SW, "Entry");
const unsigned Entries = IT->sh_size / IndexTableEntrySize;
ListScope E(SW, "Entries");
for (unsigned Entry = 0; Entry < Entries; ++Entry) {
DictScope E(SW, "Entry");
+ const support::ulittle32_t Word0 =
Data[Entry * (IndexTableEntrySize / sizeof(*Data)) + 0];
Data[Entry * (IndexTableEntrySize / sizeof(*Data)) + 0];
+ const support::ulittle32_t Word1 =
Data[Entry * (IndexTableEntrySize / sizeof(*Data)) + 1];
if (Word0 & 0x80000000) {
Data[Entry * (IndexTableEntrySize / sizeof(*Data)) + 1];
if (Word0 & 0x80000000) {