[NFC][ELF][Hexagon] Avoid pointless ArrayRef::drop_front

Fixes: b42f96bc057f ("[lld] Add thunks for hexagon (#111217)")
(cherry picked from commit de15d365743e16848a9d15fc32ae6ab98d399ec2)
This commit is contained in:
Jessica Clarke 2025-08-03 21:24:10 +01:00 committed by Tobias Hieta
parent 489d36cedc
commit 74a0c1e962

View File

@ -2154,9 +2154,8 @@ static int getHexagonPacketOffset(const InputSection &isec,
if (i == 3 || rel.offset < (i + 1) * 4)
return i * 4;
uint32_t instWord = 0;
const ArrayRef<uint8_t> instWordContents =
data.drop_front(rel.offset - (i + 1) * 4);
memcpy(&instWord, instWordContents.data(), sizeof(instWord));
memcpy(&instWord, data.data() + (rel.offset - (i + 1) * 4),
sizeof(instWord));
if (((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_PACKET) ||
((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_DUPLEX))
return i * 4;