lto: Compile PR ld/23818 test with -fPIC master
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 30 Nov 2025 08:02:07 +0000 (16:02 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 30 Nov 2025 08:07:08 +0000 (16:07 +0800)
Compile PR ld/23818 test with -fPIC to fix

testsuite/ld-plugin/pr23818b.c:6:(.text+0x34): relocation R_MIPS_26 against `a local symbol' cannot be used when making a shared object; recompile with -fPIC
FAIL: Build libpr23818.so

for mips.

PR ld/23818
* testsuite/ld-plugin/lto.exp: Compile PR ld/23818 test with
-fPIC.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
ld/testsuite/ld-plugin/lto.exp

index 9ac3cf6b9f135ccf8063b432ab2e8f46e5454d74..84538bc859d25248c089c7a2684cd27ea3c800e5 100644 (file)
@@ -399,8 +399,8 @@ set lto_link_elf_tests [list \
    {} {-flto} \
    {pr22220main.cc} {} {} {c++}] \
   [list "Build libpr23818.so" \
-   "-shared -flto -g -Wl,-version-script,pr23818.t" \
-   "-g -flto $lto_fat" \
+   "-shared -fPIC -flto -g -Wl,-version-script,pr23818.t" \
+   "-g -fPIC -flto $lto_fat" \
    {pr23818a.c pr23818b.c} \
    {{"readelf" {-s --wide} "pr23818.d"}} \
    "libpr23818.so"] \
This page took 0.07731 seconds and 5 git commands to generate.