* ldlang.c (lang_place_orphans): Zero vma when relocatable or non-load
authorAlan Modra <amodra@gmail.com>
Wed, 29 Sep 2010 06:17:12 +0000 (06:17 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 29 Sep 2010 06:17:12 +0000 (06:17 +0000)
section for orphans handled here.

ld/ChangeLog
ld/ldlang.c

index bfa0e4d8e9744ebf0732283c99f3567c021810ac..14a7f7c7ae5f7dba4dfcfd49216dc40c822c50f6 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-29  Alan Modra  <amodra@gmail.com>
+
+       * ldlang.c (lang_place_orphans): Zero vma when relocatable or non-load
+       section for orphans handled here.
+
 2010-09-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * configure: Regenerate.
index 36750edcd62ceab00d1f6a39a4429595d71a5b5c..0e60d1922df3880c0bb2e76dcad726bfc6f04380 100644 (file)
@@ -5906,6 +5906,10 @@ lang_place_orphans (void)
                      os = lang_output_section_statement_lookup (name,
                                                                 constraint,
                                                                 TRUE);
+                     if (os->addr_tree == NULL
+                         && (link_info.relocatable
+                             || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0))
+                       os->addr_tree = exp_intop (0);
                      lang_add_section (&os->children, s, os);
                    }
                }