# Expect script for MIPS ELF linker tests
-# Copyright (C) 2002-2018 Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
{{objdump -dr pic-and-nonpic-1.dd}
{readelf --symbols pic-and-nonpic-1.nd}}
"pic-and-nonpic-1-static1.o"}
+ {"PIC and non-PIC test 1 R6 compact branches (static 1)"
+ "-melf32btsmip -Tpic-and-nonpic-1.ld --compact-branches" ""
+ "-32 -EB -mips32r6" {pic-and-nonpic-1a-r6.s pic-and-nonpic-1b.s}
+ {{objdump -dr pic-and-nonpic-1-r6.dd}
+ {readelf --symbols pic-and-nonpic-1-r6.nd}}
+ "pic-and-nonpic-1-r6-static1.o"}
{"PIC and non-PIC test 1 (static 2)"
"-melf32btsmip -Tpic-and-nonpic-1.ld tmpdir/pic-and-nonpic-1-rel.o" ""
"" {}
{readelf --symbols pic-and-nonpic-3b.nd}
{readelf -d pic-and-nonpic-3b.ad}}
"pic-and-nonpic-3b"}
+ {"PIC and non-PIC test 3 R6 compact branches (shared library)"
+ "-melf32btsmip -shared --compact-branches -Tpic-and-nonpic-3a.ld" ""
+ "-32 -EB -mips32r6" {pic-and-nonpic-3a-r6.s}
+ {{readelf --segments pic-and-nonpic-3a.sd}
+ {readelf -A pic-and-nonpic-3a-r6.gd}
+ {objdump -dr pic-and-nonpic-3a-r6.dd}}
+ "pic-and-nonpic-3a-r6.so"}
}
run_dump_test_o32 "pic-and-nonpic-3-error" {noarch {as -EB} {ld -EB}}
run_ld_link_tests {
run_dump_test_n32 "emit-relocs-1" {{as -EB} {ld -EB}}
-run_dump_test "hash1a"
-run_dump_test "hash1b"
-run_dump_test "hash1c"
+run_dump_test "hash1"
+run_dump_test "hash2"
if { $linux_gnu && $has_abi(o32) } {
# The number of symbols that are always included in the symbol table
run_mips_undefweak_test "shared library (n64, microMIPS, hidden)" \
n64 dso umips hidden
}
+
+# PIC relocation acceptance tests.
+run_dump_test "pic-reloc-0"
+run_dump_test "pic-reloc-1"
+run_dump_test "pic-reloc-2"
+run_dump_test "pic-reloc-3"
+run_dump_test "pic-reloc-4"
+run_dump_test_o32 "pic-reloc-5"
+run_dump_test_o32 "pic-reloc-5" [list [list name (microMIPS)] \
+ [list as "-mmicromips"]]
+run_dump_test_o32 "pic-reloc-6"
+run_dump_test_n64 "pic-reloc-7"
+run_dump_test_n64 "pic-reloc-7" [list [list name (microMIPS)] \
+ [list as "-mmicromips"]]
+
+run_dump_test_o32 "reloc-pcrel-r6"