From a14a5de357808faa8a25d1eff69454a8c0dca8d8 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 27 Oct 2006 03:22:09 +0000 Subject: 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. --- ld/ChangeLog | 8 ++++++++ ld/emultempl/elf32.em | 2 +- ld/ldlang.c | 9 +++++---- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'ld') 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 + + * 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 Mark Mitchell 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); -- cgit v1.1