From b91afed73bdfb757fef53f36d6a7ffe8357fafe0 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 26 Mar 2002 11:54:12 +0000 Subject: [PATCH] * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections. --- bfd/ChangeLog | 4 ++++ bfd/elflink.h | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3b5315033a..28f8b3280b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2002-03-26 Alan Modra + + * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections. + 2002-03-23 Alan Modra * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on diff --git a/bfd/elflink.h b/bfd/elflink.h index d84f2a5f08..43abe17bce 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -7570,11 +7570,15 @@ elf_gc_mark (info, sec, gc_mark_hook) } if (rsec && !rsec->gc_mark) - if (!elf_gc_mark (info, rsec, gc_mark_hook)) - { - ret = false; - goto out2; - } + { + if (bfd_get_flavour (rsec->owner) != bfd_target_elf_flavour) + rsec->gc_mark = 1; + else if (!elf_gc_mark (info, rsec, gc_mark_hook)) + { + ret = false; + goto out2; + } + } } out2: