From 602f5faf49d4c59ad3b76cc972fd29c51139cc71 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 19 Sep 2012 02:51:09 +0000 Subject: [PATCH] * 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. --- ld/testsuite/ChangeLog | 7 +++++++ ld/testsuite/ld-scripts/assign-loc.d | 11 +++++++++++ ld/testsuite/ld-scripts/assign-loc.t | 17 +++++++++++++++++ ld/testsuite/ld-scripts/expr.exp | 1 + 4 files changed, 36 insertions(+) create mode 100644 ld/testsuite/ld-scripts/assign-loc.d create mode 100644 ld/testsuite/ld-scripts/assign-loc.t diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index bca8bbb8efb..1c6a509a859 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2012-09-19 Andrew Burgess + + * 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. + 2012-09-18 H.J. Lu PR ld/14591 diff --git a/ld/testsuite/ld-scripts/assign-loc.d b/ld/testsuite/ld-scripts/assign-loc.d new file mode 100644 index 00000000000..bf6b9d84bb9 --- /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 00000000000..e8c5102438f --- /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 185fa4eccd0..ea5002f9b35 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 -- 2.30.2