summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-scripts
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-09-19 02:51:08 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-09-19 02:51:08 +0000
commit9e0e9ba1378c3161778861fe73ea622902974462 (patch)
tree8598334e69717695d8f39dfde7ef507557bdbe43 /ld/testsuite/ld-scripts
parent82c5587db078581cfe94a4385ed99de1d1fa6657 (diff)
downloadbinutils-redhat-9e0e9ba1378c3161778861fe73ea622902974462.tar.gz
* ld-scripts/assign-loc.d: New file. Test for assigning absolute
symbol to location counter. * ld-scripts/assign-loc.t: New file. Linker script for above test. * ld-scripts/expr.exp: Add new assignment test.
Diffstat (limited to 'ld/testsuite/ld-scripts')
-rw-r--r--ld/testsuite/ld-scripts/assign-loc.d11
-rw-r--r--ld/testsuite/ld-scripts/assign-loc.t17
-rw-r--r--ld/testsuite/ld-scripts/expr.exp1
3 files changed, 29 insertions, 0 deletions
diff --git a/ld/testsuite/ld-scripts/assign-loc.d b/ld/testsuite/ld-scripts/assign-loc.d
new file mode 100644
index 0000000000..bf6b9d84bb
--- /dev/null
+++ b/ld/testsuite/ld-scripts/assign-loc.d
@@ -0,0 +1,11 @@
+#ld: -T assign-loc.t
+#source: data.s
+#nm: -n
+#notarget: rs6000-*-aix*
+#...
+0+0100 A HEAP_SIZE
+#...
+0+2000 [AB] _start
+#...
+0+2100 [AB] _end
+#pass
diff --git a/ld/testsuite/ld-scripts/assign-loc.t b/ld/testsuite/ld-scripts/assign-loc.t
new file mode 100644
index 0000000000..e8c5102438
--- /dev/null
+++ b/ld/testsuite/ld-scripts/assign-loc.t
@@ -0,0 +1,17 @@
+SECTIONS
+{
+ . = 0x2000 ;
+
+ _start = .;
+
+ HEAP_SIZE = 0x100;
+
+ .heap : {
+ . = HEAP_SIZE;
+ . = ALIGN(4);
+ }
+
+ _end = .;
+
+ /DISCARD/ : { *(*) }
+}
diff --git a/ld/testsuite/ld-scripts/expr.exp b/ld/testsuite/ld-scripts/expr.exp
index 185fa4eccd..ea5002f9b3 100644
--- a/ld/testsuite/ld-scripts/expr.exp
+++ b/ld/testsuite/ld-scripts/expr.exp
@@ -23,3 +23,4 @@
run_dump_test expr1
run_dump_test expr2
run_dump_test sane1
+run_dump_test assign-loc