Skip to content

Commit f5ad8dc

Browse files
jrtc27tru
authored andcommitted
[ELF][Hexagon] Fix host endianness assumption
Fixes: b42f96b ("[lld] Add thunks for hexagon (#111217)") (cherry picked from commit 723b40a)
1 parent 74a0c1e commit f5ad8dc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lld/ELF/Relocations.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,9 +2153,8 @@ static int getHexagonPacketOffset(const InputSection &isec,
21532153
for (unsigned i = 0;; i++) {
21542154
if (i == 3 || rel.offset < (i + 1) * 4)
21552155
return i * 4;
2156-
uint32_t instWord = 0;
2157-
memcpy(&instWord, data.data() + (rel.offset - (i + 1) * 4),
2158-
sizeof(instWord));
2156+
uint32_t instWord =
2157+
read32(isec.getCtx(), data.data() + (rel.offset - (i + 1) * 4));
21592158
if (((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_PACKET) ||
21602159
((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_DUPLEX))
21612160
return i * 4;

0 commit comments

Comments
 (0)