1
From e7e85a106013644ff9270931fdcd0ca32e37a465 Mon Sep 17 00:00:00 2001
2
From: H.J. Lu <hjl.tools@gmail.com>
3
Date: Tue, 28 Dec 2010 18:04:10 +0000
4
Subject: [PATCH] Add testcases for PR ld/12327.
6
2010-12-28 H.J. Lu <hongjiu.lu@intel.com>
9
* ld-scripts/defined4.d: New.
10
* ld-scripts/defined4.s: Likewise.
11
* ld-scripts/defined4.t: Likewise.
12
* ld-scripts/expr2.d: Likewise.
13
* ld-scripts/expr2.s: Likewise.
14
* ld-scripts/expr2.t: Likewise.
16
* ld-scripts/defined.exp: Run defined4.
18
* ld-scripts/expr.exp: Run expr2.
20
2010-12-30 Sedat Dilek <sedat.dilek@gmail.com>
22
* Cherry-picked commit cd1915cc656c7d80b808e916a75abf250c514364
23
* Drop changes in history of ld/testsuite/ChangeLog
24
(as wished by Matthias Klose)
26
ld/testsuite/ld-scripts/defined.exp | 3 ++-
27
ld/testsuite/ld-scripts/defined4.d | 10 ++++++++++
28
ld/testsuite/ld-scripts/defined4.s | 4 ++++
29
ld/testsuite/ld-scripts/defined4.t | 6 ++++++
30
ld/testsuite/ld-scripts/expr.exp | 5 +++--
31
ld/testsuite/ld-scripts/expr2.d | 6 ++++++
32
ld/testsuite/ld-scripts/expr2.s | 4 ++++
33
ld/testsuite/ld-scripts/expr2.t | 11 +++++++++++
34
8 files changed, 46 insertions(+), 3 deletions(-)
35
create mode 100644 ld/testsuite/ld-scripts/defined4.d
36
create mode 100644 ld/testsuite/ld-scripts/defined4.s
37
create mode 100644 ld/testsuite/ld-scripts/defined4.t
38
create mode 100644 ld/testsuite/ld-scripts/expr2.d
39
create mode 100644 ld/testsuite/ld-scripts/expr2.s
40
create mode 100644 ld/testsuite/ld-scripts/expr2.t
42
diff --git a/ld/testsuite/ld-scripts/defined.exp b/ld/testsuite/ld-scripts/defined.exp
43
index 15cc079..6d0c9d5 100644
44
--- a/ld/testsuite/ld-scripts/defined.exp
45
+++ b/ld/testsuite/ld-scripts/defined.exp
47
# Test DEFINED in a linker script.
48
# By Ian Lance Taylor, Cygnus Support.
49
-# Copyright 2001, 2003. 2005, 2006, 2007
50
+# Copyright 2001, 2003, 2005, 2006, 2007, 2010
51
# Free Software Foundation, Inc.
53
# This file is part of the GNU Binutils.
54
@@ -66,4 +66,5 @@ if ![ld_simple_link $ld tmpdir/def "$LDFLAGS -T $srcdir/$subdir/defined.t tmpdir
56
run_dump_test "defined2"
57
run_dump_test "defined3"
58
+run_dump_test "defined4"
59
set LDFLAGS "$saved_LDFLAGS"
60
diff --git a/ld/testsuite/ld-scripts/defined4.d b/ld/testsuite/ld-scripts/defined4.d
62
index 0000000..2c3a6ea
64
+++ b/ld/testsuite/ld-scripts/defined4.d
70
+# Check that arithmetic on DEFINED works.
76
diff --git a/ld/testsuite/ld-scripts/defined4.s b/ld/testsuite/ld-scripts/defined4.s
78
index 0000000..5969a44
80
+++ b/ld/testsuite/ld-scripts/defined4.s
86
diff --git a/ld/testsuite/ld-scripts/defined4.t b/ld/testsuite/ld-scripts/defined4.t
88
index 0000000..1221df2
90
+++ b/ld/testsuite/ld-scripts/defined4.t
93
+ .text : { *(.text) }
94
+ .data : { *(.data) }
95
+ .bss : { *(.bss) *(COMMON) }
98
diff --git a/ld/testsuite/ld-scripts/expr.exp b/ld/testsuite/ld-scripts/expr.exp
99
index 34829e5..467abcb 100644
100
--- a/ld/testsuite/ld-scripts/expr.exp
101
+++ b/ld/testsuite/ld-scripts/expr.exp
103
-# Test ALIGN in a linker script.
104
+# Test expressions in a linker script.
105
# By Nathan Sidwell, CodeSourcery LLC
106
-# Copyright 2006, 2007
107
+# Copyright 2006, 2007, 2010
108
# Free Software Foundation, Inc.
110
# This file is part of the GNU Binutils.
112
# MA 02110-1301, USA.
116
diff --git a/ld/testsuite/ld-scripts/expr2.d b/ld/testsuite/ld-scripts/expr2.d
118
index 0000000..6f7e253
120
+++ b/ld/testsuite/ld-scripts/expr2.d
128
diff --git a/ld/testsuite/ld-scripts/expr2.s b/ld/testsuite/ld-scripts/expr2.s
130
index 0000000..5969a44
132
+++ b/ld/testsuite/ld-scripts/expr2.s
138
diff --git a/ld/testsuite/ld-scripts/expr2.t b/ld/testsuite/ld-scripts/expr2.t
140
index 0000000..634eab2
142
+++ b/ld/testsuite/ld-scripts/expr2.t
154
+ASSERT (_end - _text <= 0x100, "fail");