ld-elf/merge test update
authorAlan Modra <amodra@gmail.com>
Wed, 1 Feb 2023 23:19:00 +0000 (09:49 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 2 Feb 2023 03:10:14 +0000 (13:40 +1030)
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
ld/testsuite/ld-elf/merge.ld
ld/testsuite/ld-elf/merge.s
ld/testsuite/ld-elf/merge2.d
ld/testsuite/ld-elf/merge2.s
ld/testsuite/ld-elf/merge3.d
ld/testsuite/ld-elf/merge3.s

index a62711c485fce8325218acbf3306f13fccd5da18..d31b6e8f9a83dfbd92b93c7440ded51b238d3016 100644 (file)
@@ -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
index dce91bb40dbeb30e57fbe09e38b97138f678d021..6bcea50b31f682e7feec03c38985fd700adef7c7 100644 (file)
@@ -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 : { *(*) }
 }
index 1e6e0e3494f7040333fbc1afe80d62b32430b6d3..88eeebd9df99c1bac4b3d52ef0aefb59cede171f 100644 (file)
@@ -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
index 500ac770413208f4e09362faca071b8fe62bc7b2..27cc4d3d62a36626e72185d1086a7c21ec5631d3 100644 (file)
@@ -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
index 41d066ab9c78e55f23db516a3dd056a024a0fbbd..1c384b539ff7edf31f765495b679a6106b41f0b5 100644 (file)
 .LC11:
        .long   0x12345678
 
-
-       .text
-       .global _start
-_start:
+       .data
        .long   .LC0
-.LT0:
        .long   .LC1
        .long   .LC2
        .long   .LC3
index de6584ca881f3e963b497aee67f4d883d7c4f9ed..692db73609b627aedc77db2d232c6a5a97eff168 100644 (file)
@@ -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
index 9328d4dd32fe7f14abb5bc0d703bd7094f097f76..d9caa1789f459d59aed357b7cfe1822c279293c8 100644 (file)
@@ -9,9 +9,7 @@
 .LC2:
        .asciz  "01234567abcdefg"
 
-       .text
-       .global _start
-_start:
+       .data
        .long   .LC0
        .long   .LC1
        .long   .LC2