[ELF] Use endianness-aware read32 to avoid dispatch. NFC

This commit is contained in:
Fangrui Song 2022-03-15 23:51:11 -07:00
parent 385573e07b
commit bdb98bd979
1 changed files with 2 additions and 1 deletions

View File

@ -409,7 +409,8 @@ void EhFrameSection::addRecords(EhInputSection *sec, ArrayRef<RelTy> rels) {
return;
size_t offset = piece.inputOff;
uint32_t id = read32(piece.data().data() + 4);
const uint32_t id =
endian::read32<ELFT::TargetEndianness>(piece.data().data() + 4);
if (id == 0) {
offsetToCie[offset] = addCie<ELFT>(piece, rels);
continue;