Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixes from review
  • Loading branch information
androm3da committed Jul 20, 2025
commit ea130193ee7b070ce18a4c57f5be92bead67b68b
8 changes: 4 additions & 4 deletions lld/ELF/Relocations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2148,16 +2148,16 @@ constexpr uint32_t HEXAGON_END_OF_DUPLEX = 0 << 14;
// relocation.
static int getHexagonPacketOffset(const InputSection &isec,
const Relocation &rel) {
const ArrayRef<uint8_t> SectContents = isec.content();
const ArrayRef<uint8_t> data = isec.content();

// Search back as many as 3 instructions.
for (unsigned i = 0;; i++) {
if (i == 3 || rel.offset < (i + 1) * 4)
return i * 4;
uint32_t instWord = 0;
const ArrayRef<uint8_t> InstWordContents =
SectContents.drop_front(rel.offset - (i + 1) * 4);
::memcpy(&instWord, InstWordContents.data(), sizeof(instWord));
const ArrayRef<uint8_t> instWordContents =
data.drop_front(rel.offset - (i + 1) * 4);
memcpy(&instWord, instWordContents.data(), sizeof(instWord));
if (((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_PACKET) ||
((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_DUPLEX))
return i * 4;
Expand Down