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 db3a66c..cc59070 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -2152,9 +2152,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;