diff options
author | Kai Tietz <kai.tietz@onevision.com> | 2011-10-06 08:59:36 +0000 |
---|---|---|
committer | Kai Tietz <kai.tietz@onevision.com> | 2011-10-06 08:59:36 +0000 |
commit | 07c7ed6d7740dab37ec36a4a736bb2c550c99e86 (patch) | |
tree | dab491ebc18180170754f9420624c7973101e166 /bfd | |
parent | a664570eec3a25b8fa0269263be024ddd9e1bfd3 (diff) | |
download | gdb-07c7ed6d7740dab37ec36a4a736bb2c550c99e86.zip gdb-07c7ed6d7740dab37ec36a4a736bb2c550c99e86.tar.gz gdb-07c7ed6d7740dab37ec36a4a736bb2c550c99e86.tar.bz2 |
* coffgen.c (coff_write_alien_symbol): Don't write
symbol for discarded sections, if strip_discarded isn't
explicit set to false.
(coff_write_native_symbol): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/coffgen.c | 17 |
2 files changed, 24 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index efc68a3..7e858e2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2011-10-05 Kai Tietz <ktietz@redhat.com> + + * coffgen.c (coff_write_alien_symbol): Don't write + symbol for discarded sections, if strip_discarded isn't + explicit set to false. + (coff_write_native_symbol): Likewise. + 2011-10-05 DJ Delorie <dj@redhat.com> Nick Clifton <nickc@redhat.com> diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 2508b51..87a3bfa 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -996,7 +996,15 @@ coff_write_alien_symbol (bfd *abfd, asection *output_section = symbol->section->output_section ? symbol->section->output_section : symbol->section; + struct bfd_link_info *link_info = coff_data (abfd)->link_info; + if ((!link_info || link_info->strip_discarded) + && !bfd_is_abs_section (symbol->section) + && symbol->section->output_section == bfd_abs_section_ptr) + { + symbol->name = ""; + return TRUE; + } native = &dummy; native->u.syment.n_type = T_NULL; native->u.syment.n_flags = 0; @@ -1061,6 +1069,15 @@ coff_write_native_symbol (bfd *abfd, { combined_entry_type *native = symbol->native; alent *lineno = symbol->lineno; + struct bfd_link_info *link_info = coff_data (abfd)->link_info; + + if ((!link_info || link_info->strip_discarded) + && !bfd_is_abs_section (symbol->symbol.section) + && symbol->symbol.section->output_section == bfd_abs_section_ptr) + { + symbol->symbol.name = ""; + return TRUE; + } /* If this symbol has an associated line number, we must store the symbol index in the line number field. We also tag the auxent to |