aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2004-08-17 08:51:07 +0000
committerAlan Modra <amodra@gmail.com>2004-08-17 08:51:07 +0000
commit7c2c850509cdc711332dcffedef489386aee0a76 (patch)
tree0a296173c678db404d96f62b7a54e7aa8960d4c9 /bfd/elflink.c
parent0367ecfb781c3eb834e5a6cd4e78df999d43aa18 (diff)
downloadgdb-7c2c850509cdc711332dcffedef489386aee0a76.zip
gdb-7c2c850509cdc711332dcffedef489386aee0a76.tar.gz
gdb-7c2c850509cdc711332dcffedef489386aee0a76.tar.bz2
* elflink.h (elf_gc_sweep): Keep non-alloc, non-load sections.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 00fa468..1e2f335 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)