aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-07-11 00:10:29 +0000
committerAlan Modra <amodra@gmail.com>2009-07-11 00:10:29 +0000
commit0fa4d7cf2d7ccdd0776d37ab88e87afeecddc2e5 (patch)
tree777ae8e42fca0ed9c432e50c6011ab2610e6f838 /ld
parent43dd447d910e6a16340b2381ae3e2849ce087413 (diff)
downloadfsf-binutils-gdb-0fa4d7cf2d7ccdd0776d37ab88e87afeecddc2e5.zip
fsf-binutils-gdb-0fa4d7cf2d7ccdd0776d37ab88e87afeecddc2e5.tar.gz
fsf-binutils-gdb-0fa4d7cf2d7ccdd0776d37ab88e87afeecddc2e5.tar.bz2
* ldlang.c (insert_os_after): Don't tie assignments to non-alloc
output sections.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldlang.c17
2 files changed, 17 insertions, 5 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 8ffee59..5d877ec 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-11 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (insert_os_after): Don't tie assignments to non-alloc
+ output sections.
+
2009-07-10 Alan Modra <amodra@bigpond.net.au>
* emultempl/ppc32elf.em (ppc_before_allocation): Turn on
diff --git a/ld/ldlang.c b/ld/ldlang.c
index dda2f22..c10bbea 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1615,10 +1615,12 @@ output_prev_sec_find (lang_output_section_statement_type *os)
idea is to skip over anything that might be inside a SECTIONS {}
statement in a script, before we find another output section
statement. Assignments to "dot" before an output section statement
- are assumed to belong to it. An exception to this rule is made for
- the first assignment to dot, otherwise we might put an orphan
- before . = . + SIZEOF_HEADERS or similar assignments that set the
- initial address. */
+ are assumed to belong to it, except in two cases; The first
+ assignment to dot, and assignments before non-alloc sections.
+ Otherwise we might put an orphan before . = . + SIZEOF_HEADERS or
+ similar assignments that set the initial address, or we might
+ insert non-alloc note sections among assignments setting end of
+ image symbols. */
static lang_statement_union_type **
insert_os_after (lang_output_section_statement_type *after)
@@ -1662,7 +1664,12 @@ insert_os_after (lang_output_section_statement_type *after)
continue;
case lang_output_section_statement_enum:
if (assign != NULL)
- where = assign;
+ {
+ asection *s = (*where)->output_section_statement.bfd_section;
+
+ if (s == NULL || (s->flags & SEC_ALLOC) != 0)
+ where = assign;
+ }
break;
case lang_input_statement_enum:
case lang_address_statement_enum: