aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-02-20 15:31:10 +0000
committerNathan Sidwell <nathan@codesourcery.com>2004-02-20 15:31:10 +0000
commit876f40905a27ef106554f894321b23d8130e9ffc (patch)
treeeda3fbb1695ae2a4858e9055b07078e3842b17b2 /ld/testsuite
parent627fe3fb790fa71dea2b5699f4e23bbbcf184d5f (diff)
downloadgdb-876f40905a27ef106554f894321b23d8130e9ffc.zip
gdb-876f40905a27ef106554f894321b23d8130e9ffc.tar.gz
gdb-876f40905a27ef106554f894321b23d8130e9ffc.tar.bz2
* ldgram.y (exp): Add two operand ALIGN.
* ldexp.c (fold_binary): Add ALIGN_K case. * ld.texinfo (ALIGN): Document two operand version. * ld-scripts/align.{s,t,exp}: New.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog4
-rw-r--r--ld/testsuite/ld-scripts/align.exp31
-rw-r--r--ld/testsuite/ld-scripts/align.s2
-rw-r--r--ld/testsuite/ld-scripts/align.t8
4 files changed, 45 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 23e41a9..b103d5b 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2004-02-20 Nathan Sidwell <nathan@codesourcery.com>
+
+ * ld-scripts/align.{s,t,exp}: New.
+
2004-02-19 Nathan Sidwell <nathan@codesourcery.com>
* ld-scripts/data.{s,t,d,exp}: New.
diff --git a/ld/testsuite/ld-scripts/align.exp b/ld/testsuite/ld-scripts/align.exp
new file mode 100644
index 0000000..3959e6d
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align.exp
@@ -0,0 +1,31 @@
+# Test ALIGN in a linker script.
+# By Nathan Sidwell, CodeSourcery LLC
+# Copyright 2004
+# Free Software Foundation, Inc.
+#
+# This file 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testname "ALIGN"
+
+if ![ld_assemble $as $srcdir/$subdir/align.s tmpdir/align.o] {
+ unresolved $testname
+ return
+}
+
+if ![ld_simple_link $ld tmpdir/align "-T $srcdir/$subdir/align.t tmpdir/align.o"] {
+ fail $testname
+} else {
+ pass $testname
+}
diff --git a/ld/testsuite/ld-scripts/align.s b/ld/testsuite/ld-scripts/align.s
new file mode 100644
index 0000000..c9bad23
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align.s
@@ -0,0 +1,2 @@
+ .text
+ .long 0
diff --git a/ld/testsuite/ld-scripts/align.t b/ld/testsuite/ld-scripts/align.t
new file mode 100644
index 0000000..49d6053
--- /dev/null
+++ b/ld/testsuite/ld-scripts/align.t
@@ -0,0 +1,8 @@
+SECTIONS
+{
+ .text : {*(.text)}
+ .data ALIGN(0x40) : AT (ALIGN (LOADADDR (.text) + SIZEOF (.text), 0x80))
+ {}
+ ASSERT (LOADADDR(.data) == 0x80, "dyadic ALIGN broken")
+ ASSERT (ADDR(.data) == 0x40, "monadic ALIGN broken")
+}