aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-01-07 13:44:37 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-01-07 13:44:37 +0000
commit16583161e14cbe747e78da035790c48951884556 (patch)
treee1fbc701c4f2f9fde24733620bad0513cd286ac9 /bfd
parent089b4803bf8f591e762c475dbabceb3c37d97ffc (diff)
downloadgdb-16583161e14cbe747e78da035790c48951884556.zip
gdb-16583161e14cbe747e78da035790c48951884556.tar.gz
gdb-16583161e14cbe747e78da035790c48951884556.tar.bz2
Always keep SHT_NOTE sections
bfd/ 2010-01-07 H.J. Lu <hongjiu.lu@intel.com> PR ld/11143 * elflink.c (elf_gc_sweep): Keep SHT_NOTE section. ld/testsuite/ 2010-01-07 H.J. Lu <hongjiu.lu@intel.com> PR ld/11143 * ld-gc/gc.exp: Run abi-note. * ld-gc/abi-note.d: New. * ld-gc/abi-note.s: Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4d0db31..01950b4 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/11143
+ * elflink.c (elf_gc_sweep): Keep SHT_NOTE section.
+
2010-01-04 Daniel Gutson <dgutson@codesourcery.com>
* bfd.m4 (BFD_HAVE_SYS_PROCFS_TYPE): Define _STRUCTURE_PROC
diff --git a/bfd/elflink.c b/bfd/elflink.c
index bbdfe5e..284bff1 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1,6 +1,6 @@
/* ELF linking support for BFD.
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009
+ 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -11527,9 +11527,10 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
o->gc_mark = first->gc_mark;
}
else if ((o->flags & (SEC_DEBUGGING | SEC_LINKER_CREATED)) != 0
- || (o->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0)
+ || (o->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0
+ || elf_section_data (o)->this_hdr.sh_type == SHT_NOTE)
{
- /* Keep debug and special sections. */
+ /* Keep debug, special and SHT_NOTE sections. */
o->gc_mark = 1;
}