aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e647a2b..60b79ed 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/19161
+ * elflink.c (elf_gc_sweep): Always keep sections marked with
+ SEC_KEEP.
+
2015-10-22 Hans-Peter Nilsson <hp@bitrange.com>
* mmo.c (struct mmo_data_struct): New members
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 73fe469..06df821 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -12449,7 +12449,8 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
o->gc_mark = first->gc_mark;
}
- if (o->gc_mark)
+ /* Always keep sections marked with SEC_KEEP. */
+ if (o->gc_mark || (o->flags & SEC_KEEP))
continue;
/* Skip sweeping sections already excluded. */