aboutsummaryrefslogtreecommitdiff
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
parent1e6e8c4b76fd0627cc71bf980a1429b1ea2055cf (diff)
downloadfsf-binutils-gdb-5590fba9534e101a6f41d7ad801442cf7af17f98.zip
fsf-binutils-gdb-5590fba9534e101a6f41d7ad801442cf7af17f98.tar.gz
fsf-binutils-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.
-rw-r--r--ld/ChangeLog10
-rw-r--r--ld/ldlang.c13
-rw-r--r--ld/testsuite/ChangeLog9
-rw-r--r--ld/testsuite/ld-scripts/overlay-size-map.d6
-rw-r--r--ld/testsuite/ld-scripts/overlay-size.t6
5 files changed, 43 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 95c298e..6524a63 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,13 @@
+2008-06-12 Nick Clifton <nickc@redhat.com>
+
+ * 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.
+
2008-06-07 Alan Modra <amodra@bigpond.net.au>
* NEWS: Mention archive:path patterns.
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;
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 9f5db17..5f774b2 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2008-06-12 Nick Clifton <nickc@redhat.com>
+
+ * 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.
+
2008-06-09 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* ld-sh/arch/arch_expected.txt: Regenerate.
diff --git a/ld/testsuite/ld-scripts/overlay-size-map.d b/ld/testsuite/ld-scripts/overlay-size-map.d
index 3607169..a72d359 100644
--- a/ld/testsuite/ld-scripts/overlay-size-map.d
+++ b/ld/testsuite/ld-scripts/overlay-size-map.d
@@ -5,6 +5,8 @@
#...
\.bss3 *0x0*20000 *0x20 load address 0x0*20040
#...
+.*0x0+020030[ ]*end_of_bss_overlays.*
+#...
\.mtext *0x0*10000 *0x20 load address 0x0*30000
#...
\.mbss *0x0*20030 *0x230 load address 0x0*20060
@@ -15,9 +17,13 @@
#...
\.text3 *0x0*10020 *0x20 load address 0x0*300e0
#...
+.*0x0+0100a0[ ]*end_of_text_overlays.*
+#...
\.data1 *0x0*20260 *0x30 load address 0x0*30100
#...
\.data2 *0x0*20260 *0x40 load address 0x0*30130
#...
\.data3 *0x0*20260 *0x50 load address 0x0*30170
+#...
+.*0x0+0202b0[ ]*end_of_data_overlays.*
#pass
diff --git a/ld/testsuite/ld-scripts/overlay-size.t b/ld/testsuite/ld-scripts/overlay-size.t
index 53f857d..0d9af35 100644
--- a/ld/testsuite/ld-scripts/overlay-size.t
+++ b/ld/testsuite/ld-scripts/overlay-size.t
@@ -31,6 +31,8 @@ SECTIONS
.bss3 { *(.bss3) }
} > DATAMEM
+ end_of_bss_overlays = . ;
+
.mtext : { *(.mtext) } > TEXTMEM AT > LOADMEM
.mbss : AT (__load_stop_bss3)
@@ -46,6 +48,8 @@ SECTIONS
.text3 { *(.text3) }
} > TEXTMEM AT > LOADMEM
+ end_of_text_overlays = . ;
+
OVERLAY :
{
.data1 { *(.data1) }
@@ -53,6 +57,8 @@ SECTIONS
.data3 { *(.data3) }
} > DATAMEM AT > LOADMEM
+ end_of_data_overlays = . ;
+
. = 0x8000;
/DISCARD/ : { *(.reginfo) }
}