summaryrefslogtreecommitdiff
path: root/ld/ldexp.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2011-05-03 14:56:14 +0000
committerAlan Modra <amodra@bigpond.net.au>2011-05-03 14:56:14 +0000
commit7271ea650c369704e736a0902869479e5a536618 (patch)
tree2a22a2e1cc50b7977ee2577055f638c2cd0207ca /ld/ldexp.c
parentee97f9909cd2e60e8edcb8b14710dfe05890f23e (diff)
downloadbinutils-redhat-7271ea650c369704e736a0902869479e5a536618.tar.gz
PR ld/12726
* ldexp.h (lang_phase_type): Add lang_assigning_phase_enum. * ldexp.c (exp_fold_tree_1): Correct assign to dot comment. Don't assign to dot when lang_assigning_phase_enum. * ldlang.h (lang_do_assignments): Update prototype. * ldlang.c (lang_do_assignments): Add phase parameter. Update all callers. * pe-dll.c (pe_dll_fill_sections, pe_exe_fill_sections): Update lang_do_assignments calls.
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r--ld/ldexp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ld/ldexp.c b/ld/ldexp.c
index fc18601648..f70634c5c6 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -783,12 +783,15 @@ exp_fold_tree_1 (etree_type *tree)
case etree_provided:
if (tree->assign.dst[0] == '.' && tree->assign.dst[1] == 0)
{
- /* Assignment to dot can only be done during allocation. */
if (tree->type.node_class != etree_assign)
einfo (_("%F%S can not PROVIDE assignment to location counter\n"));
+ /* After allocation, assignment to dot should not be done inside
+ an output section since allocation adds a padding statement
+ that effectively duplicates the assignment. */
if (expld.phase == lang_mark_phase_enum
|| expld.phase == lang_allocating_phase_enum
- || (expld.phase == lang_final_phase_enum
+ || ((expld.phase == lang_assigning_phase_enum
+ || expld.phase == lang_final_phase_enum)
&& expld.section == bfd_abs_section_ptr))
{
/* Notify the folder that this is an assignment to dot. */