MIPS: Fix Irix gas testcases about pdr section
Checks
Commit Message
1. Add -mpdr option to cases, which expect .pdr section existing.
Gas doesn't generate .pdr section for Irix objects by default.
See `int mips_flag_pdr` in tc-mips.c.
Add -mpdr into #as section:
mips/mips16-e.d, mips/mips16-f.d
mips/elf-rel26.d, mips16-hilo-match;
Add -mpdr if target is mips*-*-irix*:
elf/elf.exp.
2. Add irix-no-pdr.d testcase to make sure no .pdr section is
generated for Irix by default.
---
gas/testsuite/gas/elf/elf.exp | 4 ++++
gas/testsuite/gas/mips/elf-rel26.d | 2 +-
gas/testsuite/gas/mips/irix-no-pdr.d | 8 ++++++++
gas/testsuite/gas/mips/mips.exp | 7 ++++++-
gas/testsuite/gas/mips/mips16-e.d | 2 +-
gas/testsuite/gas/mips/mips16-f.d | 2 +-
gas/testsuite/gas/mips/mips16-hilo-match.d | 2 +-
7 files changed, 22 insertions(+), 5 deletions(-)
create mode 100644 gas/testsuite/gas/mips/irix-no-pdr.d
@@ -208,6 +208,10 @@ if { [is_elf_format] } then {
riscv*-*-* {
set as_flags "$as_flags -march-attr"
}
+ mips*-*-irix* {
+ # Irix has no pdr section by default.
+ set as_flags "$as_flags -mpdr"
+ }
}
run_elf_list_test "section2" "$target_machine" "$as_flags" "-s" ""
}
@@ -1,4 +1,4 @@
-#as: -mips32 -32 -EL -KPIC
+#as: -mips32 -32 -EL -KPIC -mpdr
#readelf: --relocs
#name: MIPS ELF reloc 26
new file mode 100644
@@ -0,0 +1,8 @@
+#objdump: -rst
+#name: Irix has no .pdr section
+#as: -32 -mips32
+#source: sync.s
+
+#failif
+.*\.pdr.*
+#pass
@@ -1545,7 +1545,6 @@ if { [istarget mips*-*-vxworks*] } {
[mips_arch_list_matching mips1 !singlefloat]
run_dump_test "mips16-vis-1"
- run_dump_test "call-nonpic-1"
run_dump_test "mips32-sync"
run_dump_test_arches "mips32r2-sync" [lsort -dictionary -unique [concat \
[mips_arch_list_matching mips32r2] \
@@ -2174,4 +2173,10 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test "global-local-symtab-sort-n32${tmips}"
run_dump_test "global-local-symtab-sort-n64${tmips}"
}
+
+ # Gas doesn't generate .pdr section for Irix objects by default.
+ # See `int mips_flag_pdr` in tc-mips.c.
+ if [istarget *-*-irix*] {
+ run_dump_test "irix-no-pdr"
+ }
}
@@ -1,6 +1,6 @@
#objdump: -rst --special-syms -mips16
#name: MIPS16 reloc
-#as: -32 -mips16
+#as: -32 -mips16 -mips1 -mpdr
# Check MIPS16 reloc processing
@@ -1,6 +1,6 @@
#objdump: -rst -mips16
#name: MIPS16 reloc 2
-#as: -32 -mips16
+#as: -32 -mips16 -mips32 -mpdr
# Check MIPS16 reloc processing
@@ -1,5 +1,5 @@
#objdump: -r
-#as: -mabi=32 -march=mips1
+#as: -mabi=32 -march=mips1 -mpdr
#name: MIPS16 mips16-hilo-match
.*: +file format .*mips.*