From e9755617c639515075641c940ebc78033c911304 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 17 Aug 2004 08:51:07 +0000 Subject: [PATCH] * elflink.h (elf_gc_sweep): Keep non-alloc, non-load sections. --- bfd/ChangeLog | 4 ++++ bfd/elflink.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index a36f0f822..fc164dcc2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2004-08-17 Alan Modra + + * elflink.h (elf_gc_sweep): Keep non-alloc, non-load sections. + 2004-08-17 Nick Clifton * (is_arm_mapping_symbol_name): New function - return true diff --git a/bfd/elflink.c b/bfd/elflink.c index 00fa46887..1e2f335d3 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -8504,9 +8504,9 @@ elf_gc_sweep (struct bfd_link_info *info, gc_sweep_hook_fn gc_sweep_hook) for (o = sub->sections; o != NULL; o = o->next) { - /* Keep special sections. Keep .debug sections. */ - if ((o->flags & SEC_LINKER_CREATED) - || (o->flags & SEC_DEBUGGING)) + /* Keep debug and special sections. */ + if ((o->flags & (SEC_DEBUGGING | SEC_LINKER_CREATED)) != 0 + || (o->flags & (SEC_ALLOC | SEC_LOAD)) == 0) o->gc_mark = 1; if (o->gc_mark) -- 2.11.4.GIT