+2005-02-17 Zack Weinberg <zack@codesourcery.com>
+
+ * ldexp.c (assigning_to_dot): New global flag.
+ (fold_name): If assigning_to_dot is true, object immediately to
+ an undefined symbol.
+ (exp_fold_tree): Set and clear assigning_to_dot around the
+ recursive call to exp_fold_tree to process the right-hand side
+ of an assignment to the location counter.
+
2005-02-17 Paul Brook <paul@codesourcery.com>
* scripttempl/armbpabi.sc: Add dummy name to version block.
not defined.
(gld${EMULATION_NAME}_parse_ld_so_conf_include): Do not use glob
if HAVE_GLOB is not defined.
-
+
2005-02-16 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Define
* ldlex.l (YY_NO_UNPUT): Define so that the yy_unput function is
not declared. It is not used and its presence causes a compile
time warning.
-
+
2005-02-11 Zack Weinberg <zack@codesourcery.com>
* emultempl/elf32.em (gld${EMULATION_NAME}_stat_needed):
segment_type *segments;
+/* Principally used for diagnostics. */
+static bfd_boolean assigning_to_dot = FALSE;
+
/* Print the string representation of the given token. Surround it
with spaces if INFIX_P is TRUE. */
}
}
}
- else if (allocation_done == lang_final_phase_enum)
+ else if (allocation_done == lang_final_phase_enum
+ || assigning_to_dot)
einfo (_("%F%S: undefined symbol `%s' referenced in expression\n"),
tree->name.name);
else if (h->type == bfd_link_hash_new)
|| (allocation_done == lang_final_phase_enum
&& current_section == abs_output_section))
{
+ /* Notify the folder that this is an assignment to dot. */
+ assigning_to_dot = TRUE;
result = exp_fold_tree (tree->assign.src,
current_section,
- allocation_done, dot,
- dotp);
+ allocation_done, dot, dotp);
+ assigning_to_dot = FALSE;
+
if (! result.valid_p)
einfo (_("%F%S invalid assignment to location counter\n"));
else
+2005-02-17 Zack Weinberg <zack@codesourcery.com>
+
+ * ld-scripts/align.exp: Rename existing "ALIGN" test to "align1".
+ Add dump tests "align2a", "align2b", "align2c".
+ * ld-scripts/align2.t, ld-scripts/align2a.s, ld-scripts/align2a.d
+ * ld-scripts/align2b.s, ld-scripts/align2b.d
+ * ld-scripts/align2c.s, ld-scripts/align2c.d: New files.
+
2005-02-17 Alexandre Oliva <aoliva@redhat.com>
* ld-frv/fdpic-static-6.d: Update.
spelling of errors and warnings.
2005-02-15 Nigel Stephens <nigel@mips.com>
- Maciej W. Rozycki <macro@mips.com>
+ Maciej W. Rozycki <macro@mips.com>
* ld-mips-elf/mips16-hilo.d: New test for the R_MIPS16_HI16 and
R_MIPS16_LO16 relocs.
2004-12-21 Tomer Levi <Tomer.Levi@nsc.com>
- * ld-crx/reloc-abs32.d: Update reference file according
+ * ld-crx/reloc-abs32.d: Update reference file according
to disassembler printing method.
* ld-crx/reloc-rel16.d: Likewise.
* ld-crx/reloc-rel24.d: Likewise.
return
}
-set testname "ALIGN"
+set testname "align1"
if ![ld_assemble $as $srcdir/$subdir/align.s tmpdir/align.o] {
unresolved $testname
} else {
pass $testname
}
+
+run_dump_test align2a
+run_dump_test align2b
+run_dump_test align2c
--- /dev/null
+SECTIONS
+{
+ .text : {*(.text)}
+ . = ALIGN(data_align);
+ .data : {*(.data)}
+}
--- /dev/null
+# ld: --defsym data_align=16 -T align2.t
+# objdump: --section-headers
+
+[^:]+: +file format.*
+
+Sections:
+Idx +Name +Size +VMA +LMA +File +off +Algn
+ +0 +\.text +00000004 +00000000 +00000000 +00001000 +2\*\*2
+ +CONTENTS, +ALLOC, +LOAD, +READONLY, +CODE
+ +1 +\.data +00000004 +00000010 +00000010 +00001010 +2\*\*2
+ +CONTENTS, +ALLOC, +LOAD, +DATA
+ +2 +\.bss +00000000 +00000014 +00000014 +00001014 +2\*\*2
+ +ALLOC
--- /dev/null
+ .text
+ .long 0
+ .data
+ .long 0x12345678
--- /dev/null
+# ld: --defsym data_align=32 -T align2.t
+# objdump: --section-headers
+
+[^:]+: +file +format.*
+
+Sections:
+Idx +Name +Size +VMA +LMA +File off +Algn
+ +0 +\.text +00000004 +00000000 +00000000 +00001000 +2\*\*2
+ +CONTENTS, +ALLOC, +LOAD, +READONLY, +CODE
+ +1 +\.data +00000004 +00000020 +00000020 +00001020 +2\*\*2
+ +CONTENTS, +ALLOC, +LOAD, +DATA
+ +2 +\.bss +00000000 +00000024 +00000024 +00001024 +2\*\*2
+ +ALLOC
--- /dev/null
+ .text
+ .long 0
+ .data
+ .long 0x12345678
--- /dev/null
+# ld: -T align2.t
+# error: undefined symbol.*in expression
--- /dev/null
+ .text
+ .long 0
+ .data
+ .long 0x12345678