aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-01-18 23:58:58 +0000
committerNick Clifton <nickc@redhat.com>2000-01-18 23:58:58 +0000
commitcce4c4c5bd0cccfa17c5b7695f6199f5ce4d467b (patch)
tree5946817eb09fdc370eb19b57bddd498b8641eaef
parentc5394b80aefdea6b2f589723a4b79bcbc1942629 (diff)
downloadgdb-cce4c4c5bd0cccfa17c5b7695f6199f5ce4d467b.zip
gdb-cce4c4c5bd0cccfa17c5b7695f6199f5ce4d467b.tar.gz
gdb-cce4c4c5bd0cccfa17c5b7695f6199f5ce4d467b.tar.bz2
Apply H.J.'s patch to fix NOLOAD section sizes and dot updates
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldlang.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 4b8107f..0ff05f6 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2000-01-18 H.J. Lu <hjl@gnu.org>
+
+ * ldlang.c (lang_size_sections): Also update the current
+ address of a region if the SEC_NEVER_LOAD bit is not set.
+
2000-01-10 Philip Blundell <pb@futuretv.com>
* configure.tgt (arm*-*-conix*): New target.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 5e93f94..d38d837 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -2823,10 +2823,15 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
/* Update dot in the region ?
We only do this if the section is going to be allocated,
since unallocated sections do not contribute to the region's
- overall size in memory. */
+
+ If the SEC_NEVER_LOAD bit is not set, it will affect the
+ addresses of sections after it. We have to update
+ dot. */
if (os->region != (lang_memory_region_type *) NULL
- && (bfd_get_section_flags (output_bfd, os->bfd_section)
- & (SEC_ALLOC | SEC_LOAD)))
+ && ((bfd_get_section_flags (output_bfd, os->bfd_section)
+ & SEC_NEVER_LOAD) == 0
+ || (bfd_get_section_flags (output_bfd, os->bfd_section)
+ & (SEC_ALLOC | SEC_LOAD))))
{
os->region->current = dot;