aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2004-04-08 00:51:37 +0000
committerAlan Modra <amodra@gmail.com>2004-04-08 00:51:37 +0000
commit76cb62b0033357959af72bc655811e63f3c017e2 (patch)
treedaf1752a9196d41e1591e9b59ae743992dc8e7d3 /ld/testsuite
parent343d4b76f9654dca24592b2e765f4a4b64428ac9 (diff)
downloadgdb-76cb62b0033357959af72bc655811e63f3c017e2.zip
gdb-76cb62b0033357959af72bc655811e63f3c017e2.tar.gz
gdb-76cb62b0033357959af72bc655811e63f3c017e2.tar.bz2
* ld-scripts/align.exp: Don't run on aix.
* ld-scripts/assert.s: Remove comment. * ld-scripts/data.s: Likewise. * ld-scripts/data.t: Set start address to allow for aout headers. Make first LONG pc-relative. * ld-scripts/data.d: Update. * ld-scripts/defined2.d: Allow other random syms. * ld-scripts/defined3.d: Likewise. * ld-scripts/provide-1.s: Pad section. * ld-scripts/provide-1.t: Set .data address and align. * ld-scripts/provide-1.d: Update. * ld-scripts/provide-2.s: Pad section. * ld-scripts/provide-2.d: Allow random trailing syms. * ld-scripts/provide-3.s: Pad section. * ld-scripts/provide-3.d: Fix typos. * ld-scripts/provide.exp: Don't run on aix. * ld-scripts/size-1.s: Simplify test. * ld-scripts/size-1.t: Rewrite. * ld-scripts/size-1.d: Update. * ld-scripts/size-2.s: Simplify. * ld-scripts/size-2.t: Set start address. Set exe flag on image. * ld-scripts/size-2.d: Update. * ld-scripts/size.exp: Don't run on aix. Run size-2 on all elf targets except mips.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog27
-rw-r--r--ld/testsuite/ld-scripts/align.exp5
-rw-r--r--ld/testsuite/ld-scripts/assert.s1
-rw-r--r--ld/testsuite/ld-scripts/data.d2
-rw-r--r--ld/testsuite/ld-scripts/data.s1
-rw-r--r--ld/testsuite/ld-scripts/data.t5
-rw-r--r--ld/testsuite/ld-scripts/defined2.d3
-rw-r--r--ld/testsuite/ld-scripts/defined3.d9
-rw-r--r--ld/testsuite/ld-scripts/provide-1.d3
-rw-r--r--ld/testsuite/ld-scripts/provide-1.s1
-rw-r--r--ld/testsuite/ld-scripts/provide-1.t3
-rw-r--r--ld/testsuite/ld-scripts/provide-2.d2
-rw-r--r--ld/testsuite/ld-scripts/provide-2.s2
-rw-r--r--ld/testsuite/ld-scripts/provide-3.d4
-rw-r--r--ld/testsuite/ld-scripts/provide-3.s1
-rw-r--r--ld/testsuite/ld-scripts/provide.exp5
-rw-r--r--ld/testsuite/ld-scripts/size-1.d15
-rw-r--r--ld/testsuite/ld-scripts/size-1.s16
-rw-r--r--ld/testsuite/ld-scripts/size-1.t13
-rw-r--r--ld/testsuite/ld-scripts/size-2.d17
-rw-r--r--ld/testsuite/ld-scripts/size-2.s7
-rw-r--r--ld/testsuite/ld-scripts/size-2.t4
-rw-r--r--ld/testsuite/ld-scripts/size.exp16
23 files changed, 104 insertions, 58 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index a44d6f8..2dafdbd 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,30 @@
+2004-04-08 Alan Modra <amodra@bigpond.net.au>
+
+ * ld-scripts/align.exp: Don't run on aix.
+ * ld-scripts/assert.s: Remove comment.
+ * ld-scripts/data.s: Likewise.
+ * ld-scripts/data.t: Set start address to allow for aout headers.
+ Make first LONG pc-relative.
+ * ld-scripts/data.d: Update.
+ * ld-scripts/defined2.d: Allow other random syms.
+ * ld-scripts/defined3.d: Likewise.
+ * ld-scripts/provide-1.s: Pad section.
+ * ld-scripts/provide-1.t: Set .data address and align.
+ * ld-scripts/provide-1.d: Update.
+ * ld-scripts/provide-2.s: Pad section.
+ * ld-scripts/provide-2.d: Allow random trailing syms.
+ * ld-scripts/provide-3.s: Pad section.
+ * ld-scripts/provide-3.d: Fix typos.
+ * ld-scripts/provide.exp: Don't run on aix.
+ * ld-scripts/size-1.s: Simplify test.
+ * ld-scripts/size-1.t: Rewrite.
+ * ld-scripts/size-1.d: Update.
+ * ld-scripts/size-2.s: Simplify.
+ * ld-scripts/size-2.t: Set start address. Set exe flag on image.
+ * ld-scripts/size-2.d: Update.
+ * ld-scripts/size.exp: Don't run on aix. Run size-2 on all elf
+ targets except mips.
+
2004-03-27 Alexandre Oliva <aoliva@redhat.com>
* ld-frv/fdpic*.d: Adjust to compensate for page size change.
diff --git a/ld/testsuite/ld-scripts/align.exp b/ld/testsuite/ld-scripts/align.exp
index 3959e6d..f7664ca 100644
--- a/ld/testsuite/ld-scripts/align.exp
+++ b/ld/testsuite/ld-scripts/align.exp
@@ -17,6 +17,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+if [istarget "rs6000-*-aix*"] {
+ # Target maps .text and .data to other sections.
+ return
+}
+
set testname "ALIGN"
if ![ld_assemble $as $srcdir/$subdir/align.s tmpdir/align.o] {
diff --git a/ld/testsuite/ld-scripts/assert.s b/ld/testsuite/ld-scripts/assert.s
index 0517ffe..e69de29 100644
--- a/ld/testsuite/ld-scripts/assert.s
+++ b/ld/testsuite/ld-scripts/assert.s
@@ -1 +0,0 @@
-#nothing here
diff --git a/ld/testsuite/ld-scripts/data.d b/ld/testsuite/ld-scripts/data.d
index 83d6142..10b3d08 100644
--- a/ld/testsuite/ld-scripts/data.d
+++ b/ld/testsuite/ld-scripts/data.d
@@ -5,5 +5,5 @@
.*: file format .*
Contents of section .text:
- 1000 (0410)?0000(1004)? (0020)?0000(2000)? .*
+ [0-9a-f]* (04)?000000(04)? (0020)?0000(2000)? .*
#pass
diff --git a/ld/testsuite/ld-scripts/data.s b/ld/testsuite/ld-scripts/data.s
index 0517ffe..e69de29 100644
--- a/ld/testsuite/ld-scripts/data.s
+++ b/ld/testsuite/ld-scripts/data.s
@@ -1 +0,0 @@
-#nothing here
diff --git a/ld/testsuite/ld-scripts/data.t b/ld/testsuite/ld-scripts/data.t
index 8ee3d41..f56d10f 100644
--- a/ld/testsuite/ld-scripts/data.t
+++ b/ld/testsuite/ld-scripts/data.t
@@ -1,8 +1,9 @@
SECTIONS
{
- .text 0x1000 :
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x20) :
{
- LONG (label)
+ LONG (label - .)
label = .;
LONG (ADDR (.other))
}
diff --git a/ld/testsuite/ld-scripts/defined2.d b/ld/testsuite/ld-scripts/defined2.d
index 6bb0682..6e6e068 100644
--- a/ld/testsuite/ld-scripts/defined2.d
+++ b/ld/testsuite/ld-scripts/defined2.d
@@ -10,8 +10,11 @@
#...
0+1 [AT] defined1
+#...
0+11 A defined2
+#...
0+100 A defined3
+#...
0+1ff A defined4
#...
0+3 T sym1
diff --git a/ld/testsuite/ld-scripts/defined3.d b/ld/testsuite/ld-scripts/defined3.d
index 1a7946d..0b3831c 100644
--- a/ld/testsuite/ld-scripts/defined3.d
+++ b/ld/testsuite/ld-scripts/defined3.d
@@ -11,15 +11,24 @@
#...
0+1 [AT] defined
+#...
0+200 A defined1
+#...
0+201 A defined2
+#...
0+100 A defined3
+#...
0+ [AT] defined4
+#...
0+2a A defined5
+#...
0+ [AT] defined6
+#...
0+1 [AT] defined7
+#...
0+1 [AT] defined8
#...
0+2a A sym1
+#...
[0-9a-f]+ T sym2
#pass
diff --git a/ld/testsuite/ld-scripts/provide-1.d b/ld/testsuite/ld-scripts/provide-1.d
index bec3982..ac8719a 100644
--- a/ld/testsuite/ld-scripts/provide-1.d
+++ b/ld/testsuite/ld-scripts/provide-1.d
@@ -5,4 +5,5 @@
.*: file format .*
Contents of section .data:
- 0000 (08)?000000(08)? (0c)?000000(0c)? 00000000 ............
+ [0-9a-f]* (1020)?0000(2010)? (2020)?0000(2020)? 00000000 .*
+#pass
diff --git a/ld/testsuite/ld-scripts/provide-1.s b/ld/testsuite/ld-scripts/provide-1.s
index 6395f3a..1e33540 100644
--- a/ld/testsuite/ld-scripts/provide-1.s
+++ b/ld/testsuite/ld-scripts/provide-1.s
@@ -1,3 +1,4 @@
.data
.globl foo
foo: .long 0
+ .p2align 4
diff --git a/ld/testsuite/ld-scripts/provide-1.t b/ld/testsuite/ld-scripts/provide-1.t
index dd30956..6b96b33 100644
--- a/ld/testsuite/ld-scripts/provide-1.t
+++ b/ld/testsuite/ld-scripts/provide-1.t
@@ -1,9 +1,10 @@
SECTIONS
{
- .data :
+ .data 0x2000 :
{
LONG (foo)
LONG (bar)
+ . = ALIGN (0x10);
*(.data)
}
PROVIDE (foo = .);
diff --git a/ld/testsuite/ld-scripts/provide-2.d b/ld/testsuite/ld-scripts/provide-2.d
index fd13b86..f8bd0cf 100644
--- a/ld/testsuite/ld-scripts/provide-2.d
+++ b/ld/testsuite/ld-scripts/provide-2.d
@@ -4,4 +4,4 @@
#...
0+3 A baz
0+0 D foo
-
+#pass
diff --git a/ld/testsuite/ld-scripts/provide-2.s b/ld/testsuite/ld-scripts/provide-2.s
index 6fa93e4..f9138db 100644
--- a/ld/testsuite/ld-scripts/provide-2.s
+++ b/ld/testsuite/ld-scripts/provide-2.s
@@ -4,3 +4,5 @@ foo: .long 0
.globl baz
.long baz
+
+ .p2align 4
diff --git a/ld/testsuite/ld-scripts/provide-3.d b/ld/testsuite/ld-scripts/provide-3.d
index 1ee38e3..c8b12da 100644
--- a/ld/testsuite/ld-scripts/provide-3.d
+++ b/ld/testsuite/ld-scripts/provide-3.d
@@ -1,3 +1,3 @@
-#source: provide-2.s
-#ld: -T provide-2.t
+#source: provide-3.s
+#ld: -T provide-3.t
#error: symbol defined in linker script and object file
diff --git a/ld/testsuite/ld-scripts/provide-3.s b/ld/testsuite/ld-scripts/provide-3.s
index 6395f3a..1e33540 100644
--- a/ld/testsuite/ld-scripts/provide-3.s
+++ b/ld/testsuite/ld-scripts/provide-3.s
@@ -1,3 +1,4 @@
.data
.globl foo
foo: .long 0
+ .p2align 4
diff --git a/ld/testsuite/ld-scripts/provide.exp b/ld/testsuite/ld-scripts/provide.exp
index 0092674..4e34501 100644
--- a/ld/testsuite/ld-scripts/provide.exp
+++ b/ld/testsuite/ld-scripts/provide.exp
@@ -17,6 +17,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+if [istarget "rs6000-*-aix*"] {
+ # Target maps .text and .data to other sections.
+ return
+}
+
set testname "provide"
run_dump_test provide-1
diff --git a/ld/testsuite/ld-scripts/size-1.d b/ld/testsuite/ld-scripts/size-1.d
index 8f36407..641fbca 100644
--- a/ld/testsuite/ld-scripts/size-1.d
+++ b/ld/testsuite/ld-scripts/size-1.d
@@ -6,16 +6,9 @@
#...
Contents of section \.text:
- 0+00 (01)?000000(01)? (02)?000000(02)? ........
+ [0-9a-f]* (01)?000000(01)? (02)?000000(02)? .*
#...
Contents of section \.data:
- 0+08 (03)?000000(03)? (04)?000000(04)? (05)?000000(05)? ............
-#...
-Contents of section \.tdata:
- 0+24 (06)?000000(06)? (07)?000000(07)? (08)?000000(08)? (09)?000000(09)? ................
- 0+34 (0a)?000000(0a)? ....
-#...
-Contents of section \.map:
- 0+38 (08)?000000(08)? (0c)?000000(0c)? (10)?000000(10)? (14)?000000(14)? ................
- 0+48 (18)?000000(18)? ....
-#...
+ [0-9a-f]* (03)?000000(03)? (04)?000000(04)? (05)?000000(05)? 00000000 .*
+ [0-9a-f]* (20)?000000(20)? (18)?000000(18)? .*
+#pass
diff --git a/ld/testsuite/ld-scripts/size-1.s b/ld/testsuite/ld-scripts/size-1.s
index 53721fa..7f5a5fd 100644
--- a/ld/testsuite/ld-scripts/size-1.s
+++ b/ld/testsuite/ld-scripts/size-1.s
@@ -1,15 +1,7 @@
- .section .text,"ax",@progbits
+ .text
.long 1,2
+ .p2align 5
- .section .data,"aw",@progbits
+ .data
.long 3,4,5
-
- .section .bss,"aw",@nobits
- .long 0,0,0,0
-
- # thread local storage sections
- .section .tdata,"awT",@progbits
- .long 6,7,8,9,10
-
- .section .tbss,"awT",@nobits
- .long 0,0,0,0,0,0
+ .p2align 4
diff --git a/ld/testsuite/ld-scripts/size-1.t b/ld/testsuite/ld-scripts/size-1.t
index 8582840..bb48665 100644
--- a/ld/testsuite/ld-scripts/size-1.t
+++ b/ld/testsuite/ld-scripts/size-1.t
@@ -1,15 +1,10 @@
SECTIONS
{
- .text : { *(.text) }
- .data : { *(.data) }
- .bss : { *(.bss) }
- .tdata : { *(.tdata) }
- .tbss : { *(.tbss) }
- .map : {
+ . = 0x1000 + SIZEOF_HEADERS;
+ .text ALIGN (0x20) : { *(.text) }
+ .data 0x2000 : {
+ *(.data)
LONG (SIZEOF (.text))
LONG (SIZEOF (.data))
- LONG (SIZEOF (.bss))
- LONG (SIZEOF (.tdata))
- LONG (SIZEOF (.tbss))
}
}
diff --git a/ld/testsuite/ld-scripts/size-2.d b/ld/testsuite/ld-scripts/size-2.d
index 8b56c7a..dfcc3e4 100644
--- a/ld/testsuite/ld-scripts/size-2.d
+++ b/ld/testsuite/ld-scripts/size-2.d
@@ -4,13 +4,14 @@
#...
Program Headers:
- Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
- PHDR 0x[0-9a-f]+ 0x0+0000 0x0+0000 0x[0-9a-f]+ 0x[0-9a-f]+ R 0x[0-9a-f]+
- LOAD 0x[0-9a-f]+ 0x0+0000 0x0+0000 0x0+0030 0x0+0030 R 0x[0-9a-f]+
- TLS 0x[0-9a-f]+ 0x0+0008 0x0+0008 0x0+0014 0x0+002c R 0x[0-9a-f]+
+ +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg +Align
+ +PHDR +0x[0-9a-f]+ 0x0+0000 0x0+0000 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x[0-9a-f]+
+#...
+ +LOAD +0x[0-9a-f]+ 0x0+0100 0x0+0100 0x0+0030 0x0+0030 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 \.text \.tdata \.tbss \.map
- 01 \.text \.tdata \.map
- 02 \.tdata \.tbss \.map
+ +Segment Sections\.\.\.
+ +00 .*
+ +01 +\.text \.tdata \.map
+ +02 +\.tdata \.tbss \.map
diff --git a/ld/testsuite/ld-scripts/size-2.s b/ld/testsuite/ld-scripts/size-2.s
index eba3224..6b10250 100644
--- a/ld/testsuite/ld-scripts/size-2.s
+++ b/ld/testsuite/ld-scripts/size-2.s
@@ -1,9 +1,8 @@
- .section .text,"ax",@progbits
+ .text
.long 1,2
- # thread local storage sections
- .section .tdata,"awT",@progbits
+ .section .tdata
.long 6,7,8,9,10
- .section .tbss,"awT",@nobits
+ .section .tbss
.long 0,0,0,0,0,0
diff --git a/ld/testsuite/ld-scripts/size-2.t b/ld/testsuite/ld-scripts/size-2.t
index 3549321..e67b3fa 100644
--- a/ld/testsuite/ld-scripts/size-2.t
+++ b/ld/testsuite/ld-scripts/size-2.t
@@ -2,13 +2,13 @@ PHDRS
{
header PT_PHDR FILEHDR PHDRS ;
- image PT_LOAD FLAGS (4);
+ image PT_LOAD FLAGS (5);
tls PT_TLS FLAGS (4);
}
SECTIONS
{
- .text : { *(.text) } :image
+ .text 0x100 : { *(.text) } :image
.tdata : { *(.tdata) } :image :tls
.tbss : { *(.tbss) } :image : tls
.map : {
diff --git a/ld/testsuite/ld-scripts/size.exp b/ld/testsuite/ld-scripts/size.exp
index 5fff2bd..42e4e47 100644
--- a/ld/testsuite/ld-scripts/size.exp
+++ b/ld/testsuite/ld-scripts/size.exp
@@ -16,8 +16,20 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
+if [istarget "rs6000-*-aix*"] {
+ # Target maps .text and .data to other sections.
+ return
+}
+
run_dump_test size-1
-if { [istarget "*-*-elf*"] } {
- run_dump_test size-2
+if ![is_elf_format] {
+ return
}
+
+if [istarget "mips*-*-*"] {
+ # MIPS inserts a REGINFO PHDR
+ return
+}
+
+run_dump_test size-2