+2010-12-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/12327
+ * ld-scripts/defined4.d: New.
+ * ld-scripts/defined4.s: Likewise.
+ * ld-scripts/defined4.t: Likewise.
+ * ld-scripts/expr2.d: Likewise.
+ * ld-scripts/expr2.s: Likewise.
+ * ld-scripts/expr2.t: Likewise.
+
+ * ld-scripts/defined.exp: Run defined4.
+
+ * ld-scripts/expr.exp: Run expr2.
+
2010-12-21 Kai Tietz <kai.tietz@onevision.com>
* ld-pe/pe.exp: Add TLS directory test.
# Test DEFINED in a linker script.
# By Ian Lance Taylor, Cygnus Support.
-# Copyright 2001, 2003. 2005, 2006, 2007
+# Copyright 2001, 2003, 2005, 2006, 2007, 2010
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
set prms_id 0
run_dump_test "defined2"
run_dump_test "defined3"
+run_dump_test "defined4"
set LDFLAGS "$saved_LDFLAGS"
--- /dev/null
+#ld: -Tdefined4.t
+#nm: -B
+#source: defined4.s
+
+# Check that arithmetic on DEFINED works.
+#...
+0+0 D defined
+#...
+0+0 D defined1
+#pass
--- /dev/null
+ .globl defined
+ .data
+defined:
+ .word 0
--- /dev/null
+SECTIONS {
+ .text : { *(.text) }
+ .data : { *(.data) }
+ .bss : { *(.bss) *(COMMON) }
+}
+defined1 = defined;
-# Test ALIGN in a linker script.
+# Test expressions in a linker script.
# By Nathan Sidwell, CodeSourcery LLC
-# Copyright 2006, 2007
+# Copyright 2006, 2007, 2010
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
# MA 02110-1301, USA.
run_dump_test expr1
+run_dump_test expr2
--- /dev/null
+# ld: -T expr2.t
+#nm: -B
+
+#...
+.* D defined
+#pass
--- /dev/null
+ .globl defined
+ .data
+defined:
+ .word 0
--- /dev/null
+SECTIONS
+{
+ . = 0xc000;
+ .text :
+ {
+ _text = .;
+ *(.text)
+ }
+ _end = .;
+}
+ASSERT (_end - _text <= 0x100, "fail");