aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorYunQiang Su <yunqiang.su@cipunited.com>2023-05-10 21:22:41 +0800
committerYunQiang Su <yunqiang.su@cipunited.com>2023-06-05 11:00:15 +0800
commitcb81e84c72933a7fad10b75b7e270d92d8d65251 (patch)
tree164fe3a2e1f66a0a1ac49327bd465aff68ead0ea /binutils
parentffc528aed56b9e2c171137da28690a9bb6861b0b (diff)
downloadbinutils-cb81e84c72933a7fad10b75b7e270d92d8d65251.zip
binutils-cb81e84c72933a7fad10b75b7e270d92d8d65251.tar.gz
binutils-cb81e84c72933a7fad10b75b7e270d92d8d65251.tar.bz2
MIPS: fix -gnuabi64 testsuite
Test on: mips64-linux-gnuabi64 mips64el-linux-gnuabi64 mipsisa64-linux-gnuabi64 mipsisa64el-linux-gnuabi64 mipsisa64r2-linux-gnuabi64 mipsisa64r2el-linux-gnuabi64 mipsisa64r6-linux-gnuabi64 mipsisa64r6el-linux-gnuabi64
Diffstat (limited to 'binutils')
-rw-r--r--binutils/testsuite/binutils-all/mips/mips.exp19
-rw-r--r--binutils/testsuite/binutils-all/objcopy.exp2
-rw-r--r--binutils/testsuite/binutils-all/readelf.r-642
-rw-r--r--binutils/testsuite/binutils-all/readelf.s-6410
-rw-r--r--binutils/testsuite/binutils-all/remove-relocs-01.d2
-rw-r--r--binutils/testsuite/binutils-all/remove-relocs-04.d2
-rw-r--r--binutils/testsuite/binutils-all/remove-relocs-05.d2
-rw-r--r--binutils/testsuite/binutils-all/remove-relocs-06.d2
-rw-r--r--binutils/testsuite/binutils-all/strip-3.d2
9 files changed, 32 insertions, 11 deletions
diff --git a/binutils/testsuite/binutils-all/mips/mips.exp b/binutils/testsuite/binutils-all/mips/mips.exp
index 3b7bc29..bd2a2f7 100644
--- a/binutils/testsuite/binutils-all/mips/mips.exp
+++ b/binutils/testsuite/binutils-all/mips/mips.exp
@@ -152,6 +152,25 @@ set abi_ldflags(eabi) ""
# Override as needed.
if {[istarget *-*-openbsd*] } {
set irixemul 0
+} elseif { [istarget mips*64*-*-linux*-gnuabi64] } {
+ set abi_asflags(o32) -32
+ set abi_asflags(o32l) "-32 -march=from-abi"
+ set abi_asflags(n32) "-n32"
+ set abi_asflags(n32l) "-n32 -march=from-abi"
+ set abi_asflags(n64) ""
+ set abi_asflags(n64l) "-march=from-abi -64"
+ if [istarget *el-*-*] {
+ set abi_ldflags(o32) -melf32ltsmip
+ set abi_ldflags(o32l) -melf32ltsmip
+ set abi_ldflags(n32) -melf32ltsmipn32
+ set abi_ldflags(n32l) -melf32ltsmipn32
+ } else {
+ set abi_ldflags(o32) -melf32btsmip
+ set abi_ldflags(o32l) -melf32btsmip
+ set abi_ldflags(n32) -melf32btsmipn32
+ set abi_ldflags(n32l) -melf32btsmipn32
+ }
+ set irixemul 0
} elseif { [istarget mips*64*-*-linux*] } {
set abi_asflags(o32) -32
set abi_asflags(o32l) "-32 -march=from-abi"
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 361e430..f6d4d1b 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -1269,7 +1269,7 @@ if [is_elf_format] {
run_dump_test "strip-9"
run_dump_test "strip-12"
- if { [istarget "mips64*-*-openbsd*"] } {
+ if { [istarget "mips64*-*-openbsd*"] || [istarget "mips*64*-linux-gnuabi64"] } {
set reloc_format mips64
}
# A relocation type not supported by any target
diff --git a/binutils/testsuite/binutils-all/readelf.r-64 b/binutils/testsuite/binutils-all/readelf.r-64
index e7487f1..7f850d9 100644
--- a/binutils/testsuite/binutils-all/readelf.r-64
+++ b/binutils/testsuite/binutils-all/readelf.r-64
@@ -2,3 +2,5 @@
Relocation section '.rel.*text' at offset 0x.* contains 1 entry:
Offset Info Type Sym. Value Sym. Name.*
0+04 [0-9A-Fa-f]+ *R_.*0+00 external_symbol.*
+#?.*R_MIPS_NONE.*
+#?.*R_MIPS_NONE.*
diff --git a/binutils/testsuite/binutils-all/readelf.s-64 b/binutils/testsuite/binutils-all/readelf.s-64
index e0037a5..380a9c1 100644
--- a/binutils/testsuite/binutils-all/readelf.s-64
+++ b/binutils/testsuite/binutils-all/readelf.s-64
@@ -10,8 +10,8 @@ Section Headers:
+\[ 2\] .rel.+text +REL. +0+ +0+.*
+000000000000001. +000000000000001. +I +. +1 +8
+\[ 3\] .data +PROGBITS +0000000000000000 +000000(48|50)
- +000000000000000[48] +0000000000000000 +WA +0 +0 +.*
- +\[ 4\] .bss +NOBITS +0000000000000000 +000000(4c|50|54|58|68)
+ +00000000000000(04|08|10) +0000000000000000 +WA +0 +0 +.*
+ +\[ 4\] .bss +NOBITS +0000000000000000 +000000(4c|50|54|58|60|68)
+0000000000000000 +0000000000000000 +WA +0 +0 +.*
# x86 targets may put .note.gnu.property here.
# riscv targets put .riscv.attributes here.
@@ -20,10 +20,10 @@ Section Headers:
# aarch64-elf targets have one more data symbol.
# x86 targets may have .note.gnu.property.
# riscv targets have two more symbols, data symbol and .riscv.attributes.
- +0+.* +0000000000000018 +(6|7) +(3|4|5) +8
- +\[ .\] .strtab +STRTAB +0000000000000000 +0+.*
+ +0+.* +0000000000000(018|180) +(6|7|10) +(3|4|5|10) +8
+ +\[..\] .strtab +STRTAB +0000000000000000 +0+.*
+0+.* +0000000000000000 .* +0 +0 +1
- +\[ .\] .shstrtab +STRTAB +0000000000000000 +[0-9a-f]+
+ +\[..\] .shstrtab +STRTAB +0000000000000000 +[0-9a-f]+
+00000000000000.. +0000000000000000 .* +0 +0 +.*
Key to Flags:
#...
diff --git a/binutils/testsuite/binutils-all/remove-relocs-01.d b/binutils/testsuite/binutils-all/remove-relocs-01.d
index 702747b..abef16f 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-01.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-01.d
@@ -2,7 +2,7 @@
#source: remove-relocs-01.s
#objcopy: --remove-relocations=.data.relocs.01
#readelf: -r
-#notarget: "mips64*-*-openbsd*"
+#notarget: "mips64*-*-openbsd*" "mips*64*-*-linux-gnuabi64"
Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
.*
diff --git a/binutils/testsuite/binutils-all/remove-relocs-04.d b/binutils/testsuite/binutils-all/remove-relocs-04.d
index 1b8eab3..ce63f50 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-04.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-04.d
@@ -2,7 +2,7 @@
#source: remove-relocs-01.s
#objcopy: --remove-relocations=.data.relocs.0\[12\]
#readelf: -r
-#notarget: "mips64*-*-openbsd*"
+#notarget: "mips64*-*-openbsd*" "mips*64*-linux-gnuabi64"
Relocation section '\.rela?\.data\.relocs\.03' at offset 0x[0-9a-f]+ contains 3 entries:
.*
diff --git a/binutils/testsuite/binutils-all/remove-relocs-05.d b/binutils/testsuite/binutils-all/remove-relocs-05.d
index a429182..a74c573 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-05.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-05.d
@@ -2,7 +2,7 @@
#source: remove-relocs-01.s
#objcopy: --remove-section=.rela.data.relocs.01 --remove-section=.rel.data.relocs.01
#readelf: -r
-#notarget: "mips64*-*-openbsd*"
+#notarget: "mips64*-*-openbsd*" "mips*64*-linux-gnuabi64"
Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
.*
diff --git a/binutils/testsuite/binutils-all/remove-relocs-06.d b/binutils/testsuite/binutils-all/remove-relocs-06.d
index 5214bc7..53c47b5 100644
--- a/binutils/testsuite/binutils-all/remove-relocs-06.d
+++ b/binutils/testsuite/binutils-all/remove-relocs-06.d
@@ -2,7 +2,7 @@
#source: remove-relocs-01.s
#objcopy: --remove-relocations=.data.relocs.* --remove-relocations=!.data.relocs.02
#readelf: -r
-#notarget: "mips64*-*-openbsd*"
+#notarget: "mips64*-*-openbsd*" "mips*64*-linux-gnuabi64"
Relocation section '\.rela?\.data\.relocs\.02' at offset 0x[0-9a-f]+ contains 3 entries:
.*
diff --git a/binutils/testsuite/binutils-all/strip-3.d b/binutils/testsuite/binutils-all/strip-3.d
index cb2f78e..89c75ae 100644
--- a/binutils/testsuite/binutils-all/strip-3.d
+++ b/binutils/testsuite/binutils-all/strip-3.d
@@ -1,6 +1,6 @@
#PROG: strip
#source: empty.s
-#strip: -R .text -R .data -R .bss -R .ARM.attributes -R .reginfo -R .gnu.attributes -R .MIPS.abiflags -R .pdr -R .xtensa.info -R .ARC.attributes -R .note.gnu.property -R .riscv.attributes -R .csky.attributes
+#strip: -R .text -R .data -R .bss -R .ARM.attributes -R .reginfo -R .gnu.attributes -R .MIPS.abiflags -R .MIPS.options -R .pdr -R .xtensa.info -R .ARC.attributes -R .note.gnu.property -R .riscv.attributes -R .csky.attributes
#readelf: -S --wide
#name: strip empty file
#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi