Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 30a9eb5

Browse filesBrowse files
committed
Add check for register.
1 parent 6e05f36 commit 30a9eb5
Copy full SHA for 30a9eb5

File tree

1 file changed

+4
-0
lines changed
Filter options

1 file changed

+4
-0
lines changed

‎lld/ELF/Arch/LoongArch.cpp

Copy file name to clipboardExpand all lines: lld/ELF/Arch/LoongArch.cpp
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,10 @@ bool LoongArch::tryGotToPCRel(uint8_t *loc, const Relocation &rHi20,
11881188

11891189
const uint32_t currInsn = read32le(loc);
11901190
const uint32_t nextInsn = read32le(loc + 4);
1191+
// Check if use the same register.
1192+
if (getD5(currInsn) != getJ5(nextInsn) || getJ5(nextInsn) != getD5(nextInsn))
1193+
return false;
1194+
11911195
uint64_t pageDelta =
11921196
getLoongArchPageDelta(symLocal, secAddr + rHi20.offset, rHi20.type);
11931197
// pcalau12i $a0, %pc_hi20

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.