binutils-gdb/ld/testsuite/ld-loongarch-elf/bad_pcrel20_s2_weak.d
Lulu Cai 4cb77761d6 LoongArch: Check PC-relative relocations for shared libraries
Building shared libraries should not be allowed for PC-relative
relocations against external symbols.
Currently LoongArch has no corresponding checks and silently
generates wrong shared libraries.

However, In the first version of the medium cmodel, pcalau12i+jirl was
used for function calls, in which case PC-relative relocations were
allowed.
2024-10-17 21:01:52 +08:00

6 lines
297 B
Makefile

#name: PC-relative relocation making shared
#source: bad_pcrel20_s2_weak.s
#target: [check_shared_lib_support]
#ld: -shared --defsym global_a=0x10 --defsym global_b=0x20
#error: .*: relocation R_LARCH_PCREL20_S2 against `global_b` can not be used when making a shared object; recompile with -fPIC