gcc/libgcc/config/riscv
Nelson Chu 951ca35bdb RISC-V: jal cannot refer to a default visibility symbol for shared object. [PR 108339]
This is the original binutils bugzilla report,
https://sourceware.org/bugzilla/show_bug.cgi?id=28509

And this is the first version of the proposed binutils patch,
https://sourceware.org/pipermail/binutils/2021-November/118398.html

After applying the binutils patch, I get the the unexpected error when
building libgcc,

/scratch/nelsonc/riscv-gnu-toolchain/riscv-gcc/libgcc/config/riscv/div.S:42:
/scratch/nelsonc/build-upstream/rv64gc-linux/build-install/riscv64-unknown-linux-gnu/bin/ld: relocation R_RISCV_JAL against `__udivdi3' which may bind externally can not be used when making a shared object; recompile with -fPIC

Therefore, this patch add an extra hidden alias symbol for __udivdi3, and
then use HIDDEN_JUMPTARGET to target a non-preemptible symbol instead.
The solution is similar to glibc as follows,
https://sourceware.org/git/?p=glibc.git;a=commit;h=68389203832ab39dd0dbaabbc4059e7fff51c29b

libgcc/ChangeLog:

	PR target/108339
	* config/riscv/div.S: Add the hidden alias symbol for __udivdi3, and
	then use HIDDEN_JUMPTARGET to target it since it is non-preemptible.
	* config/riscv/riscv-asm.h: Added new macros HIDDEN_JUMPTARGET and
	HIDDEN_DEF.

(cherry picked from commit 45116f3420)
2023-02-20 19:03:43 +08:00
..
atomic.c Update copyright years. 2020-01-01 12:51:42 +01:00
crti.S
crtn.S
div.S RISC-V: jal cannot refer to a default visibility symbol for shared object. [PR 108339] 2023-02-20 19:03:43 +08:00
linux-unwind.h Update copyright years. 2020-01-01 12:51:42 +01:00
muldi3.S Update copyright years. 2020-01-01 12:51:42 +01:00
multi3.c Update copyright years. 2020-01-01 12:51:42 +01:00
riscv-asm.h RISC-V: jal cannot refer to a default visibility symbol for shared object. [PR 108339] 2023-02-20 19:03:43 +08:00
save-restore.S Update copyright years. 2020-01-01 12:51:42 +01:00
sfp-machine.h Update copyright years. 2020-01-01 12:51:42 +01:00
t-elf Use C version of multi3 for RVE support. 2017-12-12 22:25:06 -08:00
t-elf32
t-elf64
t-softfp32 RISC-V: Build soft-float divide routines for -mno-fdiv. 2019-11-01 13:35:12 -07:00
t-softfp64