From 0709900ede7dcb0c77d40a0c2403d2921afa18c3 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 2 Feb 2023 09:49:00 +1030 Subject: [PATCH] ld-elf/merge test update The merge test fais on numerous targets because they don't support the necessary pc-relative relocs. This patch removes that part of the merge test, and makes references to the merged strings from .data rather than .text to better support targets that relax text by default. --- ld/testsuite/ld-elf/merge.d | 13 +++++-------- ld/testsuite/ld-elf/merge.ld | 5 +++-- ld/testsuite/ld-elf/merge.s | 10 ++++------ ld/testsuite/ld-elf/merge2.d | 15 ++++++++------- ld/testsuite/ld-elf/merge2.s | 6 +----- ld/testsuite/ld-elf/merge3.d | 9 +++++---- ld/testsuite/ld-elf/merge3.s | 4 +--- 7 files changed, 27 insertions(+), 35 deletions(-) diff --git a/ld/testsuite/ld-elf/merge.d b/ld/testsuite/ld-elf/merge.d index a62711c485f..d31b6e8f9a8 100644 --- a/ld/testsuite/ld-elf/merge.d +++ b/ld/testsuite/ld-elf/merge.d @@ -1,16 +1,13 @@ #source: merge.s #ld: -T merge.ld #objdump: -s -#xfail: bfin-*-* cr16-*-* cris*-*-* crx-*-* d10v-*-* d30v-*-* dlx-*-* -#xfail: fr30-*-* frv-*-* ft32-*-* h8300-*-* hppa*64*-*-* ip2k-*-* iq2000-*-* -#xfail: lm32-*-* m68hc11-*-* mcore-*-* mep-*-* metag-*-* mn102*-*-* moxie-*-* -#xfail: mt-*-* nds32*-*-* nios2-*-* pj-*-* pru-*-* s12z-*-* score-*-* -#xfail: tic6x-*-* vax-*-* xgate-*-* xstormy16-*-* xtensa*-*-* +#xfail: [is_generic] hppa64-*-* ip2k-*-* nds32*-*-* .*: file format .*elf.* -Contents of section .text: - 1000 (1010)?0000(1010)? (1210)?0000(1012)? (0c)?000000(0c)? (0e)?000000(0e)? .* Contents of section .rodata: - 1010 61626300 .* + 1100 61626300 .* + +Contents of section .data: + 1200 (0011)?0000(1100)? (0211)?0000(1102)? (04)?000000(04)? (02)?000000(02)? .* #pass diff --git a/ld/testsuite/ld-elf/merge.ld b/ld/testsuite/ld-elf/merge.ld index dce91bb40db..6bcea50b31f 100644 --- a/ld/testsuite/ld-elf/merge.ld +++ b/ld/testsuite/ld-elf/merge.ld @@ -1,7 +1,8 @@ SECTIONS { - . = 0x1000; - .text : { *(.text .text.* .gnu.linkonce.t.*) } + . = 0x1100; .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } + . = 0x1200; + .data : { *(.data .data.* .gnu.linkonce.d.*) } .junk : { *(*) } } diff --git a/ld/testsuite/ld-elf/merge.s b/ld/testsuite/ld-elf/merge.s index 1e6e0e3494f..88eeebd9df9 100644 --- a/ld/testsuite/ld-elf/merge.s +++ b/ld/testsuite/ld-elf/merge.s @@ -3,12 +3,10 @@ .asciz "abc" .LC1: .asciz "c" +.LC2: - .text - .global _start -_start: + .data .long .LC0 -.LT0: .long .LC1 - .long .LC0-.LT0 - .long .LC1-.LT0 + .long .LC1-.LC0 + .long .LC2-.LC1 diff --git a/ld/testsuite/ld-elf/merge2.d b/ld/testsuite/ld-elf/merge2.d index 500ac770413..27cc4d3d62a 100644 --- a/ld/testsuite/ld-elf/merge2.d +++ b/ld/testsuite/ld-elf/merge2.d @@ -5,12 +5,13 @@ .*: file format .*elf.* -Contents of section .text: - 1000 (3010)?0000(1030)? (3210)?0000(1032)? (3110)?0000(1031)? (3410)?0000(1034)? .* - 1010 (4010)?0000(1040)? (3810)?0000(1038)? (4810)?0000(1048)? (3c10)?0000(103c)? .* - 1020 (5010)?0000(1050)? (5410)?0000(1054)? (5810)?0000(1058)? (5010)?0000(1050)? .* Contents of section .rodata: - 1030 61626300 62000000 (78563412|12345678) 99999999 .* - 1040 (78563412|12345678) 00000000 99999999 00000000 .* - 1050 (78563412|12345678) 99999999 00000000 .* + 1100 61626300 62000000 (78563412|12345678) 99999999 .* + 1110 (78563412|12345678) 00000000 99999999 00000000 .* + 1120 (78563412|12345678) 99999999 00000000 .* + +Contents of section .data: + 1200 (0011)?0000(1100)? (0211)?0000(1102)? (0111)?0000(1101)? (0411)?0000(1104)? .* + 1210 (1011)?0000(1110)? (0811)?0000(1108)? (1811)?0000(1118)? (0c11)?0000(110c)? .* + 1220 (2011)?0000(1120)? (2411)?0000(1124)? (2811)?0000(1128)? (2011)?0000(1120)? .* #pass diff --git a/ld/testsuite/ld-elf/merge2.s b/ld/testsuite/ld-elf/merge2.s index 41d066ab9c7..1c384b539ff 100644 --- a/ld/testsuite/ld-elf/merge2.s +++ b/ld/testsuite/ld-elf/merge2.s @@ -39,12 +39,8 @@ .LC11: .long 0x12345678 - - .text - .global _start -_start: + .data .long .LC0 -.LT0: .long .LC1 .long .LC2 .long .LC3 diff --git a/ld/testsuite/ld-elf/merge3.d b/ld/testsuite/ld-elf/merge3.d index de6584ca881..692db73609b 100644 --- a/ld/testsuite/ld-elf/merge3.d +++ b/ld/testsuite/ld-elf/merge3.d @@ -5,9 +5,10 @@ .*: file format .*elf.* -Contents of section \.text: - 1000 (20100000|00001020) (10100000|00001010) (18100000|00001018) .* Contents of section \.rodata: - 1010 64656667 00000000 30313233 34353637 defg....01234567 - 1020 61626364 65666700 abcdefg. + 1100 64656667 00000000 30313233 34353637 defg....01234567 + 1110 61626364 65666700 abcdefg. + +Contents of section \.data: + 1200 (10110000|00001110) (00110000|00001100) (08110000|00001108) .* #pass diff --git a/ld/testsuite/ld-elf/merge3.s b/ld/testsuite/ld-elf/merge3.s index 9328d4dd32f..d9caa1789f4 100644 --- a/ld/testsuite/ld-elf/merge3.s +++ b/ld/testsuite/ld-elf/merge3.s @@ -9,9 +9,7 @@ .LC2: .asciz "01234567abcdefg" - .text - .global _start -_start: + .data .long .LC0 .long .LC1 .long .LC2 -- 2.30.2