Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riscv64: Fix link error about relocation #23

Open
wants to merge 1 commit into
base: riscv64-linux
Choose a base branch
from

Conversation

XiaoWang1772
Copy link

With GNU ld v2.42, the integer.c and compressed.c build fail with error: "dangerous relocation: The addend isn't allowed for R_RISCV_GOT_HI20" for JMP_RANGE related test cases.

This patch changes the target addr loading to local addr loading, thus to avoid the unnecessary global symbol relocation.

Though currently there's no "1f+x" style addr loading for rs2, this patch changes it together with rs1.

With GNU ld v2.42, the integer.c and compressed.c build fail with error:
"dangerous relocation: The addend isn't allowed for R_RISCV_GOT_HI20" for
JMP_RANGE related test cases.

This patch changes the target addr loading to local addr loading, thus to
avoid the unnecessary global symbol relocation.

Though currently there's no "1f+x" style addr loading for rs2, this patch
changes it together with rs1.

Signed-off-by: Xiao Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant