Move ld-scripts size tests

Also restore them somewhat closer to the original.  They originally
failed on many targets, and a month later I "simplified" them as part
of a larger patch fixing other failing tests.  That unfortunately lost
their main purpose, which was to test TLS layout.

	* testsuite/ld-elf/size-1.d,
	* testsuite/ld-elf/size-1.s,
	* testsuite/ld-elf/size-1.t: New test.
	* testsuite/ld-elf/size-2.d,
	* testsuite/ld-elf/size-2.s,
	* testsuite/ld-elf/size-2.t: New test.
	* testsuite/ld-scripts/size-1.d,
	* testsuite/ld-scripts/size-1.s,
	* testsuite/ld-scripts/size-1.t,
	* testsuite/ld-scripts/size-2.s,
	* testsuite/ld-scripts/size-2.d,
	* testsuite/ld-scripts/size-2.t,
	* testsuite/ld-scripts/size.exp: Delete.
This commit is contained in:
Alan Modra 2019-07-23 17:45:25 +09:30
parent acea835faa
commit ec49711a16
13 changed files with 104 additions and 101 deletions

View File

@ -1,3 +1,19 @@
2019-07-23 Alan Modra <amodra@gmail.com>
* testsuite/ld-elf/size-1.d,
* testsuite/ld-elf/size-1.s,
* testsuite/ld-elf/size-1.t: New test.
* testsuite/ld-elf/size-2.d,
* testsuite/ld-elf/size-2.s,
* testsuite/ld-elf/size-2.t: New test.
* testsuite/ld-scripts/size-1.d,
* testsuite/ld-scripts/size-1.s,
* testsuite/ld-scripts/size-1.t,
* testsuite/ld-scripts/size-2.s,
* testsuite/ld-scripts/size-2.d,
* testsuite/ld-scripts/size-2.t,
* testsuite/ld-scripts/size.exp: Delete.
2019-07-22 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
* ld/testsuite/ld-arm/cmse_main_sec_debug.d: Modify regexps to

View File

@ -0,0 +1,26 @@
#source: size-1.s
#ld: -T size-1.t
#objdump: -s
# v850 .tdata/.tbss are not TLS sections
#xfail: v850*-*-*
.*: file format .*
#...
Contents of section \.text:
0+00 (01)?000000(01)? (02)?000000(02)? (03)?000000(03)? (04)?000000(04)? .*
#...
Contents of section \.data:
0+10 (05)?000000(05)? (06)?000000(06)? (07)?000000(07)? (08)?000000(08)? .*
0+20 (09)?000000(09)? (0a)?000000(0a)? (0b)?000000(0b)? (0c)?000000(0c)? .*
#...
Contents of section \.tdata:
0+60 (0d)?000000(0d)? (0e)?000000(0e)? (0f)?000000(0f)? (10)?000000(10)? .*
0+70 (11)?000000(11)? (12)?000000(12)? (13)?000000(13)? (14)?000000(14)? .*
0+80 (15)?000000(15)? (16)?000000(16)? (17)?000000(17)? (18)?000000(18)? .*
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)? .*
#...

View File

@ -0,0 +1,15 @@
.text
.long 1,2,3,4
.data
.long 5,6,7,8,9,10,11,12
.section .bss
.long 0,0,0,0,0,0,0,0,0,0,0,0
# thread local storage sections
.section .tdata
.long 13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
.section .tbss
.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

View File

@ -0,0 +1,16 @@
SECTIONS
{
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss) }
.tdata : { *(.tdata) }
.tbss : { *(.tbss) }
.map : {
LONG (SIZEOF (.text))
LONG (SIZEOF (.data))
LONG (SIZEOF (.bss))
LONG (SIZEOF (.tdata))
LONG (SIZEOF (.tbss))
}
/DISCARD/ : { *(*) }
}

View File

@ -0,0 +1,21 @@
#source: size-2.s
#ld: -T size-2.t
#readelf: -lS --wide
# v850 .tdata/.tbss are not TLS sections
#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.
#...
.* \.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 +WA .*
#...
+PHDR +(0x0+40 0x0+40 0x0+40 0x0+a8 0x0+a8|0x0+34 0x0+34 0x0+34 0x0+60 0x0+60|0x0+34 0x0+a0 0x0+a0 0x0+60 0x0+60) R .*
+LOAD +(0x0+40 0x0+40 0x0+40 0x0+fc 0x0+fc|0x0+34 0x0+34 0x0+34 0x0+1(08|10) 0x0+1(08|10)|0x0+34 0x0+a0 0x0+a0 0x0+9c 0x0+9c) R E .*
+TLS +0x0+(110|a4) 0x0+110 0x0+110 0x0+20 0x0+50 R .*
#...
.* \.text \.tdata \.map
.* \.tdata \.tbss

View File

@ -0,0 +1,9 @@
.text
.long 1,2,3,4
# thread local storage sections
.section .tdata
.long 5,6,7,8,9,10,11,12
.section .tbss
.long 0,0,0,0,0,0,0,0,0,0,0,0

View File

@ -13,10 +13,8 @@ SECTIONS
.tbss : { *(.tbss) } :image : tls
.map : {
LONG (SIZEOF (.text))
LONG (SIZEOF (.data))
LONG (SIZEOF (.bss))
LONG (SIZEOF (.tdata))
LONG (SIZEOF (.tbss))
} :image
/DISCARD/ : { *(.note.gnu.property) }
/DISCARD/ : { *(*) }
}

View File

@ -1,14 +0,0 @@
#source: size-1.s
#ld: -T size-1.t
#objdump: -s
.*: file format .*
#...
Contents of section \.text:
[0-9a-f]* (01)?000000(01)? (02)?000000(02)? .*
#...
Contents of section \.data:
[0-9a-f]* (03)?000000(03)? (04)?000000(04)? (05)?000000(05)? 00000000 .*
[0-9a-f]* (20)?000000(20)? (18)?000000(18)? .*
#pass

View File

@ -1,7 +0,0 @@
.text
.long 1,2
.p2align 5
.data
.long 3,4,5
.p2align 4

View File

@ -1,10 +0,0 @@
SECTIONS
{
. = 0x1000 + SIZEOF_HEADERS;
.text ALIGN (0x20) : { *(.text) }
.data 0x2000 : {
*(.data)
LONG (SIZEOF (.text))
LONG (SIZEOF (.data))
}
}

View File

@ -1,18 +0,0 @@
#source: size-2.s
#ld: -T size-2.t
#readelf: -l --wide
#xfail: "v850*-*-*"
#...
Program Headers:
+Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg +Align
+PHDR +0x[0-9a-f]+ 0x0+00.. 0x0+00.. 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x[0-9a-f]+
#...
+LOAD +0x[0-9a-f]+ 0x0+0... 0x0+0... 0x0+0... 0x0+0... R E +0x[0-9a-f]+
+TLS +0x[0-9a-f]+ 0x0+0108 0x0+0108 0x0+0014 0x0+002c R +0x[0-9a-f]+
Section to Segment mapping:
+Segment Sections\.\.\.
+00 .*
+01.*\.text.*\.tdata.*
+02.*\.tdata.*

View File

@ -1,8 +0,0 @@
.text
.long 1,2
.section .tdata
.long 6,7,8,9,10
.section .tbss
.long 0,0,0,0,0,0

View File

@ -1,41 +0,0 @@
# Expect script for SIZEOF tests
# Copyright (C) 2004-2019 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# AIX maps .text and .data to other sections.
# a.out objdump displays the file header inside the text segment,
# confusing run_dump_test.
if {[istarget "powerpc*-*-aix*"] || [istarget "rs6000-*-aix*"] || [is_aout_format]} {
unsupported size-1
unsupported size-2
return
}
run_dump_test size-1
# size-2 only works on ELF targets.
# MIPS inserts a REGINFO PHDR
if {![is_elf_format] || [istarget "mips*-*-*"]} {
unsupported size-2
return
}
run_dump_test size-2