aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2008-06-12 11:27:38 +0000
committerNick Clifton <nickc@redhat.com>2008-06-12 11:27:38 +0000
commit5590fba9534e101a6f41d7ad801442cf7af17f98 (patch)
treeb789c35625de56263122fe6f3932bee606090b18 /ld/ldlang.c
parent1e6e8c4b76fd0627cc71bf980a1429b1ea2055cf (diff)
downloadgdb-5590fba9534e101a6f41d7ad801442cf7af17f98.zip
gdb-5590fba9534e101a6f41d7ad801442cf7af17f98.tar.gz
gdb-5590fba9534e101a6f41d7ad801442cf7af17f98.tar.bz2
* ldlang.c (print_output_section_statement): If the output section
statement has an update_dot_tree expression, apply it to print_dot. (print_input_section): Do not update print_dot if it would move print_dot backwards. (lang_do_assignments_1): If the output section statement has an update_dot_tree expression apply it to dot. * ld-scripts/overlay-size.t (end_of_bss_overlays): Define. (end_of_text_overlays): Define. (end_of_data_overlays): Define. * ld-scripts/overlay-size-map.d: Add expected values for end_of_bss_overlays, end_of_text_overlays and end_of_data_overlays.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 7fc4ff3..2f5c213 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -3653,6 +3653,10 @@ print_output_section_statement
if (section->vma != section->lma)
minfo (_(" load address 0x%V"), section->lma);
+
+ if (output_section_statement->update_dot_tree != NULL)
+ exp_fold_tree (output_section_statement->update_dot_tree,
+ bfd_abs_section_ptr, &print_dot);
}
print_nl ();
@@ -3899,7 +3903,11 @@ print_input_section (asection *i)
else
print_all_symbols (i);
- print_dot = addr + TO_ADDR (size);
+ /* Update print_dot, but make sure that we do not move it
+ backwards - this could happen if we have overlays and a
+ later overlay is shorter than an earier one. */
+ if (addr + TO_ADDR (size) > print_dot)
+ print_dot = addr + TO_ADDR (size);
}
}
@@ -5151,6 +5159,9 @@ lang_do_assignments_1 (lang_statement_union_type *s,
|| (os->bfd_section->flags & SEC_THREAD_LOCAL) == 0
|| link_info.relocatable)
dot += TO_ADDR (os->bfd_section->size);
+
+ if (os->update_dot_tree != NULL)
+ exp_fold_tree (os->update_dot_tree, bfd_abs_section_ptr, &dot);
}
}
break;