Skip to content
Commit 68389203 authored by Fangrui Song's avatar Fangrui Song
Browse files

riscv: Fix incorrect jal with HIDDEN_JUMPTARGET



A non-local STV_DEFAULT defined symbol is by default preemptible in a
shared object. j/jal cannot target a preemptible symbol. On other
architectures, such a jump instruction either causes PLT [BZ #18822], or
if short-ranged, sometimes rejected by the linker (but not by GNU ld's
riscv port [ld PR/28509]).

Use HIDDEN_JUMPTARGET to target a non-preemptible symbol instead.

With this patch, ld.so and libc.so can be linked with LLD if source
files are compiled/assembled with -mno-relax/-Wa,-mno-relax.

Acked-by: default avatarPalmer Dabbelt <palmer@dabbelt.com>
Reviewed-by: default avatarAdhemerval Zanella <adhemerval.zanella@linaro.org>
parent 9b7cfab1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment