ld: Add -Bno-symbolic
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elf / shared.exp
index 7b1f8985f61ff0e2e68cf454f1272cdee004d6a0..d00358e47ef595b9cdf6f87b2613f29fedbf3b99 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for various ELF tests.
-#   Copyright (C) 2006-2020 Free Software Foundation, Inc.
+#   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -71,7 +71,7 @@ if { [istarget "mips*vr4100*-*-elf*"] \
 }
 
 if [is_underscore_target] {
-    set ASFLAGS "$ASFLAGS --defsym UNDERSCORE=1"
+    append ASFLAGS " --defsym UNDERSCORE=1"
 }
 
 run_ld_link_tests [list \
@@ -93,15 +93,6 @@ run_ld_link_tests [list \
        {} \
        "pr22471b.so" \
     ] \
-    [list \
-       "Build pr22471" \
-       "$LFLAGS -rpath-link ." \
-       "tmpdir/pr22471b.so" \
-       "" \
-       {pr22471b.s} \
-       {} \
-       "pr22471" \
-    ] \
     [list \
        "Build pr22649-1.so" \
        "$LFLAGS -shared" \
@@ -113,6 +104,18 @@ run_ld_link_tests [list \
     ] \
 ]
 
+run_ld_link_tests [list \
+    [list \
+       "Build pr22471" \
+       "$LFLAGS -rpath-link . -rpath-link tmpdir" \
+       "tmpdir/pr22471b.so" \
+       "" \
+       {pr22471b.s} \
+       {} \
+       "pr22471" \
+    ] \
+] bfin-*-* frv-*-* lm32-*-*
+
 if { [check_gc_sections_available] } {
     if [istarget mips*-*-*] {
        set actions {{ld pr22649-2ab-mips.msg}}
@@ -177,7 +180,7 @@ run_ld_link_tests [list \
          {readelf {-d --wide} textrel.rd}} \
        "textrel.so" \
     ] \
-] "xtensa-*-*"
+] bfin-*-* frv-*-* lm32-*-* xtensa-*-*
 
 # The MIPS backend sets SHF_WRITE, in `mips_elf_create_dynamic_relocation',
 # for any section that has a dynamic relocation attached and consequently
@@ -194,7 +197,7 @@ run_ld_link_tests [list \
         {{ld textrel.map}} \
        "textrel.so" \
     ] \
-] "cris*-*-*" "mips*-*-*"
+] bfin-*-* cris*-*-* frv-*-* lm32-*-* mips*-*-*
 
 # PR ld/20828 check for correct dynamic symbol table entries where:
 # - symbols have been defined with a linker script,
@@ -464,6 +467,8 @@ run_ld_link_tests [list \
 setup_xfail "alpha-*-*" "bfin-*-*" "ia64-*-*" "xtensa-*-*"
 # or don't have .data.rel.ro
 setup_xfail "hppa*64*-*-hpux*" "tic6x-*-*"
+# or complain about relocs in read-only sections
+setup_xfail frv-*-* lm32-*-*
 run_ld_link_tests [list \
     [list \
        "pr20995" \
@@ -613,6 +618,10 @@ set build_tests {
   {"Build libdl2k.so with --export-dynamic-symbol-list=dl2.list and -Bsymbolic"
    "-shared -Wl,--export-dynamic-symbol-list=dl2.list,-Bsymbolic" "-fPIC"
    {dl2.c dl2xxx.c} {} "libdl2k.so"}
+  # Check that -Bno-symbolic cancels -Bsymbolic.
+  {"Build libdl2l.so with -Bsymbolic -Bno-symbolic and --export-dynamic-symbol=foo"
+   "-shared -Wl,-Bsymbolic,-Bno-symbolic,--export-dynamic-symbol=foo" "-fPIC"
+   {dl2.c dl2xxx.c} {} "libdl2l.so"}
   {"Build libdl4a.so with --dynamic-list=dl4.list"
    "-shared -Wl,--dynamic-list=dl4.list" "-fPIC"
    {dl4.c dl4xxx.c} {} "libdl4a.so"}
@@ -1023,6 +1032,9 @@ set run_tests [list \
     [list "Run with libdl2k.so" \
      "-Wl,--no-as-needed tmpdir/libdl2k.so" "" \
      {dl2main.c} "dl2k" "dl2a.out" ] \
+    [list "Run with libdl2l.so" \
+     "-Wl,--no-as-needed tmpdir/libdl2l.so" "" \
+     {dl2main.c} "dl2l" "dl2b.out" ] \
     [list "Run with libdl4a.so" \
      "-Wl,--no-as-needed tmpdir/libdl4a.so" "" \
      {dl4main.c} "dl4a" "dl4a.out" "-fPIC"] \
This page took 0.024624 seconds and 4 git commands to generate.