]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/testsuite/ld-mips-elf/mips-elf.exp
bfd/
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-mips-elf / mips-elf.exp
index 7b1a57b76190388d4e084eaec98c56a952de16ad..ce448cfcf96b2f710c3dd8b61b1acd5f915281aa 100644 (file)
@@ -109,6 +109,9 @@ if { $linux_gnu } {
 if { [istarget mips64*-linux-gnu] } {
     set o32_as_flags "-32 -EB"
     set o32_ld_flags "-melf32btsmip"
+} elseif { [istarget mips64*-*freebsd*] } {
+    set o32_as_flags "-32 -EB"
+    set o32_ld_flags "-melf32btsmip_fbsd"
 } else {
     set o32_as_flags ""
     set o32_ld_flags ""
@@ -120,6 +123,31 @@ run_dump_test "mips16-1"
 # MIPS branch offset final link checking.
 run_dump_test "branch-misc-1"
 
+# Jalx test
+run_dump_test "jalx-1"
+
+if { $linux_gnu } {
+    run_ld_link_tests [list \
+       [list "Dummy shared library for JALX test 2" \
+             "-shared -nostdlib -melf32btsmip" \
+             "-G0 -EB -mmicromips -no-mdebug -mabi=32 -march=mips32r2 -KPIC" \
+             { jalx-2-printf.s } \
+             {} \
+             "libjalx-2.so"] \
+       [list "Dummy external function for JALX test 2" \
+             "-r -melf32btsmip" \
+             "-G0 -EB -no-mdebug -mabi=32 -march=mips32r2 -mno-shared -call_nonpic" \
+             { jalx-2-ex.s } \
+             {} \
+             "jalx-2-ex.o.r"] \
+       [list "MIPS JALX test 2" \
+             "-nostdlib -T jalx-2.ld tmpdir/libjalx-2.so tmpdir/jalx-2-ex.o.r -melf32btsmip" \
+             "-G0 -EB -mmicromips -no-mdebug -mabi=32 -march=mips32r2 -mno-shared -call_nonpic" \
+             { jalx-2-main.s } \
+             { { objdump -d jalx-2.dd } } \
+             "jalx-2"]]
+}
+
 # Test multi-got link.  We only do this on GNU/Linux because it requires
 # the "traditional" emulations.
 if { $linux_gnu } {
@@ -157,8 +185,10 @@ if $has_newabi {
 
 if { $linux_gnu } {
     run_dump_test "rel32-o32"
-    run_dump_test "rel32-n32"
-    run_dump_test "rel64"
+    if { $has_newabi } {
+       run_dump_test "rel32-n32"
+       run_dump_test "rel64"
+    }
     # The first test checks that a mixed PIC/non-PIC relocatable link
     # will not introduce any stubs itself, but will flag PIC functions
     # for the final link.
@@ -293,6 +323,18 @@ if {$has_newabi} {
 }
 run_dump_test "reloc-4"
 run_dump_test "reloc-5"
+if { $has_newabi } {
+    run_ld_link_tests {
+       {"reloc test 6a" "-shared"
+        "-n32" "reloc-6a.s"
+        {}
+        "reloc-6a.so"}
+       {"reloc test 6b" "tmpdir/reloc-6a.so"
+        "-n32" "reloc-6b.s"
+        {}
+        "reloc-6b"}
+    }
+}
 
 if {$has_newabi && $linux_gnu} {
     run_dump_test "eh-frame1-n32"
@@ -322,13 +364,17 @@ if {$has_newabi} {
     run_dump_test "jalbal"
 }
 
+run_dump_test "mode-change-error-1"
+
 run_dump_test "mips16-hilo"
 if {$has_newabi} {
     run_dump_test "mips16-hilo-n32"
 }
 
 if { $linux_gnu } {
-    run_dump_test "textrel-1"
+    if { $has_newabi } {
+       run_dump_test "textrel-1"
+    }
     run_dump_test "got-page-1"
     if $has_newabi {
        run_dump_test "got-page-2"
@@ -528,3 +574,6 @@ if { $linux_gnu } {
     run_dump_test "jr-to-b-1"
     run_dump_test "jr-to-b-2"
 }
+
+# MIPS16 and microMIPS interlinking test.
+run_dump_test "mips16-and-micromips"