Date: Mon, 31 Dec 2012 14:21:52 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r244906 - stable/7/contrib/binutils/bfd Message-ID: <201212311421.qBVELqfp049126@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Mon Dec 31 14:21:51 2012 New Revision: 244906 URL: http://svnweb.freebsd.org/changeset/base/244906 Log: MFC r244600: Fix a bug in ld --gc-sections: it strips out .note sections, while it should never do so. This can cause global constructors and destructors to not be executed at run-time, resulting in crashes and other strange behaviour. Reported by: rene Modified: stable/7/contrib/binutils/bfd/elflink.c Directory Properties: stable/7/contrib/binutils/ (props changed) Modified: stable/7/contrib/binutils/bfd/elflink.c ============================================================================== --- stable/7/contrib/binutils/bfd/elflink.c Mon Dec 31 14:21:41 2012 (r244905) +++ stable/7/contrib/binutils/bfd/elflink.c Mon Dec 31 14:21:51 2012 (r244906) @@ -8248,6 +8248,7 @@ elf_gc_sweep (struct bfd_link_info *info { /* Keep special sections. Keep .debug sections. */ if ((o->flags & SEC_LINKER_CREATED) + || elf_section_data (o)->this_hdr.sh_type == SHT_NOTE || (o->flags & SEC_DEBUGGING)) o->gc_mark = 1;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212311421.qBVELqfp049126>