aboutsummaryrefslogtreecommitdiff
path: root/bfd/stabs.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2006-10-27 03:22:09 +0000
committerAlan Modra <amodra@bigpond.net.au>2006-10-27 03:22:09 +0000
commit79b62bf8ce98aa5b86ccbf753e02c3e3aef8fd83 (patch)
tree275226013f67afb03660cf822eda81bcbf1dcb0b /bfd/stabs.c
parenta659b9a7323ff7b1e5a6f901613efdecb70ea8d5 (diff)
downloadbinutils-current-79b62bf8ce98aa5b86ccbf753e02c3e3aef8fd83.tar.gz
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 'bfd/stabs.c')
-rw-r--r--bfd/stabs.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/bfd/stabs.c b/bfd/stabs.c
index 4f48e8e8e..93ab0a688 100644
--- a/bfd/stabs.c
+++ b/bfd/stabs.c
@@ -175,10 +175,8 @@ _bfd_link_section_stabs (bfd *abfd,
prepared to handle them. */
return TRUE;
- if ((stabsec->output_section != NULL
- && bfd_is_abs_section (stabsec->output_section))
- || (stabstrsec->output_section != NULL
- && bfd_is_abs_section (stabstrsec->output_section)))
+ if (bfd_is_abs_section (stabsec->output_section)
+ || bfd_is_abs_section (stabstrsec->output_section))
/* At least one of the sections is being discarded from the
link, so we should just ignore them. */
return TRUE;
@@ -433,7 +431,7 @@ _bfd_link_section_stabs (bfd *abfd,
++nest;
else if (incl_type == (int) N_EXCL)
/* Keep existing exclusion marks. */
- continue;
+ continue;
else if (nest == 0)
{
*incl_pstridx = (bfd_size_type) -1;
@@ -458,8 +456,8 @@ _bfd_link_section_stabs (bfd *abfd,
for that section. */
stabsec->size = (count - skip) * STABSIZE;
if (stabsec->size == 0)
- stabsec->flags |= SEC_EXCLUDE;
- stabstrsec->flags |= SEC_EXCLUDE;
+ stabsec->flags |= SEC_EXCLUDE | SEC_KEEP;
+ stabstrsec->flags |= SEC_EXCLUDE | SEC_KEEP;
sinfo->stabstr->size = _bfd_stringtab_size (sinfo->strings);
/* Calculate the `cumulative_skips' array now that stabs have been
@@ -611,7 +609,7 @@ _bfd_discard_section_stabs (bfd *abfd,
/* Shrink the stabsec as needed. */
stabsec->size -= skip * STABSIZE;
if (stabsec->size == 0)
- stabsec->flags |= SEC_EXCLUDE;
+ stabsec->flags |= SEC_EXCLUDE | SEC_KEEP;
/* Recalculate the `cumulative_skips' array now that stabs have been
deleted for this section. */