diff -cp ../binutils-2.21.52.0.1.orig/bfd/ChangeLog bfd/ChangeLog *** ../binutils-2.21.52.0.1.orig/bfd/ChangeLog 2011-06-10 08:31:15.181479004 +0100 --- bfd/ChangeLog 2011-06-10 08:37:07.663479004 +0100 *************** *** 1,3 **** --- 1,9 ---- + 2011-06-08 H.J. Lu + + PR ld/12851 + * elflink.c (elf_gc_sweep): Don't check SHT_NOTE sections here. + (bfd_elf_gc_sections): Also check SHT_NOTE sections. + 2011-06-08 Alan Modra * aix386-core.c, * cisco-core.c, * hpux-core.c, * osf-core.c, Common subdirectories: ../binutils-2.21.52.0.1.orig/bfd/doc and bfd/doc diff -cp ../binutils-2.21.52.0.1.orig/bfd/elflink.c bfd/elflink.c *** ../binutils-2.21.52.0.1.orig/bfd/elflink.c 2011-06-10 08:31:12.961479004 +0100 --- bfd/elflink.c 2011-06-10 08:36:10.796479004 +0100 *************** elf_gc_sweep (bfd *abfd, struct bfd_link *** 11818,11827 **** 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 ! || elf_section_data (o)->this_hdr.sh_type == SHT_NOTE) { ! /* Keep debug, special and SHT_NOTE sections. */ o->gc_mark = 1; } --- 11818,11826 ---- 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) { ! /* Keep debug and special sections. */ o->gc_mark = 1; } *************** bfd_elf_gc_sections (bfd *abfd, struct b *** 12103,12110 **** if (bfd_get_flavour (sub) != bfd_target_elf_flavour) continue; for (o = sub->sections; o != NULL; o = o->next) ! if ((o->flags & (SEC_EXCLUDE | SEC_KEEP)) == SEC_KEEP && !o->gc_mark) if (!_bfd_elf_gc_mark (info, o, gc_mark_hook)) return FALSE; } --- 12102,12113 ---- if (bfd_get_flavour (sub) != bfd_target_elf_flavour) continue; + /* Also keep SHT_NOTE sections. */ for (o = sub->sections; o != NULL; o = o->next) ! if ((o->flags & SEC_EXCLUDE) == 0 ! && ((o->flags & SEC_KEEP) != 0 ! || elf_section_data (o)->this_hdr.sh_type == SHT_NOTE) ! && !o->gc_mark) if (!_bfd_elf_gc_mark (info, o, gc_mark_hook)) return FALSE; } Common subdirectories: ../binutils-2.21.52.0.1.orig/bfd/hosts and bfd/hosts Common subdirectories: ../binutils-2.21.52.0.1.orig/bfd/.libs and bfd/.libs Common subdirectories: ../binutils-2.21.52.0.1.orig/bfd/po and bfd/po