From owner-svn-src-head@FreeBSD.ORG Sat Dec 15 21:24:32 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 539C29B6; Sat, 15 Dec 2012 21:24:32 +0000 (UTC) (envelope-from andrew@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 37AC48FC1E; Sat, 15 Dec 2012 21:24:32 +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 qBFLOWYI040209; Sat, 15 Dec 2012 21:24:32 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBFLOWDO040208; Sat, 15 Dec 2012 21:24:32 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201212152124.qBFLOWDO040208@svn.freebsd.org> From: Andrew Turner Date: Sat, 15 Dec 2012 21:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244276 - head/contrib/gcc/config/arm 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, 15 Dec 2012 21:24:32 -0000 Author: andrew Date: Sat Dec 15 21:24:31 2012 New Revision: 244276 URL: http://svnweb.freebsd.org/changeset/base/244276 Log: Don't define CTORS_SECTION_ASM_OP and DTORS_SECTION_ASM_OP on arm when built with clang. When these are defined the lists are defined similar to: asm(".section .ctors"); STATIC func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) }; asm(".section .dtors"); STATIC func_ptr __DTOR_LIST__[1] = { (func_ptr) (-1) }; The problem is clang will move the two arrays out of the .ctors and .dtors sections causing these sections to contain a single null address. By not defining these macros we use the version of the code that places the arrays is their sections by using __attribute__((section(".ctors"))) and similar for .dtors. Submitted by: Daisuke Aoyama Modified: head/contrib/gcc/config/arm/arm.h Modified: head/contrib/gcc/config/arm/arm.h ============================================================================== --- head/contrib/gcc/config/arm/arm.h Sat Dec 15 21:15:43 2012 (r244275) +++ head/contrib/gcc/config/arm/arm.h Sat Dec 15 21:24:31 2012 (r244276) @@ -1866,8 +1866,10 @@ typedef struct # define DTOR_LIST_BEGIN asm (ARM_EABI_DTORS_SECTION_OP) # define DTOR_LIST_END /* empty */ # else /* !defined (__ARM_EABI__) */ +# ifndef __clang__ # define CTORS_SECTION_ASM_OP ARM_CTORS_SECTION_OP # define DTORS_SECTION_ASM_OP ARM_DTORS_SECTION_OP +# endif # endif /* !defined (__ARM_EABI__) */ #endif /* !defined (IN_LIBCC2) */