aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-02-28 14:38:27 +1030
committerAlan Modra <amodra@gmail.com>2014-02-28 14:38:27 +1030
commit9850436d9e423d66d67d27135896582b2725782e (patch)
tree890979cd5c829e7e05659f35ad022007fe76fd0b /bfd/elflink.c
parentb721f1faaff1d7440b1e7cf5d920edb1d59b67c6 (diff)
downloadgdb-9850436d9e423d66d67d27135896582b2725782e.zip
gdb-9850436d9e423d66d67d27135896582b2725782e.tar.gz
gdb-9850436d9e423d66d67d27135896582b2725782e.tar.bz2
Fix check_relocs/gc_sweep_hook mismatch
PR ld/16643 * elflink.c (elf_gc_sweep): Call gc_sweep_hook for exactly the same conditions we called check_relocs.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 28ccf53..47e4802 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -11992,7 +11992,9 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
info we collected before. */
if (gc_sweep_hook
&& (o->flags & SEC_RELOC) != 0
- && o->reloc_count > 0
+ && o->reloc_count != 0
+ && !((info->strip == strip_all || info->strip == strip_debugger)
+ && (o->flags & SEC_DEBUGGING) != 0)
&& !bfd_is_abs_section (o->output_section))
{
Elf_Internal_Rela *internal_relocs;