[2/2] MIPS: fix Irix gas testcases
Checks
Commit Message
1. add -mpdr to some cases.
gas doesn't generate .pdr section for Irix objects by default. See
`int mips_flag_pdr` in tc-mips.c.
2. disable call-nonpic-1 for Irix.
gas doesn't set O32 flags for Irix objects in e_flags. See
`use_e_mips_abi_o32` in gas/configure.ac.
3. mips16-e.d: g1 may be marked as O.
The Irix 5 and 6 assemblers set the type of any common symbol and
any undefined non-function symbol to STT_OBJECT.
See `mips_frob_symbol` in tc-mips.c.
---
gas/testsuite/gas/elf/elf.exp | 4 ++++
gas/testsuite/gas/mips/elf-rel26.d | 2 +-
gas/testsuite/gas/mips/mips.exp | 5 ++++-
gas/testsuite/gas/mips/mips16-e.d | 4 ++--
gas/testsuite/gas/mips/mips16-f.d | 2 +-
gas/testsuite/gas/mips/mips16-hilo-match.d | 2 +-
6 files changed, 13 insertions(+), 6 deletions(-)
Comments
On Mon, 5 Jun 2023, YunQiang Su wrote:
> 1. add -mpdr to some cases.
> gas doesn't generate .pdr section for Irix objects by default. See
> `int mips_flag_pdr` in tc-mips.c.
Non-PDR variants of the respective dumps need to be added then, veryfying
that PDR data is not produced where applicable. We have prior art in the
testsuite for such arrangements; cf. ${imips}. This can be reused for all
IRIX psABI targets.
> 2. disable call-nonpic-1 for Irix.
> gas doesn't set O32 flags for Irix objects in e_flags. See
> `use_e_mips_abi_o32` in gas/configure.ac.
This needs to be verified then too.
> 3. mips16-e.d: g1 may be marked as O.
> The Irix 5 and 6 assemblers set the type of any common symbol and
> any undefined non-function symbol to STT_OBJECT.
> See `mips_frob_symbol` in tc-mips.c.
This is minor enough, so probably OK. It might be worth checking if it's
covered elsewhere.
Please use correct capitalisation; in English sentences start with a
capital letter. Also use two spaces after every full stop as per the GNU
Coding Standards. This applies both to change headings/descriptions and
pieces of text included with the change proper.
Maciej
@@ -207,6 +207,10 @@ if { [is_elf_format] } then {
riscv*-*-* {
set as_flags "$as_flags -march-attr"
}
+ mips*-*-* {
+ # 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
@@ -1551,7 +1551,10 @@ if { [istarget mips*-*-vxworks*] } {
[mips_arch_list_matching mips1 !singlefloat]
run_dump_test "mips16-vis-1"
- run_dump_test "call-nonpic-1"
+ if { ![istarget *-*-irix*] } {
+ # irix sets use_e_mips_abi_o32=0. See gas/configure.ac
+ 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] \
@@ -1,6 +1,6 @@
#objdump: -rst --special-syms -mips16
#name: MIPS16 reloc
-#as: -32 -mips16 -mips32
+#as: -32 -mips16 -mips32 -mpdr
# Check MIPS16 reloc processing
@@ -17,7 +17,7 @@ SYMBOL TABLE:
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 \.L1.*1
-0+0000000 \*UND\* 0+0000000 g1
+0+0000000 [ O] \*UND\* 0+0000000 g1
RELOCATION RECORDS FOR \[foo\]:
@@ -1,6 +1,6 @@
#objdump: -rst -mips16
#name: MIPS16 reloc 2
-#as: -32 -mips16 -mips32
+#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.*