dt-relr.exp --no-as-needed
authorAlan Modra <amodra@gmail.com>
Thu, 13 Jan 2022 06:04:07 +0000 (16:34 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 13 Jan 2022 06:09:35 +0000 (16:39 +1030)
Otherwise the very simple test may not be linked with libc.so at all,
and thus correctly have no version reference added.  Causing failure
of the dt-relr-glibc-1b.so test.

* testsuite/ld-elf/dt-relr.exp: Link with --no-as-needed.

ld/testsuite/ld-elf/dt-relr.exp

index 280373ec17a57a63bfb30a2c371bb6ea49b6cab1..423736050666cdde3887bc488603a595580ff4fc 100644 (file)
@@ -26,7 +26,7 @@ if { ![supports_dt_relr] } {
 run_cc_link_tests [list \
     [list \
        "Build dt-relr-glibc-1a.so" \
-       "-shared $NO_DT_RELR_CC_LDFLAGS" \
+       "-shared -Wl,--no-as-needed $NO_DT_RELR_CC_LDFLAGS" \
        "-fPIC" \
        { dt-relr-glibc-1.c } \
        {{readelf {--version-info} dt-relr-glibc-1a.rd}} \
@@ -34,7 +34,7 @@ run_cc_link_tests [list \
     ] \
     [list \
        "Build dt-relr-glibc-1b.so" \
-       "-shared $DT_RELR_CC_LDFLAGS" \
+       "-shared -Wl,--no-as-needed $DT_RELR_CC_LDFLAGS" \
        "-fPIC" \
        { dt-relr-glibc-1.c } \
        {{readelf {-W --version-info} dt-relr-glibc-1b.rd}} \