* 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 bfa0e4d..14a7f7c 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 36750ed..0e60d19 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);
                    }
                }