aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunQiang Su <yunqiang.su@cipunited.com>2023-11-15 10:57:48 +0000
committerNick Clifton <nickc@redhat.com>2023-11-15 10:57:48 +0000
commit42fb2f0b0978305e218a9493cde92447583771f1 (patch)
tree0a5571de3ed2f1a62b09a79e90f94c32d9fa582b
parent80f90d95e3978bb13b267ddd0f3d73f8ed82ec0b (diff)
downloadgdb-42fb2f0b0978305e218a9493cde92447583771f1.zip
gdb-42fb2f0b0978305e218a9493cde92447583771f1.tar.gz
gdb-42fb2f0b0978305e218a9493cde92447583771f1.tar.bz2
MIPS: Fix Irix gas testcases about pdr section
* testsuite/gas/elf/elf.exp (section2): Add -mpdr option to assembler command line for mips-irix targets. * testsuite/gas/mips/elf-rel26.d: Add -mpdr command line option. * testsuite/gas/mips/mips16-e.d: Likewise. * testsuite/gas/mips/mips16-f.d: Likewise. * testsuite/gas/mips/mips16-hilo-match.d: Likewise. * testsuite/gas/mips/mips16-e-irix.d: Likewise. * testsuite/gas/mips/call-nonpic-1.d: Adjust regexp to allow for mips-irix targets. * testsuite/gas/mips/irix-no-pdr.d: New test file. * testsuite/gas/mips/mips.exp: Run new test for mips-irix targets.
-rw-r--r--gas/ChangeLog15
-rw-r--r--gas/testsuite/gas/elf/elf.exp4
-rw-r--r--gas/testsuite/gas/mips/call-nonpic-1.d2
-rw-r--r--gas/testsuite/gas/mips/elf-rel26.d2
-rw-r--r--gas/testsuite/gas/mips/irix-no-pdr.d8
-rw-r--r--gas/testsuite/gas/mips/mips.exp6
-rw-r--r--gas/testsuite/gas/mips/mips16-e-irix.d4
-rw-r--r--gas/testsuite/gas/mips/mips16-e.d2
-rw-r--r--gas/testsuite/gas/mips/mips16-f.d2
-rw-r--r--gas/testsuite/gas/mips/mips16-hilo-match.d2
10 files changed, 40 insertions, 7 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 230a4a7..61d3e3a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,18 @@
+2023-11-15 YunQiang Su <yunqiang.su@cipunited.com>
+
+ * testsuite/gas/elf/elf.exp (section2): Add -mpdr option to
+ assembler command line for mips-irix targets.
+ * testsuite/gas/mips/elf-rel26.d: Add -mpdr command line option.
+ * testsuite/gas/mips/mips16-e.d: Likewise.
+ * testsuite/gas/mips/mips16-f.d: Likewise.
+ * testsuite/gas/mips/mips16-hilo-match.d: Likewise.
+ * testsuite/gas/mips/mips16-e-irix.d: Likewise.
+ * testsuite/gas/mips/call-nonpic-1.d: Adjust regexp to allow for
+ mips-irix targets.
+ * testsuite/gas/mips/irix-no-pdr.d: New test file.
+ * testsuite/gas/mips/mips.exp: Run new test for mips-irix
+ targets.
+
2023-10-30 Jose E. Marchesi <jose.marchesi@oracle.com>
* testsuite/gas/bpf/alu-pseudoc.s: Add test to make sure C-like
diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp
index c42cef8..d85fddd 100644
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -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" ""
}
diff --git a/gas/testsuite/gas/mips/call-nonpic-1.d b/gas/testsuite/gas/mips/call-nonpic-1.d
index cd1b442..9d772e0 100644
--- a/gas/testsuite/gas/mips/call-nonpic-1.d
+++ b/gas/testsuite/gas/mips/call-nonpic-1.d
@@ -2,7 +2,7 @@
#objdump: -pdr
.*
-private flags = 10001004: .*
+private flags = 1000.004: .*
MIPS ABI Flags Version: 0
diff --git a/gas/testsuite/gas/mips/elf-rel26.d b/gas/testsuite/gas/mips/elf-rel26.d
index aeb4e16..71fbe83 100644
--- a/gas/testsuite/gas/mips/elf-rel26.d
+++ b/gas/testsuite/gas/mips/elf-rel26.d
@@ -1,4 +1,4 @@
-#as: -mips32 -32 -EL -KPIC
+#as: -mips32 -32 -EL -KPIC -mpdr
#readelf: --relocs
#name: MIPS ELF reloc 26
diff --git a/gas/testsuite/gas/mips/irix-no-pdr.d b/gas/testsuite/gas/mips/irix-no-pdr.d
new file mode 100644
index 0000000..7268e02
--- /dev/null
+++ b/gas/testsuite/gas/mips/irix-no-pdr.d
@@ -0,0 +1,8 @@
+#objdump: -rst
+#name: Irix has no .pdr section
+#as: -32 -mips32
+#source: sync.s
+
+#failif
+.*\.pdr.*
+#pass
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 86753e5..dd52d5a 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -2168,4 +2168,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"
+ }
}
diff --git a/gas/testsuite/gas/mips/mips16-e-irix.d b/gas/testsuite/gas/mips/mips16-e-irix.d
index 52459cb..6070bc7 100644
--- a/gas/testsuite/gas/mips/mips16-e-irix.d
+++ b/gas/testsuite/gas/mips/mips16-e-irix.d
@@ -1,6 +1,6 @@
#objdump: -rst --special-syms -mips16
#name: MIPS16 reloc
-#as: -32 -mips16
+#as: -32 -mips16 -mpdr
#source: mips16-e.s
# The Irix 5 and 6 assemblers set the type of any common symbol and
@@ -21,7 +21,7 @@ SYMBOL TABLE:
0+0000000 l d \.(mdebug|pdr) 0+0000000 \.mdebug|\.pdr
0+0000000 l d \.gnu\.attributes 0+0000000 \.gnu\.attributes
0+0000002 l \.text 0+0000000 0xf0 l1
-0+0000004 l \.text 0+0000000 0xf0 \.L11
+0+0000004 l \.text 0+0000000 0xf0 \.L.*
0+0000000 O \*UND\* 0+0000000 g1
diff --git a/gas/testsuite/gas/mips/mips16-e.d b/gas/testsuite/gas/mips/mips16-e.d
index d64b882..0f954e8 100644
--- a/gas/testsuite/gas/mips/mips16-e.d
+++ b/gas/testsuite/gas/mips/mips16-e.d
@@ -1,6 +1,6 @@
#objdump: -rst --special-syms -mips16
#name: MIPS16 reloc
-#as: -32 -mips16
+#as: -32 -mips16 -mips1 -mpdr
# Check MIPS16 reloc processing
diff --git a/gas/testsuite/gas/mips/mips16-f.d b/gas/testsuite/gas/mips/mips16-f.d
index 9605b6f..0ed246c 100644
--- a/gas/testsuite/gas/mips/mips16-f.d
+++ b/gas/testsuite/gas/mips/mips16-f.d
@@ -1,6 +1,6 @@
#objdump: -rst -mips16
#name: MIPS16 reloc 2
-#as: -32 -mips16
+#as: -32 -mips16 -mips32 -mpdr
# Check MIPS16 reloc processing
diff --git a/gas/testsuite/gas/mips/mips16-hilo-match.d b/gas/testsuite/gas/mips/mips16-hilo-match.d
index 76ad7b3..7b42f69 100644
--- a/gas/testsuite/gas/mips/mips16-hilo-match.d
+++ b/gas/testsuite/gas/mips/mips16-hilo-match.d
@@ -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.*