Skip to content

riscv64: Fix link error about relocation#23

Open
XiaoWang1772 wants to merge 1 commit intopetrpavlu:riscv64-linuxfrom
XiaoWang1772:xiao-relocation-fix
Open

riscv64: Fix link error about relocation#23
XiaoWang1772 wants to merge 1 commit intopetrpavlu:riscv64-linuxfrom
XiaoWang1772:xiao-relocation-fix

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 <xiao.w.wang@intel.com>
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