aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Relocations.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index cc59070..666863b 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -2151,9 +2151,8 @@ static int getHexagonPacketOffset(const InputSection &isec,
for (unsigned i = 0;; i++) {
if (i == 3 || rel.offset < (i + 1) * 4)
return i * 4;
- uint32_t instWord = 0;
- memcpy(&instWord, data.data() + (rel.offset - (i + 1) * 4),
- sizeof(instWord));
+ uint32_t instWord =
+ read32(isec.getCtx(), data.data() + (rel.offset - (i + 1) * 4));
if (((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_PACKET) ||
((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_DUPLEX))
return i * 4;