diff options
author | Nelson Chu <nelson.chu@sifive.com> | 2021-11-29 04:48:20 -0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2021-12-06 10:55:01 +0800 |
commit | 45116f342057b7facecd3d05c2091ce3a77eda59 (patch) | |
tree | c4ec4f8c446d5fe5d59d4259f41e44f07c8eaa25 /gcc/cse.c | |
parent | b880d1514c1e3dd75a6ea311a5cc956742bd713c (diff) | |
download | gcc-45116f342057b7facecd3d05c2091ce3a77eda59.zip gcc-45116f342057b7facecd3d05c2091ce3a77eda59.tar.gz gcc-45116f342057b7facecd3d05c2091ce3a77eda59.tar.bz2 |
RISC-V: jal cannot refer to a default visibility symbol for shared object.
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:
* 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.
Diffstat (limited to 'gcc/cse.c')
0 files changed, 0 insertions, 0 deletions