From cb81e84c72933a7fad10b75b7e270d92d8d65251 Mon Sep 17 00:00:00 2001 From: YunQiang Su Date: Wed, 10 May 2023 21:22:41 +0800 Subject: 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 --- ld/testsuite/ld-elf/eh5.d | 50 ++++++++++++++++------------- ld/testsuite/ld-elf/group.ld | 2 +- ld/testsuite/ld-elf/orphan-region.ld | 2 +- ld/testsuite/ld-elf/orphan.ld | 2 +- ld/testsuite/ld-mips-elf/compact-eh6.d | 6 ++-- ld/testsuite/ld-mips-elf/got-dump-1.d | 22 ++++++------- ld/testsuite/ld-mips-elf/got-page-1.ld | 2 +- ld/testsuite/ld-mips-elf/got-page-3.d | 11 ++++--- ld/testsuite/ld-mips-elf/jaloverflow-2.d | 2 +- ld/testsuite/ld-mips-elf/jalx-1.d | 10 +++--- ld/testsuite/ld-mips-elf/mips-elf.exp | 28 ++++++++++++++-- ld/testsuite/ld-mips-elf/reloc-estimate-1.d | 4 +-- ld/testsuite/ld-scripts/overlay-size.t | 2 +- ld/testsuite/ld-undefined/undefined.exp | 4 +++ 14 files changed, 89 insertions(+), 58 deletions(-) (limited to 'ld/testsuite') diff --git a/ld/testsuite/ld-elf/eh5.d b/ld/testsuite/ld-elf/eh5.d index 4a69748..3f3fd2d 100644 --- a/ld/testsuite/ld-elf/eh5.d +++ b/ld/testsuite/ld-elf/eh5.d @@ -14,7 +14,7 @@ Contents of the .eh_frame section: Code alignment factor: .* Data alignment factor: .* Return address column: .* - Augmentation data: (0b|1b) + Augmentation data: (0b|0c|1b) DW_CFA_nop DW_CFA_nop @@ -24,44 +24,44 @@ Contents of the .eh_frame section: #? DW_CFA_nop #? DW_CFA_nop -0+001[48] 0+0014 0+001[8c] FDE cie=0+0000 pc=.* +0+001[48] 0+001[4c] 0+001[8c] FDE cie=0+0000 pc=.* DW_CFA_advance_loc: 4 to .* DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop -0+00(2c|30) 0+0014 0+0000 CIE +0+00(2c|30|38) 0+0014 0+0000 CIE Version: [13] Augmentation: "zPR" Code alignment factor: .* Data alignment factor: .* Return address column: .* - Augmentation data: 03 .. .. .. .. (0b|1b) + Augmentation data: 03 .. .. .. .. (0b|0c|1b) DW_CFA_nop -0+004[48] 0+0014 0+001c FDE cie=0+00(2c|30) pc=.* +0+00(44|48|50) 0+001[4c] 0+001c FDE cie=0+00(2c|30|38) pc=.* DW_CFA_advance_loc: 4 to .* DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop -0+00(5c|60) 0+0014 0+006[04] FDE cie=0+0000 pc=.* +0+00(5c|60|70) 0+001[4c] 0+00(60|64|74) FDE cie=0+0000 pc=.* DW_CFA_advance_loc: 4 to .* DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop -0+007[48] 0+001[8c] 0+0000 CIE +0+00(74|78|90) 0+001[8c] 0+0000 CIE Version: [13] Augmentation: "zPLR" Code alignment factor: .* Data alignment factor: .* Return address column: .* - Augmentation data: 03 .. .. .. .. 0c (0b|1b) + Augmentation data: 03 .. .. .. .. 0c (0b|0c|1b) DW_CFA_nop DW_CFA_nop @@ -71,7 +71,7 @@ Contents of the .eh_frame section: #? DW_CFA_nop #? DW_CFA_nop -0+009[08] 0+001c 0+002[04] FDE cie=0+007[48] pc=.* +0+00(90|98|b0) 0+00(1c|24) 0+002[04] FDE cie=0+00(74|78|90) pc=.* Augmentation data: (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef) DW_CFA_advance_loc: 4 to .* @@ -80,13 +80,13 @@ Contents of the .eh_frame section: DW_CFA_nop DW_CFA_nop -0+00b[08] 0+001[04] 0+0000 CIE +0+00(b0|b8|d8) 0+001[04] 0+0000 CIE Version: [13] Augmentation: "zR" Code alignment factor: .* Data alignment factor: .* Return address column: .* - Augmentation data: (0b|1b) + Augmentation data: (0b|0c|1b) DW_CFA_def_cfa: r0(.*) ofs 16 #? DW_CFA_nop @@ -94,7 +94,7 @@ Contents of the .eh_frame section: #? DW_CFA_nop #? DW_CFA_nop -0+00(c4|d0) 0+001[04] 0+001[8c] FDE cie=0+00b[08] pc=.* +0+00(c4|d0|f0) 0+001[048] 0+001[8c] FDE cie=0+00(b0|b8|d8) pc=.* DW_CFA_nop DW_CFA_nop DW_CFA_nop @@ -103,24 +103,28 @@ Contents of the .eh_frame section: #? DW_CFA_nop #? DW_CFA_nop -0+00[de]8 0+0014 0+0000 CIE +0+0(0d8|0e8|10c) 0+001[48] 0+0000 CIE Version: [13] Augmentation: "zPR" Code alignment factor: .* Data alignment factor: .* Return address column: .* - Augmentation data: 03 .. .. .. .. (0b|1b) + Augmentation data: 03 .. .. .. .. (0b|0c|1b) DW_CFA_nop +#? DW_CFA_nop +#? DW_CFA_nop +#? DW_CFA_nop +#? DW_CFA_nop -0+0(0f|10)0 0+0014 0+001c FDE cie=0+00[de]8 pc=.* +0+0(0f0|100|128) 0+001[4c] 0+00(1c|20) FDE cie=0+0(0d8|0e8|10c) pc=.* DW_CFA_advance_loc: 4 to .* DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop -0+01[01]8 0+001[04] 0+00(5c|64) FDE cie=0+00b[08] pc=.* +0+01[014]8 0+001[048] 0+00(5c|64|74) FDE cie=0+00(b0|b8|d8) pc=.* DW_CFA_nop DW_CFA_nop DW_CFA_nop @@ -129,13 +133,13 @@ Contents of the .eh_frame section: #? DW_CFA_nop #? DW_CFA_nop -0+01(1c|30) 0+001[8c] 0+0000 CIE +0+0(11c|130|164) 0+001[8c] 0+0000 CIE Version: [13] Augmentation: "zPLR" Code alignment factor: .* Data alignment factor: .* Return address column: .* - Augmentation data: 03 .. .. .. .. 0c (0b|1b) + Augmentation data: 03 .. .. .. .. 0c (0b|0c|1b) DW_CFA_nop DW_CFA_nop @@ -145,7 +149,7 @@ Contents of the .eh_frame section: #? DW_CFA_nop #? DW_CFA_nop -0+01(38|50) 0+001c 0+002[04] FDE cie=0+01(1c|30) pc=.* +0+01(38|50|80) 0+00(1c|24|2c) 0+002[04] FDE cie=0+01(1c|30|64) pc=.* Augmentation data: (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef) DW_CFA_advance_loc: 4 to .* @@ -154,7 +158,7 @@ Contents of the .eh_frame section: DW_CFA_nop DW_CFA_nop -0+01(58|70) 0+0014 0+01(5c|74) FDE cie=0+0000 pc=.* +0+01(58|70|a8) 0+001[4c] 0+01(5c|74|ac) FDE cie=0+0000 pc=.* DW_CFA_advance_loc: 4 to .* DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop @@ -170,14 +174,14 @@ Contents of the .eh_frame section: #? Augmentation data: 03 .. .. .. .. 1b #? DW_CFA_nop -0+01(70|88) 0+0014 0+0(01c|148|15c) FDE cie=0+0(02c|030|170) pc=.* +0+01(70|88|c8) 0+001[4c] 0+0(01c|148|15c|194) FDE cie=0+0(02c|030|038|170|188) pc=.* DW_CFA_advance_loc: 4 to .* DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop DW_CFA_nop DW_CFA_nop -0+01(88|a0) 0+0014 0+01(8c|a4) FDE cie=0+0000 pc=.* +0+01(88|a0|e8) 0+001[4c] 0+01(8c|a4|ec) FDE cie=0+0000 pc=.* DW_CFA_advance_loc: 4 to .* DW_CFA_def_cfa: r0(.*) ofs 16 DW_CFA_nop @@ -195,7 +199,7 @@ Contents of the .eh_frame section: #? DW_CFA_nop #? DW_CFA_nop -0+01(a0|b8|d4) 0+001c 0+0(020|130|144) FDE cie=0+0(074|078|1b8) pc=.* +0+0(1a0|1b8|1d4|208) 0+00(1c|24) 0+0(020|130|144|17c) FDE cie=0+0(074|078|090|1b8) pc=.* Augmentation data: (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef) DW_CFA_advance_loc: 4 to .* diff --git a/ld/testsuite/ld-elf/group.ld b/ld/testsuite/ld-elf/group.ld index 53e2790..1c561b6 100644 --- a/ld/testsuite/ld-elf/group.ld +++ b/ld/testsuite/ld-elf/group.ld @@ -8,5 +8,5 @@ SECTIONS { . = 0x1000; .text : { *(.text) *(.rodata.brlt) } :image :header - /DISCARD/ : { *(.dropme) *(.reginfo) *(.MIPS.abiflags) } + /DISCARD/ : { *(.dropme) *(.reginfo) *(.MIPS.abiflags) *(.MIPS.options) } } diff --git a/ld/testsuite/ld-elf/orphan-region.ld b/ld/testsuite/ld-elf/orphan-region.ld index 71834df..f4f7e18 100644 --- a/ld/testsuite/ld-elf/orphan-region.ld +++ b/ld/testsuite/ld-elf/orphan-region.ld @@ -7,5 +7,5 @@ SECTIONS { .text : ALIGN (4) { *(.text) } > region .rodata : ALIGN (4) { *(.rodata) } > region - /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.trampolines) *(.riscv.attributes) } + /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.MIPS.options) *(.trampolines) *(.riscv.attributes) } } diff --git a/ld/testsuite/ld-elf/orphan.ld b/ld/testsuite/ld-elf/orphan.ld index 8b5015e..86c0b89 100644 --- a/ld/testsuite/ld-elf/orphan.ld +++ b/ld/testsuite/ld-elf/orphan.ld @@ -6,5 +6,5 @@ SECTIONS .bss : { *(.bss) *(COMMON) } .sbss : { *(.sbss) } .note : { *(.note) } - /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.trampolines) } + /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.MIPS.options) *(.trampolines) } } diff --git a/ld/testsuite/ld-mips-elf/compact-eh6.d b/ld/testsuite/ld-mips-elf/compact-eh6.d index e81285a..66b21b1 100644 --- a/ld/testsuite/ld-mips-elf/compact-eh6.d +++ b/ld/testsuite/ld-mips-elf/compact-eh6.d @@ -8,6 +8,6 @@ Hex dump of section \'\.eh_frame_hdr\': - 0x[0-9a-f]+ 021b0000 00000005 ffffff[0-9a-f]+ 00000060.* - 0x[0-9a-f]+ ffffff[0-9a-f]+ 015d5d01 ffffff[0-9a-f]+ 00000029.* - 0x[0-9a-f]+ ffffff[0-9a-f]+ 00000035 ffffff[0-9a-f]+ 015d5d01.* + 0x[0-9a-f]+ 021b0000 00000005 ffffff[0-9a-f]+ 0000006[08].* + 0x[0-9a-f]+ ffffff[0-9a-f]+ 015d5d01 ffffff[0-9a-f]+ 0000002[9d].* + 0x[0-9a-f]+ ffffff[0-9a-f]+ 0000003[59] ffffff[0-9a-f]+ 015d5d01.* diff --git a/ld/testsuite/ld-mips-elf/got-dump-1.d b/ld/testsuite/ld-mips-elf/got-dump-1.d index b14adff..00c976c 100644 --- a/ld/testsuite/ld-mips-elf/got-dump-1.d +++ b/ld/testsuite/ld-mips-elf/got-dump-1.d @@ -5,21 +5,21 @@ #readelf: -A Primary GOT: - Canonical gp value: 00068000 + Canonical gp value: 0+068000 Reserved entries: - Address Access Initial Purpose - 00060010 -32752\(gp\) 00000000 Lazy resolver - 00060014 -32748\(gp\) 80000000 Module pointer \(GNU extension\) + * Address * Access * Initial Purpose + 0+060010 -32752\(gp\) 0+000000 Lazy resolver + 0+06001[48] -3274[48]\(gp\) 8000000+ Module pointer \(GNU extension\) Local entries: - Address Access Initial - 00060018 -32744\(gp\) 00060000 - 0006001c -32740\(gp\) 00060004 + * Address * Access * Initial + 0+0600(18|20) -327(44|36)\(gp\) 0+060000 + 0+0600(1c|28) -327(40|28)\(gp\) 0+060004 Global entries: - Address Access Initial Sym.Val. Type Ndx Name - 00060020 -32736\(gp\) 00050020 00050020 FUNC UND extern - 00060024 -32732\(gp\) 00050000 00050000 FUNC 7 glob - 00060028 -32728\(gp\) 00000000 00000000 NOTYPE UND undef + * Address * Access * Initial * Sym.Val. Type * Ndx Name + 0+0600(2|3)0 -327(36|20)\(gp\) 0+050020 0+050020 FUNC UND extern + 0+0600(24|38) -327(32|12)\(gp\) 0+050000 0+050000 FUNC 7 glob + 0+0600(28|40) -327(28|04)\(gp\) 0+000000 0+000000 NOTYPE UND undef diff --git a/ld/testsuite/ld-mips-elf/got-page-1.ld b/ld/testsuite/ld-mips-elf/got-page-1.ld index cfe7c1f..b87abbf 100644 --- a/ld/testsuite/ld-mips-elf/got-page-1.ld +++ b/ld/testsuite/ld-mips-elf/got-page-1.ld @@ -22,7 +22,7 @@ SECTIONS . = ALIGN (0x400); .bss : { *(.bss .bss.*) } - /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) } + /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.MIPS.options) } } VERSION diff --git a/ld/testsuite/ld-mips-elf/got-page-3.d b/ld/testsuite/ld-mips-elf/got-page-3.d index 913b0c9..430dd22 100644 --- a/ld/testsuite/ld-mips-elf/got-page-3.d +++ b/ld/testsuite/ld-mips-elf/got-page-3.d @@ -5,6 +5,7 @@ #as: -mips3 #ld: -T got-page-1.ld -shared #objdump: -dr +#xfail: mips*64*-linux-gnuabi64 # # got-page-3a.s and got-page-3b.s should get assigned the same GOT, # with a page estimate of 10. Thus the first page entry has offset @@ -15,12 +16,12 @@ # The first global symbol should therefore be at offset -32744. # #... -.* lw a0,-32744\(gp\) -.* addiu a0,a0,.* + *.* lw a0,-32744\(gp\) + *.* addiu a0,a0,.* #... -.* lw a1,-32704\(gp\) + *.* lw a1,-32704\(gp\) #... -.* : + *.* : #... -.* lw a1,-32744\(gp\) + *.* lw a1,-32744\(gp\) #pass diff --git a/ld/testsuite/ld-mips-elf/jaloverflow-2.d b/ld/testsuite/ld-mips-elf/jaloverflow-2.d index b40f428..bff776e 100644 --- a/ld/testsuite/ld-mips-elf/jaloverflow-2.d +++ b/ld/testsuite/ld-mips-elf/jaloverflow-2.d @@ -4,5 +4,5 @@ #ld: -Ttext=0x20000000 -e start #objdump: -dr #... -0*20000000: 0c000000.* + *0*20000000: 0c000000.* #pass diff --git a/ld/testsuite/ld-mips-elf/jalx-1.d b/ld/testsuite/ld-mips-elf/jalx-1.d index 80c3be2..37cad5d 100644 --- a/ld/testsuite/ld-mips-elf/jalx-1.d +++ b/ld/testsuite/ld-mips-elf/jalx-1.d @@ -7,10 +7,10 @@ Disassembly of section \.text: -88000000 : -88000000: f200 0002 jalx 88000008 -88000004: 0000 0000 nop +0*88000000 : + *88000000: f200 0002 jalx 88000008 + *88000004: 0000 0000 nop -88000008 : -88000008: 00851821 addu v1,a0,a1 +0*88000008 : + *88000008: 00851821 addu v1,a0,a1 \.\.\. diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp index ff9635e..ee0522b 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf.exp @@ -182,6 +182,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) "-64 -march=from-abi" + 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" @@ -892,7 +911,8 @@ if { $linux_gnu } { } run_dump_test "got-dump-1" run_dump_test_n64 "got-dump-2" noarch - run_dump_test "reloc-estimate-1" + run_dump_test_n32 "reloc-estimate-1" + run_dump_test_o32 "reloc-estimate-1" } run_dump_test_n32 "emit-relocs-1" {{as -EB} {ld -EB}} @@ -1080,7 +1100,8 @@ if { $has_abi(o32) } { run_ld_link_tests $mips16_intermix_test } -run_dump_test "mips16-local-stubs-1" +run_dump_test_o32 "mips16-local-stubs-1" +run_dump_test_n32 "mips16-local-stubs-1" set mips16_fp_stub_test [list \ [list "Floating-point stub for mips16 functions" \ @@ -1106,7 +1127,8 @@ foreach firstfpabi [list 4 5 6 7 ] { } foreach firstfpabi [list 0 1 2 3 ] { foreach secondfpabi [list 0 1 2 3 8 9] { - run_dump_test "attr-gnu-4-${firstfpabi}${secondfpabi}" + run_dump_test_o32 "attr-gnu-4-${firstfpabi}${secondfpabi}" + run_dump_test_n32 "attr-gnu-4-${firstfpabi}${secondfpabi}" } } diff --git a/ld/testsuite/ld-mips-elf/reloc-estimate-1.d b/ld/testsuite/ld-mips-elf/reloc-estimate-1.d index fcca55a..fa536f9 100644 --- a/ld/testsuite/ld-mips-elf/reloc-estimate-1.d +++ b/ld/testsuite/ld-mips-elf/reloc-estimate-1.d @@ -8,8 +8,8 @@ DYNAMIC RELOCATION RECORDS OFFSET +TYPE +VALUE -00000000 R_MIPS_NONE \*ABS\* -00010000 R_MIPS_REL32 foo@@V2 +0+000000 R_MIPS_NONE \*ABS\* +0+010000 R_MIPS_REL32 foo@@V2 # The address must be 0x810. We should only ever allocate one dynamic diff --git a/ld/testsuite/ld-scripts/overlay-size.t b/ld/testsuite/ld-scripts/overlay-size.t index 68c0986..452e97c 100644 --- a/ld/testsuite/ld-scripts/overlay-size.t +++ b/ld/testsuite/ld-scripts/overlay-size.t @@ -60,5 +60,5 @@ SECTIONS end_of_data_overlays = . ; . = 0x8000; - /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) } + /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.MIPS.options) } } diff --git a/ld/testsuite/ld-undefined/undefined.exp b/ld/testsuite/ld-undefined/undefined.exp index 69a8f9b..1e7b05b 100644 --- a/ld/testsuite/ld-undefined/undefined.exp +++ b/ld/testsuite/ld-undefined/undefined.exp @@ -210,6 +210,10 @@ if { ![is_elf_format] || ![check_shared_lib_support]} then { set none_count 6 set reloc_count 4 } + "mips*64*-linux-gnuabi64" { + set none_count 6 + set reloc_count 4 + } "mips*" - "score*" { set none_count 1 -- cgit v1.1