From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: ld-elf/merge test update
Date: Thu, 2 Feb 2023 13:39:51 +1030 [thread overview]
Message-ID: <Y9spf1UfzfEL5hKO@squeak.grove.modra.org> (raw)
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.
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
--
Alan Modra
Australia Development Lab, IBM
reply other threads:[~2023-02-02 3:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y9spf1UfzfEL5hKO@squeak.grove.modra.org \
--to=amodra@gmail.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).