[ bfd/ChangeLog ]
[binutils-gdb.git] / ld / testsuite / ld-mips-elf / mips-elf.exp
index add2060acd6a590e704841bb0b5bcaa228cbe2e6..aba416f56aba94815bf9730542c5d97dfc5ccc7b 100644 (file)
@@ -137,6 +137,33 @@ if $has_newabi {
     run_dump_test "emit-relocs-1"
 }
 
+if {[istarget mips*-*-linux*]} {
+     # The number of symbols that are always included in the symbol table
+     # for these tests.  The 5 are:
+     #
+     #     the null symbol entry
+     #     the .MIPS.stubs section symbol
+     #     the .text section symbol
+     #     _gp
+     #     _GLOBAL_OFFSET_TABLE_
+     set base_syms 5
+     foreach dynsym { 7fff 8000 fff0 10000 2fe80 } {
+        run_ld_link_tests \
+            [list [list \
+                       "Stub for dynsym 0x$dynsym" \
+                       "-shared -melf32btsmip -T stub-dynsym-1.ld" \
+                       [concat \
+                            "-EB -march=mips1 -32 -KPIC" \
+                            "--defsym base_syms=$base_syms" \
+                            "--defsym dynsym=0x$dynsym"] \
+                       [list "stub-dynsym-1.s"] \
+                       [list [list \
+                                  "objdump" "-dz" \
+                                  "stub-dynsym-1-$dynsym.d"]] \
+                       "stub-dynsym-1-$dynsym"]]
+     }
+ }
+
 # For tests which may involve multiple files, use run_ld_link_tests.
 
 # List contains test-items with 3 items followed by 2 lists:
@@ -199,9 +226,29 @@ set mips_tls_tests {
      "-EB -march=mips1 -32 -KPIC" {tls-hidden2a.s tls-hidden2b.s}
      {{objdump -drj.text tls-hidden2.d} {objdump -sj.got tls-hidden2-got.d}}
      "tls-hidden2.so"}
+    {"Shared library with TLS and hidden symbols (3)"
+     "-shared -melf32btsmip -T tls-hidden3.ld"
+     "-EB -march=mips2 -32 -KPIC" {tls-hidden3a.s tls-hidden3b.s}
+     {{objdump -dj.text tls-hidden3.d} {objdump -sj.got tls-hidden3.got}
+      {readelf --relocs tls-hidden3.r}}
+     "tls-hidden3.so"}
+    {"Shared library with TLS and hidden symbols (4)"
+     "-shared -melf32btsmip -T tls-hidden3.ld"
+     "-EB -march=mips2 -32 -KPIC" {tls-hidden4a.s tls-hidden4b.s}
+     {{objdump -sj.got tls-hidden4.got} {readelf --relocs tls-hidden4.r}}
+     "tls-hidden4.so"}
 }
 
 if {[istarget mips*-*-linux*]} {
     run_ld_link_tests $mips_tls_tests
 }
 
+set mips16_call_global_test {
+    {"Global calls from mips16"
+     ""
+     "-mips32r2" {mips16-call-global-1.s mips16-call-global-2.s mips16-call-global-3.s}
+     {{objdump -dr mips16-call-global.d}}
+     "mips16-call-global"}
+}
+
+run_ld_link_tests $mips16_call_global_test