summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-03-23 09:35:34 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-03-23 09:35:34 +0000
commit3dc8e24126e2b17e863db9218caf5bae5a6cac43 (patch)
treee27294370fc3ecebe036f7cde0cc7b6bd588f371
parentb443544cc116bf78990bd2a49064def86e79ab07 (diff)
downloadbinutils-redhat-3dc8e24126e2b17e863db9218caf5bae5a6cac43.tar.gz
* 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.
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/ldemul.c2
-rw-r--r--ld/ldlang.c1
3 files changed, 8 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 1d810a7c04..4b9d324ecd 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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>
diff --git a/ld/ldemul.c b/ld/ldemul.c
index 85baeab325..5e2fd82a0d 100644
--- a/ld/ldemul.c
+++ b/ld/ldemul.c
@@ -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 ();
}
diff --git a/ld/ldlang.c b/ld/ldlang.c
index a95d2a58fe..73e0179b01 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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;