+2015-01-20 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * ldlang.c (print_assignment): Only evaluate the expression for a
+ PROVIDE'd assignment when the destination is being defined.
+ Display a special message for PROVIDE'd symbols that are not being
+ provided.
+
2015-01-20 Alan Modra <amodra@gmail.com>
* emulparams/elf64ppc.sh (BSS_PLT): Don't define.
osec = output_section->bfd_section;
if (osec == NULL)
osec = bfd_abs_section_ptr;
- exp_fold_tree (tree, osec, &print_dot);
+
+ if (assignment->exp->type.node_class != etree_provide)
+ exp_fold_tree (tree, osec, &print_dot);
+ else
+ expld.result.valid_p = FALSE;
+
if (expld.result.valid_p)
{
bfd_vma value;
}
else
{
- minfo ("*undef* ");
+ if (assignment->exp->type.node_class == etree_provide)
+ minfo ("[!provide]");
+ else
+ minfo ("*undef* ");
#ifdef BFD64
minfo (" ");
#endif
+2015-01-20 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * ld-scripts/provide-4.d: New file.
+ * ld-scripts/provide-4-map.d: New file.
+ * ld-scripts/provide-4.t: New file.
+ * ld-scripts/provide-5.d: New file.
+ * ld-scripts/provide-5.s: New file.
+ * ld-scripts/provide-5-map.d: New file.
+ * ld-scripts/provide-5.t: New file.
+ * ld-scripts/provide.exp: Run the provide-4.d and provide-5.d
+ tests.
+
2015-01-20 Andrew Burgess <andrew.burgess@embecosm.com>
* ld-scripts/overlay-size.d: Add 'map' option.
--- /dev/null
+#...
+Linker script and memory map
+#...
+ \[!provide\] PROVIDE \(foo, 0x1\)
+ \[!provide\] PROVIDE \(bar, 0x2\)
+ 0x0+3 PROVIDE \(baz, 0x3\)
+#...
+ 0x0+2000 foo
+ \[!provide\] PROVIDE \(loc1, ALIGN \(\., 0x10\)\)
+ 0x0+2010 PROVIDE \(loc2, ALIGN \(\., 0x10\)\)
+ \[!provide\] PROVIDE \(loc3, \(loc1 \+ 0x20\)\)
+ 0x0+2030 loc4 = \(loc2 \+ 0x20\)
+#...
--- /dev/null
+#source: provide-2.s
+#ld: -T provide-4.t
+#PROG: nm
+#map: provide-4-map.d
+#...
+0+3 A baz
+0+2000 D foo
+0+2010 D loc2
+0+2030 A loc4
--- /dev/null
+SECTIONS
+{
+ PROVIDE (foo = 1);
+ PROVIDE (bar = 2);
+ PROVIDE (baz = 3);
+ .data 0x2000 :
+ {
+ *(.data)
+
+ PROVIDE (loc1 = ALIGN (., 0x10));
+ PROVIDE (loc2 = ALIGN (., 0x10));
+ }
+
+ PROVIDE (loc3 = loc1 + 0x20);
+ loc4 = loc2 + 0x20;
+}
--- /dev/null
+#...
+Linker script and memory map
+#...
+ 0x0+10 foo = 0x10
+ \[!provide\] PROVIDE \(foo, bar\)
+#...
--- /dev/null
+#source: provide-5.s
+#ld: -T provide-5.t
+#PROG: nm
+#map: provide-5-map.d
+#...
+0+10 A foo
--- /dev/null
+ .data
+ .global baz
+baz:
+ .word 0
--- /dev/null
+SECTIONS
+{
+ foo = 0x10;
+ PROVIDE (foo = bar);
+
+ .data 0x1000 :
+ {
+ *(.data)
+ }
+}
run_dump_test provide-2
setup_xfail *-*-*
run_dump_test provide-3
+run_dump_test provide-4
+run_dump_test provide-5
set LDFLAGS "$saved_LDFLAGS"