diff options
author | Alan Modra <amodra@gmail.com> | 2011-05-03 14:56:14 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2011-05-03 14:56:14 +0000 |
commit | 2f65ac726a5ab50287d1ea4525852e29f69a1bbd (patch) | |
tree | 3388ad81ada490fccf84166ab230075f8d1be4ab /ld/ldexp.c | |
parent | 2fbb87f62734ebbf166eb86c62ad4d569f1229cc (diff) | |
download | gdb-2f65ac726a5ab50287d1ea4525852e29f69a1bbd.zip gdb-2f65ac726a5ab50287d1ea4525852e29f69a1bbd.tar.gz gdb-2f65ac726a5ab50287d1ea4525852e29f69a1bbd.tar.bz2 |
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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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. */ |