[binutils-gdb] adjust ld testsuite to accept .tbss consuming vma

Alan Modra amodra@sourceware.org
Fri Sep 4 13:45:31 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=57fbe59ab342c1deb9d36c8b0da1e679fdf57e10

commit 57fbe59ab342c1deb9d36c8b0da1e679fdf57e10
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Sep 4 22:22:31 2026 +0930

    adjust ld testsuite to accept .tbss consuming vma
    
    This is needed to fix failures on arm embedded targets.  It also
    happens to cure an hppa64-hp-hpux11.23 failure of the size-1 test due
    to .tbss being marked SHF_HP_TLS rather than SHF_TLS on that target
    and therefore not being recognised by the rest of GNU ld as a TLS
    section.  v850 passes size-1 too.  .tbss there is also not a TLS
    section.
    
            * testsuite/ld-elf/size-1.d: Don't xfail v850-elf.  Allow for
            variant .tbss that consumes vma.
            * testsuite/ld-elf/size-2.d: Allow for variant .tbss.
            * testsuite/ld-scripts/rgn-at10.d: Likewise.
            * testsuite/ld-scripts/rgn-at11.d: Likewise.

Diff:
---
 ld/testsuite/ld-elf/size-1.d       | 6 ++----
 ld/testsuite/ld-elf/size-2.d       | 7 ++++---
 ld/testsuite/ld-scripts/rgn-at10.d | 2 +-
 ld/testsuite/ld-scripts/rgn-at11.d | 2 +-
 4 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/ld/testsuite/ld-elf/size-1.d b/ld/testsuite/ld-elf/size-1.d
index 3c1e282a31d..d3dcde7a457 100644
--- a/ld/testsuite/ld-elf/size-1.d
+++ b/ld/testsuite/ld-elf/size-1.d
@@ -1,8 +1,6 @@
 #source: size-1.s
 #ld: -T size-1.t --no-warn-rwx-segments
 #objdump: -s
-# v850 .tdata/.tbss are not TLS sections
-#xfail: v850*-*-*
 
 .*:     file format .*
 
@@ -21,6 +19,6 @@ Contents of section \.tdata:
  0+90 (19)?000000(19)? (1a)?000000(1a)? (1b)?000000(1b)? (1c)?000000(1c)?  .*
 #...
 Contents of section \.map:
- 0+a0 (10)?000000(10)? (20)?000000(20)? (30)?000000(30)? (40)?000000(40)?  .*
- 0+b0 (50)?000000(50)?                             .*
+ .* (10)?000000(10)? (20)?000000(20)? (30)?000000(30)? (40)?000000(40)?  .*
+ .* (50)?000000(50)?                             .*
 #...
diff --git a/ld/testsuite/ld-elf/size-2.d b/ld/testsuite/ld-elf/size-2.d
index e3e28cf7a93..6dff5508857 100644
--- a/ld/testsuite/ld-elf/size-2.d
+++ b/ld/testsuite/ld-elf/size-2.d
@@ -5,16 +5,17 @@
 #xfail: v850*-*-*
 # The three alternatives for PHDR and LOAD are: 64-bit, 32-bit, 32-bit
 # not demand paged.  32-bit LOAD has a variant for spu-elf, which rounds
-# load size up to multiples of 16 bytes.
+# load size up to multiples of 16 bytes, and a variant for arm-elf embedded
+# targets that make .tbss consume vma.
 
 #...
 .* \.text +PROGBITS +0+100 [0-9a-f]+ 0+10 00  AX .*
 .* \.tdata +PROGBITS +0+110 [0-9a-f]+ 0+20 00 WAT .*
 .* \.tbss +NOBITS +0+130 [0-9a-f]+ 0+30 00 WAT .*
-.* \.map +PROGBITS +0+130 [0-9a-f]+ 0+c 00 +A .*
+.* \.map +PROGBITS +0+1[36]0 [0-9a-f]+ 0+c 00 +A .*
 #...
  +PHDR +(0x0+58 0x0+58 0x0+58 0x0+a8 0x0+a8|0x0+(a0|34) 0x0+a0 0x0+a0 0x0+60 0x0+60) R .*
- +LOAD +(0x0+58 0x0+58 0x0+58 0x0+e4 0x0+e4|0x0+(a0|34) 0x0+a0 0x0+a0 0x0+(9c|a0) 0x0+(9c|a0)) R E .*
+ +LOAD +(0x0+58 0x0+58 0x0+58 0x0+e4 0x0+e4|0x0+(a0|34) 0x0+a0 0x0+a0 0x0+(9c|a0|cc) 0x0+(9c|a0|cc)) R E .*
  +TLS +0x0+(110|a4) 0x0+110 0x0+110 0x0+20 0x0+50 R .*
 #...
 .* \.text \.tdata \.map 
diff --git a/ld/testsuite/ld-scripts/rgn-at10.d b/ld/testsuite/ld-scripts/rgn-at10.d
index e11597ff784..e7fa5e96b15 100644
--- a/ld/testsuite/ld-scripts/rgn-at10.d
+++ b/ld/testsuite/ld-scripts/rgn-at10.d
@@ -9,4 +9,4 @@
 #...
 .* 0+10000 +0+20000 .*
 .* 0+10100 +0+20100 .*
-.* 0+10100 +0+20100 .*
+.* (0+10100 +0+20100|0+10110 +0+20110) .*
diff --git a/ld/testsuite/ld-scripts/rgn-at11.d b/ld/testsuite/ld-scripts/rgn-at11.d
index 865cf710dc6..0fcc3732b3e 100644
--- a/ld/testsuite/ld-scripts/rgn-at11.d
+++ b/ld/testsuite/ld-scripts/rgn-at11.d
@@ -8,4 +8,4 @@
 #...
 .* 0+10000 +0+20000 .*
 .* 0+10100 +0+20010 .*
-.* 0+10100 +0+20010 .*
+.* (0+10100|0+10110) +0+20010 .*


More information about the Binutils-cvs mailing list