aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2006-10-27 03:22:09 +0000
committerAlan Modra <amodra@gmail.com>2006-10-27 03:22:09 +0000
commita14a5de357808faa8a25d1eff69454a8c0dca8d8 (patch)
treef9198e55241910d034585796755a4c2f7746967c /ld
parent7ebede5616fbc72ac4177676c039bef55cdf2b85 (diff)
downloadgdb-a14a5de357808faa8a25d1eff69454a8c0dca8d8.zip
gdb-a14a5de357808faa8a25d1eff69454a8c0dca8d8.tar.gz
gdb-a14a5de357808faa8a25d1eff69454a8c0dca8d8.tar.bz2
bfd/
* section.c (SEC_KEEP): Update comment. * bfd-in2.h: Regenerate. * elflink.c (bfd_elf_gc_sections): Ignore SEC_EXCLUDE sections. * merge.c (_bfd_merge_sections): Set SEC_KEEP on excluded sections. * stabs.c (_bfd_discard_section_stabs): Likewise. (_bfd_link_section_stabs): Likewise. Simplify abs_section check. ld/ * ldlang.c (lang_map): Don't say SEC_LINKER_CREATED and SEC_KEEP sections have been discarded. (lang_do_version_exports_section): Set SEC_KEEP on export section. * emultempl/elf32.em (before_allocation): Set SEC_KEEP on warning sections.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/emultempl/elf32.em2
-rw-r--r--ld/ldlang.c9
3 files changed, 14 insertions, 5 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 17c703b..8b69b36 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2006-10-27 Alan Modra <amodra@bigpond.net.au>
+
+ * ldlang.c (lang_map): Don't say SEC_LINKER_CREATED and SEC_KEEP
+ sections have been discarded.
+ (lang_do_version_exports_section): Set SEC_KEEP on export section.
+ * emultempl/elf32.em (before_allocation): Set SEC_KEEP on warning
+ sections.
+
2006-10-26 Joseph S. Myers <joseph@codesourcery.com>
Mark Mitchell <mark@codesourcery.com>
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 3350ac0..99fb8ab 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1214,7 +1214,7 @@ ${ELF_INTERPRETER_SET_DEFAULT}
/* Also set SEC_EXCLUDE, so that symbols defined in the warning
section don't get copied to the output. */
- s->flags |= SEC_EXCLUDE;
+ s->flags |= SEC_EXCLUDE | SEC_KEEP;
}
}
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 391fc1f..5df5170 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1736,8 +1736,9 @@ lang_map (void)
continue;
for (s = file->the_bfd->sections; s != NULL; s = s->next)
- if (s->output_section == NULL
- || s->output_section->owner != output_bfd)
+ if ((s->output_section == NULL
+ || s->output_section->owner != output_bfd)
+ && (s->flags & (SEC_LINKER_CREATED | SEC_KEEP)) == 0)
{
if (! dis_header_printed)
{
@@ -4629,7 +4630,7 @@ lang_size_sections_1
&newdot);
/* This symbol is relative to this section. */
- if ((tree->type.node_class == etree_provided
+ if ((tree->type.node_class == etree_provided
|| tree->type.node_class == etree_assign)
&& (tree->assign.dst [0] != '.'
|| tree->assign.dst [1] != '\0'))
@@ -6922,7 +6923,7 @@ lang_do_version_exports_section (void)
/* Do not free the contents, as we used them creating the regex. */
/* Do not include this section in the link. */
- sec->flags |= SEC_EXCLUDE;
+ sec->flags |= SEC_EXCLUDE | SEC_KEEP;
}
lreg = lang_new_vers_pattern (NULL, "*", NULL, FALSE);