* ldemul.c (before_allocation_default): When emitrelocations,
authorAlan Modra <amodra@gmail.com>
Fri, 23 Mar 2012 09:35:34 +0000 (09:35 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 23 Mar 2012 09:35:34 +0000 (09:35 +0000)
don't strip sections..
* ldlang.c (lang_add_section): ..and don't set up map_head, map_tail.

ld/ChangeLog
ld/ldemul.c
ld/ldlang.c

index 1d810a7c04c50dcb70831171bddcf8f420bd335b..4b9d324ecde67e6c02c1bed98bc5b2f975536952 100644 (file)
@@ -1,3 +1,9 @@
+2012-03-23  Alan Modra  <amodra@gmail.com>
+
+       * ldemul.c (before_allocation_default): When emitrelocations,
+       don't strip sections..
+       * ldlang.c (lang_add_section): ..and don't set up map_head, map_tail.
+
 2012-03-14  Kai Tietz  <ktietz@redhat.com>
            Pascal Obry  <pascal@obry.net>
 
index 85baeab325885696431ac428bd4b33f3c010e8a6..5e2fd82a0dd82fb3c2871ed2480b9bb44b26a9e6 100644 (file)
@@ -237,7 +237,7 @@ after_allocation_default (void)
 void
 before_allocation_default (void)
 {
-  if (!link_info.relocatable)
+  if (!link_info.relocatable && !link_info.emitrelocations)
     strip_excluded_output_sections ();
 }
 
index a95d2a58fea3458c3b2465d31e65a8dcbf0483ba..73e0179b016109e26ea18c4ce941ce46795078fd 100644 (file)
@@ -2380,6 +2380,7 @@ lang_add_section (lang_statement_list_type *ptr,
   section->output_section = output->bfd_section;
 
   if (!link_info.relocatable
+      && !link_info.emitrelocations
       && !stripped_excluded_sections)
     {
       asection *s = output->bfd_section->map_tail.s;