From owner-svn-src-head@FreeBSD.ORG Sat Dec 22 20:46:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06E6D211; Sat, 22 Dec 2012 20:46:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF6298FC0A; Sat, 22 Dec 2012 20:46:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBMKkkER049292; Sat, 22 Dec 2012 20:46:46 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBMKkkcJ049291; Sat, 22 Dec 2012 20:46:46 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201212222046.qBMKkkcJ049291@svn.freebsd.org> From: Dimitry Andric Date: Sat, 22 Dec 2012 20:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244600 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2012 20:46:47 -0000 Author: dim Date: Sat Dec 22 20:46:46 2012 New Revision: 244600 URL: http://svnweb.freebsd.org/changeset/base/244600 Log: 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 MFC after: 1 week Modified: head/contrib/binutils/bfd/elflink.c Modified: head/contrib/binutils/bfd/elflink.c ============================================================================== --- head/contrib/binutils/bfd/elflink.c Sat Dec 22 20:35:45 2012 (r244599) +++ head/contrib/binutils/bfd/elflink.c Sat Dec 22 20:46:46 2012 (r244600) @@ -10584,6 +10584,7 @@ elf_gc_sweep (bfd *abfd, struct bfd_link { /* Keep debug and special sections. */ if ((o->flags & (SEC_DEBUGGING | SEC_LINKER_CREATED)) != 0 + || elf_section_data (o)->this_hdr.sh_type == SHT_NOTE || (o->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0) o->gc_mark = 1;