Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Dec 2012 14:21:31 +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-9@freebsd.org
Subject:   svn commit: r244904 - stable/9/contrib/binutils/bfd
Message-ID:  <201212311421.qBVELVN9049003@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Mon Dec 31 14:21:31 2012
New Revision: 244904
URL: http://svnweb.freebsd.org/changeset/base/244904

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/9/contrib/binutils/bfd/elflink.c
Directory Properties:
  stable/9/contrib/binutils/   (props changed)

Modified: stable/9/contrib/binutils/bfd/elflink.c
==============================================================================
--- stable/9/contrib/binutils/bfd/elflink.c	Mon Dec 31 12:11:14 2012	(r244903)
+++ stable/9/contrib/binutils/bfd/elflink.c	Mon Dec 31 14:21:31 2012	(r244904)
@@ -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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212311421.qBVELVN9049003>