]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
MIPS: Fix Irix gas testcases about pdr section
authorYunQiang Su <yunqiang.su@cipunited.com>
Wed, 15 Nov 2023 10:57:48 +0000 (10:57 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 15 Nov 2023 10:57:48 +0000 (10:57 +0000)
  * 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.

gas/ChangeLog
gas/testsuite/gas/elf/elf.exp
gas/testsuite/gas/mips/call-nonpic-1.d
gas/testsuite/gas/mips/elf-rel26.d
gas/testsuite/gas/mips/irix-no-pdr.d [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp
gas/testsuite/gas/mips/mips16-e-irix.d
gas/testsuite/gas/mips/mips16-e.d
gas/testsuite/gas/mips/mips16-f.d
gas/testsuite/gas/mips/mips16-hilo-match.d

index 230a4a73039dbfefb99f0ea726daed8c71cb8b1f..61d3e3ae940fced170ca7631be58a94e7c2c9be9 100644 (file)
@@ -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
index c42cef8160e3063bff74f526d9c166881843b9f7..d85fdddc841626b0a86b5faeaa854624a93ff6b1 100644 (file)
@@ -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" ""
     }
index cd1b4423445f6719a5b67faeac99ffad29219e34..9d772e0b4e91f7216cdb63593d57feb1bd5cf2f4 100644 (file)
@@ -2,7 +2,7 @@
 #objdump: -pdr
 
 .*
-private flags = 10001004: .*
+private flags = 1000.004: .*
 
 MIPS ABI Flags Version: 0
 
index aeb4e16d178282670607cb9ab17334b4e5adb89a..71fbe83d4b6d4ecabecf6fdf92d923185042ab13 100644 (file)
@@ -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 (file)
index 0000000..7268e02
--- /dev/null
@@ -0,0 +1,8 @@
+#objdump: -rst
+#name: Irix has no .pdr section
+#as: -32 -mips32
+#source: sync.s
+
+#failif
+.*\.pdr.*
+#pass
index 86753e57b79c80dc0894812eaeb07cacb03c6f8f..dd52d5a9a6789746858e5fe84cfe82276667cbc7 100644 (file)
@@ -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"
+    }
 }
index 52459cb97f7dfb32ec815a941a69983d3ba53248..6070bc71c095d414bc7c1c43172403966c8332df 100644 (file)
@@ -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
 
 
index d64b882c81cfc8a3f92eed9a189c9b73e4c74f5b..0f954e8e25c2971684d9e435aa162d31507f4f34 100644 (file)
@@ -1,6 +1,6 @@
 #objdump: -rst --special-syms -mips16
 #name: MIPS16 reloc
-#as: -32 -mips16
+#as: -32 -mips16 -mips1 -mpdr
 
 # Check MIPS16 reloc processing
 
index 9605b6f183ea95dc2ed903a569f502a05af977f2..0ed246cfbba717bb80ba9b1e6467fa77f8c407ed 100644 (file)
@@ -1,6 +1,6 @@
 #objdump: -rst -mips16
 #name: MIPS16 reloc 2
-#as: -32 -mips16
+#as: -32 -mips16 -mips32 -mpdr
 
 # Check MIPS16 reloc processing
 
index 76ad7b39cdd648eaf108b27ce5661608b5a7a448..7b42f6946c124314651c92e798c0e01106578a2d 100644 (file)
@@ -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.*