From patchwork Fri Nov 16 15:47:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151349 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp585995ljp; Fri, 16 Nov 2018 07:49:03 -0800 (PST) X-Google-Smtp-Source: AJdET5dy3ADN1fCToTc/7g/AUbvJHjCfAezav5ylB5Il1yur+0FzBkLoIxn60XQrSFqlcyon0LYV X-Received: by 2002:a17:902:6185:: with SMTP id u5mr10286451plj.194.1542383342978; Fri, 16 Nov 2018 07:49:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383342; cv=none; d=google.com; s=arc-20160816; b=ftEF4DLtaXqBXAh4kle+0uVOpmFiAc3feA438MWSp1qV27Z6ZQFNjH/VAyOD7ox3Ff 27JETtPvMtkX7ElIY960ikgFIJZ5TUnVZuLRtToyaAX4uGXj3uGB0q45l7E/ucGvQ9xf r8HA/ZSLOMLPgOLzjSWfYh4N32YImRaZq6sryysdUizrsj7XcoY6lNY1FTHKNtyqvEsY y2VUduaTnxO0VmEdTY+5BSaQkOIzgR0i9gpNAqbNtZurZWZbeKce8nB5ZIjuLirXWSEQ w42VmCNHMUuYi9KKVpq6kQafDlx7ScyLhX3t6bOvHt6N5zrOQ1iqUSwWiYpwNhgD+IQ5 rPCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=PmmXyhrdToUx2UTAWFTemlt8AvCLldEvQJdUxdcPmOI=; b=06e3Mcbdx132E0/7oGr0AOvcn4bJHm9sHyGraY1jCdOYBA13zmVElqEtlKL/V3ZEw/ I1xwZG/jCdNScLlG6+iTfetB+bNZacXtjfAIej4okySlZWG79gbyTQwzNrOEznletrAz 2b5Tz+iQ/xv3feIT3xXHf4mgwCfP9FtbDXITOSp4L050m9lfTRAvt998Y9I2iS0PQIsy 1E6FQAZVPj0dNo/ZIi2sPiF66qOzqwxOmbphZ8iWbxPk0g6LjiulQLfN2ZaAF1GvLsVd 928c4vVAqUKWSDO0+hMhT44/R7SstCSOei1uwSVzeolIFjs0YDxWpDv2Ar5yxteEZPz8 hEjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eGmSw8Sy; spf=pass (google.com: domain of gcc-patches-return-490263-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490263-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s3-v6si3738943plp.139.2018.11.16.07.49.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:49:02 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490263-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eGmSw8Sy; spf=pass (google.com: domain of gcc-patches-return-490263-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490263-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=C+9iKrLhdrO8zDvC7c1tE+bNuz6rS/ofxhMaf6bzV8NkiDE8vpMVb FjqbRz4Slw7xhCo8FGrgROWyddHeiDQlEJzKM9vbOUugM3Tnr1bazr8Xq2tKlZgC bEOODPegYgxbIuXF5k85CMUJM8quYSkjWbdNnn1UiZfY/ROvcmYh7o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=Gi4KzAMZyByoEBRP38zOhGCRmWI=; b=eGmSw8SysaULNhN5yDlyEMNNOQbw 1dKaj1kO297Bb2H1eGpLgrtqp7X4itfkKxd54DR2rtH2DdngIRMmDcnHRoYaKwjL YeMkAp9MHvHWLluXycqlezI032/Oyso3PzJEDeYJiQXuvumdYQZ4PObBZox1FEgf +g+yiHu8jbXzs9U= Received: (qmail 61304 invoked by alias); 16 Nov 2018 15:48:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 60228 invoked by uid 89); 16 Nov 2018 15:48:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Engineering, gun X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:48:48 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFilWZ002140; Fri, 16 Nov 2018 16:48:34 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nsx068vvc-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:48:33 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 72D2938; Fri, 16 Nov 2018 15:48:33 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 512D9500B; Fri, 16 Nov 2018 15:48:33 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:48:32 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 01/20] [ARM] FDPIC: Add -mfdpic option support Date: Fri, 16 Nov 2018 16:47:29 +0100 Message-ID: <20181116154808.25154-2-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.opt: Add -mfdpic option. * doc/invoke.texi: Add documentation for -mfdpic. -- 2.6.3 diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt index a1286a4..231c1cb 100644 --- a/gcc/config/arm/arm.opt +++ b/gcc/config/arm/arm.opt @@ -302,3 +302,7 @@ When linking for big-endian targets, generate a legacy BE32 format image. mbranch-cost= Target RejectNegative Joined UInteger Var(arm_branch_cost) Init(-1) Cost to assume for a branch insn. + +mfdpic +Target Report Mask(FDPIC) +Enable Function Descriptor PIC mode. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 535b258..6b08b09 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -691,7 +691,8 @@ Objective-C and Objective-C++ Dialects}. -mrestrict-it @gol -mverbose-cost-dump @gol -mpure-code @gol --mcmse} +-mcmse @gol +-mfdpic} @emph{AVR Options} @gccoptlist{-mmcu=@var{mcu} -mabsdata -maccumulate-args @gol @@ -17538,6 +17539,23 @@ MOVT instruction. Generate secure code as per the "ARMv8-M Security Extensions: Requirements on Development Tools Engineering Specification", which can be found on @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}. + +@item -mfdpic +@itemx -mno-fdpic +@opindex mfdpic +@opindex mno-fdpic +Select the FDPIC ABI, which uses function descriptors to represent +pointers to functions. When the compiler is configured for +@code{arm-*-uclinuxfdpiceabi} targets, this option is on by default +and implies @option{-fPIE} if none of the PIC/PIE-related options is +provided. On other targets, it only enables the FDPIC-specific code +generation features, and the user should explicitly provide the +PIC/PIE-related options as needed. + +The opposite @option{-mno-fdpic} option is useful (and required) to +build the Linux kernel using the same (@code{arm-*-uclinuxfdpiceabi}) +toolchain as the one used to build the userland programs. + @end table @node AVR Options From patchwork Fri Nov 16 15:47:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151350 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp586194ljp; Fri, 16 Nov 2018 07:49:15 -0800 (PST) X-Google-Smtp-Source: AJdET5c8dkbZV3cHGMHR8KVA/5qDfFQsKWTm2WP9QFgu+pkCupzhosqC1fkG/0DLAN2BbjQdYMOM X-Received: by 2002:a17:902:28a8:: with SMTP id f37-v6mr11495538plb.264.1542383355873; Fri, 16 Nov 2018 07:49:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383355; cv=none; d=google.com; s=arc-20160816; b=MIsv10SBFHI7ilq3fwtJDVJJttwrEyJcvvUNWDEk/b6G8UC5mwHL0GSl+PavXgvir2 es5Zl+X0954WY05eiVASm4M0P+2/nD0G0dO678VZKpGewZ+yousMQ+8IlEgvb51HxcEc ILoecPHzE6WTw4X1orvG+fUGuN0d12ZecP/GUsP5MU3x09sL5HTchUMDJaAeM0GKR552 qEO/y45X5OBSzuzoUxQDBGXl4hUKUNXFkflo1JLLcl3G/YvLb6VZ8mxggHS3WnC/uDua bAxaMV5eSaz2DppNfMmnRxQvrKVTDcwC9NWiarpUij3ysDxRhOtevXWOQUV0kO3Ydo0S GITw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=kYBlPObPgDXkCz00Q04SaVKTChgdMEBtumhi1tDJ+iw=; b=g8p/oYwwRtYeXtIlHdQ0Dkdjd64UPBfembqy3EeiZLicd4y8JDccP58jwSUstcpoOG 3Lzv9EtruLjB2QTK8ThV++sPkwuIrZtzdPnhSG64aF5WbDzVrk0KF00Q3ouDtBHGfqOm TtBqLhXoU7/6ydRf1hJ4QvFHtlxMex1WzDxYSYegXJQchjQAXq9CvMc4EgRbQ6zMfJ1R BZG8MSzjxnb7gEP+o4c6XE4paKEqmUHyu/qfsh/9mC3suNxjfBrYfy/m5oLSLKaMX8yf SwG0W896RsiVG+aRVmkvdyKM+q5uemRY2QNgvT25ozwqU1kUI/2uQZ1fXsk1dokexMaE zojw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ksdpt+vH; spf=pass (google.com: domain of gcc-patches-return-490264-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490264-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q3-v6si36913184pli.10.2018.11.16.07.49.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:49:15 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490264-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ksdpt+vH; spf=pass (google.com: domain of gcc-patches-return-490264-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490264-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=y0K005nRw7D5BRCR nqKAjmvtYb3WWvfBgNY9P1vlMQe8kdnw1dY4PMPk7ytuAmpkXt9WSan3FqoTuRhG efGcJSTQ3uavMIK9J/85TSBcGkXOwCmgnlNqcdITsug7PIHSIaptgrfOW3ofQnxI hnGoESWB+5tvj2VVzOWiACOkcTA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=Ky/FjNH85KhATkWqY2L9j8 SD3bk=; b=ksdpt+vH/GNOH12gxbWnyRk++Sf3JBCDR7zAiXyumZfkETIRc/w9H6 ncX8MGG075G6sguQSA2ednv1Iix6td0r3YsttjCBv2OW9m5+K3A8xml10ITtzwwE kjynUgeVqbcEEJKxEe832kx+U6FBfP1y1V2H9I3gRpUop6PvK8fGc= Received: (qmail 63728 invoked by alias); 16 Nov 2018 15:49:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 63534 invoked by uid 89); 16 Nov 2018 15:49:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=associates, elf.h, elfh, UD:elf.h X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:48:57 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFiXTf030555; Fri, 16 Nov 2018 16:48:55 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2nsxqxrp4v-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:48:55 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id ACEDC31; Fri, 16 Nov 2018 15:48:53 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 85CBD4FF9; Fri, 16 Nov 2018 15:48:53 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:48:52 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 02/20] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts Date: Fri, 16 Nov 2018 16:47:30 +0100 Message-ID: <20181116154808.25154-3-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes The new arm-uclinuxfdpiceabi target behaves pretty much like arm-linux-gnueabi. In order the enable the same set of features, we have to update several configure scripts that generally match targets like *-*-linux*: in most places, we add *-uclinux* where there is already *-linux*, or uclinux* when there is already linux*. In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi because there is already a different behaviour for *-*uclinux* target. In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared libraries support is required, as uclinux does not guarantee that. 2018-XX-XX Christophe Lyon config/ * futex.m4: Handle *-uclinux*. * tls.m4 (GCC_CHECK_TLS): Likewise. gcc/ * config.gcc: Handle *-*-uclinuxfdpiceabi. libatomic/ * configure.tgt: Handle arm*-*-uclinux*. * configure: Regenerate. libgcc/ * config.host: Handle *-*-uclinuxfdpiceabi. libitm/ * configure.tgt: Handle *-*-uclinux*. * configure: Regenerate. libstdc++-v3/ * acinclude.m4: Handle uclinux*. * configure: Regenerate. * configure.host: Handle uclinux* * libtool.m4: Handle uclinux*. Change-Id: I6a1fdcd9847d8a82179a214612a3474c1f492916 -- 2.6.3 diff --git a/config/futex.m4 b/config/futex.m4 index e95144d..4dffe15 100644 --- a/config/futex.m4 +++ b/config/futex.m4 @@ -9,7 +9,7 @@ AC_DEFUN([GCC_LINUX_FUTEX],[dnl GCC_ENABLE(linux-futex,default, ,[use the Linux futex system call], permit yes|no|default) case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then diff --git a/config/tls.m4 b/config/tls.m4 index 1a5fc59..a487aa4 100644 --- a/config/tls.m4 +++ b/config/tls.m4 @@ -76,7 +76,7 @@ AC_DEFUN([GCC_CHECK_TLS], [ dnl Shared library options may depend on the host; this check dnl is only known to be needed for GNU/Linux. case $host in - *-*-linux*) + *-*-linux* | -*-uclinux*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac diff --git a/gcc/config.gcc b/gcc/config.gcc index 8525cb5..6bfa329 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -780,7 +780,7 @@ case ${target} in *-*-fuchsia*) native_system_header_dir=/include ;; -*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) +*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) extra_options="$extra_options gnu-user.opt" gas=yes gnu_ld=yes @@ -789,7 +789,7 @@ case ${target} in esac tmake_file="t-slibgcc" case $target in - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu) + *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) :;; *-*-gnu*) native_system_header_dir=/include @@ -809,7 +809,7 @@ case ${target} in *-*-*android*) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC" ;; - *-*-*uclibc*) + *-*-*uclibc* | *-*-uclinuxfdpiceabi) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ;; *-*-*musl*) @@ -1165,7 +1165,7 @@ arm*-*-netbsdelf*) tmake_file="${tmake_file} arm/t-arm" target_cpu_cname="strongarm" ;; -arm*-*-linux-*) # ARM GNU/Linux with ELF +arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) # ARM GNU/Linux with ELF tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" extra_options="${extra_options} linux-android.opt" case $target in diff --git a/libatomic/configure b/libatomic/configure index e7076a0..10b0287 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -6055,7 +6055,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -8540,7 +8540,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -9135,7 +9135,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -10666,7 +10666,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt index ea8c34f..c1a608f 100644 --- a/libatomic/configure.tgt +++ b/libatomic/configure.tgt @@ -124,7 +124,7 @@ case "${target}" in config_path="${config_path} linux/aarch64 posix" ;; - arm*-*-linux*) + arm*-*-linux* | arm*-*-uclinux*) # OS support for atomic primitives. config_path="${config_path} linux/arm posix" ;; diff --git a/libgcc/config.host b/libgcc/config.host index 1cbc8ac..5419dfc 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -241,7 +241,7 @@ case ${host} in tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia" extra_parts="crtbegin.o crtend.o" ;; -*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) +*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" if test x$enable_vtable_verify = xyes; then @@ -427,7 +427,7 @@ arm*-*-fuchsia*) arm*-*-netbsdelf*) tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" ;; -arm*-*-linux*) # ARM GNU/Linux with ELF +arm*-*-linux* | arm*-*-uclinuxfdpiceabi) # ARM GNU/Linux with ELF tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm" tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" tm_file="$tm_file arm/bpabi-lib.h" diff --git a/libitm/configure b/libitm/configure index fb742d7..7b4c749 100644 --- a/libitm/configure +++ b/libitm/configure @@ -6731,7 +6731,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -9217,7 +9217,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -9812,7 +9812,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -11343,7 +11343,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -13244,7 +13244,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi inherit_rpath_CXX=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -13831,7 +13831,7 @@ interix[3-9]*) postdeps_CXX= ;; -linux*) +linux* | uclinux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 @@ -14082,7 +14082,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -15003,7 +15003,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -16468,7 +16468,7 @@ fi case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then @@ -16591,7 +16591,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinux*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac diff --git a/libitm/configure.tgt b/libitm/configure.tgt index 0cbb097..bc6c3ca 100644 --- a/libitm/configure.tgt +++ b/libitm/configure.tgt @@ -127,7 +127,7 @@ config_path="$ARCH posix generic" # Other system configury case "${target}" in - *-*-linux*) + *-*-linux* | *-*-uclinux*) if test "$enable_linux_futex" = yes; then config_path="linux/$ARCH linux $config_path" fi diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 82a25e5..600912e 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1395,7 +1395,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ ac_has_nanosleep=yes ac_has_sched_yield=yes ;; - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) AC_MSG_CHECKING([for at least GNU libc 2.17]) AC_TRY_COMPILE( [#include ], @@ -1517,7 +1517,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ if test x"$ac_has_clock_monotonic" != x"yes"; then case ${target_os} in - linux*) + linux* | uclinux*) AC_MSG_CHECKING([for clock_gettime syscall]) AC_TRY_COMPILE( [#include @@ -2406,7 +2406,7 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [ # Default to "generic". if test $enable_clocale_flag = auto; then case ${target_os} in - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) enable_clocale_flag=gnu ;; darwin*) @@ -2652,7 +2652,7 @@ AC_DEFUN([GLIBCXX_ENABLE_ALLOCATOR], [ # Default to "new". if test $enable_libstdcxx_allocator_flag = auto; then case ${target_os} in - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) enable_libstdcxx_allocator_flag=new ;; *) @@ -4286,7 +4286,7 @@ AC_DEFUN([GLIBCXX_ENABLE_FILESYSTEM_TS], [ freebsd*|netbsd*|openbsd*|dragonfly*|darwin*) enable_libstdcxx_filesystem_ts=yes ;; - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) enable_libstdcxx_filesystem_ts=yes ;; rtems*) @@ -4434,7 +4434,7 @@ dnl AC_MSG_CHECKING([for sendfile that can copy files]) AC_CACHE_VAL(glibcxx_cv_sendfile, [dnl case "${target_os}" in - gnu* | linux* | solaris*) + gnu* | linux* | solaris* | uclinux*) GCC_TRY_COMPILE_OR_LINK( [#include ], [sendfile(1, 2, (off_t*)0, sizeof 1);], diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 39f83e2..991c99b 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -6647,7 +6647,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -8998,7 +8998,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -9593,7 +9593,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -11133,7 +11133,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -13058,7 +13058,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi inherit_rpath_CXX=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -13645,7 +13645,7 @@ interix[3-9]*) postdeps_CXX= ;; -linux*) +linux* | uclinux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 @@ -13896,7 +13896,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -14817,7 +14817,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -16066,7 +16066,7 @@ fi # Default to "generic". if test $enable_clocale_flag = auto; then case ${target_os} in - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) enable_clocale_flag=gnu ;; darwin*) @@ -16483,7 +16483,7 @@ fi # Default to "new". if test $enable_libstdcxx_allocator_flag = auto; then case ${target_os} in - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) + linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) enable_libstdcxx_allocator_flag=new ;; *) @@ -20757,7 +20757,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_has_nanosleep=yes ac_has_sched_yield=yes ;; - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for at least GNU libc 2.17" >&5 $as_echo_n "checking for at least GNU libc 2.17... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -21257,7 +21257,7 @@ $as_echo "$ac_has_nanosleep" >&6; } if test x"$ac_has_clock_monotonic" != x"yes"; then case ${target_os} in - linux*) + linux* | uclinux*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime syscall" >&5 $as_echo_n "checking for clock_gettime syscall... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28143,7 +28143,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinux*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac @@ -53770,7 +53770,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinux*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac @@ -59957,7 +59957,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinux*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac @@ -78556,7 +78556,7 @@ fi case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then @@ -80185,7 +80185,7 @@ $as_echo_n "checking whether to build Filesystem TS support... " >&6; } freebsd*|netbsd*|openbsd*|dragonfly*|darwin*) enable_libstdcxx_filesystem_ts=yes ;; - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu | uclinux*) enable_libstdcxx_filesystem_ts=yes ;; rtems*) @@ -80609,7 +80609,7 @@ $as_echo_n "checking for sendfile that can copy files... " >&6; } $as_echo_n "(cached) " >&6 else case "${target_os}" in - gnu* | linux* | solaris*) + gnu* | linux* | solaris* | uclinux*) if test x$gcc_no_link = xyes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host index 155a3cd..1c298ab 100644 --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -264,7 +264,7 @@ case "${host_os}" in linux-musl*) os_include_dir="os/generic" ;; - gnu* | linux* | kfreebsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | uclinux*) if [ "$uclibc" = "yes" ]; then os_include_dir="os/uclibc" elif [ "$bionic" = "yes" ]; then @@ -327,7 +327,7 @@ esac # Set any OS-dependent and CPU-dependent bits. # THIS TABLE IS SORTED. KEEP IT THAT WAY. case "${host}" in - *-*-linux*) + *-*-linux* | *-*-uclinux*) case "${host_cpu}" in i[567]86) abi_baseline_pair=i486-linux-gnu @@ -358,7 +358,7 @@ case "${host}" in fi esac case "${host}" in - arm*-*-linux-*) + arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver" ;; esac diff --git a/libtool.m4 b/libtool.m4 index 8966762..afd3f05 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -2449,7 +2449,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -3089,7 +3089,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -3734,7 +3734,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4032,7 +4032,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4449,7 +4449,7 @@ _LT_EOF _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -5946,7 +5946,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -6598,7 +6598,7 @@ interix[[3-9]]*) _LT_TAGVAR(postdeps,$1)= ;; -linux*) +linux* | uclinux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 From patchwork Fri Nov 16 15:47:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151351 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp586415ljp; Fri, 16 Nov 2018 07:49:32 -0800 (PST) X-Google-Smtp-Source: AJdET5cAPHTb5kgHkUYmr7wlb+l/QiKJkGjS5QRUmW86YHKhTiTXCvQ1EewXloz614J7q8Mjh9nv X-Received: by 2002:a17:902:6a8b:: with SMTP id n11-v6mr11530964plk.311.1542383372307; Fri, 16 Nov 2018 07:49:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383372; cv=none; d=google.com; s=arc-20160816; b=Oa7pYZa2ZrW7y6KAGXK2zwY9keUMycUo6C4oji53HHqjtSnLjAMpG12YGfEt4ZDPYI OgLNRwBmlRfIgyYz/sJFAvMSfd1RE2gSLDBcd5ZUzA6YOS3rVwMyLZlJPE+lSox1SqZw 1oTY34uZj8W9ojJYsZLzKKFjImJBXEDcIk1YO7N5+EiWQ9XevHT6NLehNYy+73125yOy Thjxxst1rUoOzGDPBp6GvbGdu89iJdb1Z8gHxKCEt+L+5VFie1WzUafJGsFJk3qXltzH UrFijnPsn3zwYDS+KsQ1QT/t82Ao3MW6WZiLvaGmDjRGhJ/njEBA7VWkxsy6DhWJyQ0X zhkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=YrKjfxlY47OtrjPQg8Cvy8dSGMHEVKeAUTj9G5q5xrA=; b=lBW4NBu5xgemKBlAV3oGrSBVpAV5GC9YfXKfNkyd7MaumHXaZ9lm0SmutuF+K37dSw eyRKAjn++o1nz/nOJ0dz3ImIOVntNZLJF669+4JvdMAhxFR/IW654Q8jWSj5BxQgw0SB sNRDep+CtNB8cSAe/4tXQncJ8K2UgfSxKLP6SmKc6VBbKd7LiE/C03F/kTcjrveXkPo+ ZGrFepD0rCmE3q5szqV9ZRsHW5rMd6hKncad6qoZFDqfrpvVTx9v/mGz6SNbW/q/deLL UXSQ7RUoZQ/Ye+a8HLuUVsKRC6UrgAjSUXQ4vW+XqS8mpku9mim3pOCBBooEeXbQDIFp u4Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KouhnlDI; spf=pass (google.com: domain of gcc-patches-return-490265-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490265-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id r196si24526132pgr.311.2018.11.16.07.49.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:49:32 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490265-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KouhnlDI; spf=pass (google.com: domain of gcc-patches-return-490265-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490265-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=I910vekQHwKLrBRQ1ZdgXDHXMtVDm9F2Kgc7Id7XXp+RwiRlM4v+V NNyhvda+nzcYSUgwEl4807w2rH86ieK2MaIV1Udh1kIt6Vt+P94meRqUZ6EFnQm4 yQGb2OS9utwCxS/qqXJSfMXINvO8d9ZOjvMhb3iW2mpM85Qpw2WnsI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=rS6gWdoEL4HzBgF3w+csR/mF89c=; b=KouhnlDIEwrEBWZPQo1Vz/D27EVK zckVkF6WUVTAWlFtxflChUOhhQBy8vO7rM7CgS357KkBeJRIwantCbKyv+5J3YTL m9jg0jejAgzfwsub5x8sCdUZtVeyOh8cBkvA5tv2VMlZofIb2LFZ2lfLHaiHrkB/ uvoM4DfhcSRm6nw= Received: (qmail 68587 invoked by alias); 16 Nov 2018 15:49:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 67514 invoked by uid 89); 16 Nov 2018 15:49:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Tell X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:49:17 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFio4v002163; Fri, 16 Nov 2018 16:49:14 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nsx068vym-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:49:14 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D7D993F; Fri, 16 Nov 2018 15:49:13 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BC21A5011; Fri, 16 Nov 2018 15:49:13 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:49:13 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 03/20] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided Date: Fri, 16 Nov 2018 16:47:31 +0100 Message-ID: <20181116154808.25154-4-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes In FDPIC mode, we set -fPIE unless the user provides -fno-PIE, -fpie, -fPIC or -fpic: indeed FDPIC code is PIC, but we want to generate code for executables rather than shared libraries by default. We also make sure to use the --fdpic assembler option, and select the appropriate linker emulation. At link time, we also default to -pie, unless we are generating a shared library or a relocatable file (-r). Note that even for static link, we must specify the dynamic linker because the executable still has to relocate itself at startup. We also force 'now' binding since lazy binding is not supported. We should also apply the same behavior for -Wl,-Ur as for -r, but I couldn't find how to describe that in the specs fragment. 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config.gcc: Handle arm*-*-uclinuxfdpiceabi. * config/arm/bpabi.h (TARGET_FDPIC_ASM_SPEC): New. (SUBTARGET_EXTRA_ASM_SPEC): Use TARGET_FDPIC_ASM_SPEC. * config/arm/linux-eabi.h (FDPIC_CC1_SPEC): New. (CC1_SPEC): Use FDPIC_CC1_SPEC. * config/arm/uclinuxfdpiceabi.h: New file. libsanitizer/ * configure.tgt (arm*-*-uclinuxfdpiceabi): Sanitizers are unsupported in this configuration. Change-Id: If369e0a10bb916fd72e38f71498d3c640fa85c4c -- 2.6.3 diff --git a/gcc/config.gcc b/gcc/config.gcc index 6bfa329..975e293 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1175,6 +1175,11 @@ arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) # ARM GNU/Linux with ELF esac tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi" tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h arm/arm.h" + case $target in + arm*-*-uclinuxfdpiceabi) + tm_file="$tm_file arm/uclinuxfdpiceabi.h" + ;; + esac # Generation of floating-point instructions requires at least ARMv5te. if [ "$with_float" = "hard" -o "$with_float" = "softfp" ] ; then target_cpu_cname="arm10e" diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h index 1e3ecfb..5901154 100644 --- a/gcc/config/arm/bpabi.h +++ b/gcc/config/arm/bpabi.h @@ -55,6 +55,8 @@ #define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" +#define TARGET_FDPIC_ASM_SPEC "" + #define BE8_LINK_SPEC \ "%{!r:%{!mbe32:%:be8_linkopt(%{mlittle-endian:little}" \ " %{mbig-endian:big}" \ @@ -64,7 +66,7 @@ /* Tell the assembler to build BPABI binaries. */ #undef SUBTARGET_EXTRA_ASM_SPEC #define SUBTARGET_EXTRA_ASM_SPEC \ - "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC + "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC TARGET_FDPIC_ASM_SPEC #ifndef SUBTARGET_EXTRA_LINK_SPEC #define SUBTARGET_EXTRA_LINK_SPEC "" diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h index 4254b19..af4b740 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -101,11 +101,14 @@ #undef ASAN_CC1_SPEC #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}" +#define FDPIC_CC1_SPEC "" + #undef CC1_SPEC #define CC1_SPEC \ - LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC, \ + LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \ + FDPIC_CC1_SPEC, \ GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \ - ANDROID_CC1_SPEC) + ANDROID_CC1_SPEC "" FDPIC_CC1_SPEC) #define CC1PLUS_SPEC \ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC) diff --git a/gcc/config/arm/uclinuxfdpiceabi.h b/gcc/config/arm/uclinuxfdpiceabi.h new file mode 100644 index 0000000..43a17de --- /dev/null +++ b/gcc/config/arm/uclinuxfdpiceabi.h @@ -0,0 +1,53 @@ +/* Configuration file for ARM GNU/Linux FDPIC EABI targets. + Copyright (C) 2018 Free Software Foundation, Inc. + Contributed by STMicroelectronics. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +/* On uClibc EABI GNU/Linux, we want to force -mfdpic by default, + which also means we produce PIE code by default. */ +#undef FDPIC_CC1_SPEC +#define FDPIC_CC1_SPEC \ + "%{!mno-fdpic:-mfdpic %{!no-PIE:%{!fpie:%{!fPIC:%{!fpic: -fPIE}}}}}" + +/* Add --fdpic assembler flag by default. */ +#undef TARGET_FDPIC_ASM_SPEC +#define TARGET_FDPIC_ASM_SPEC "%{!mno-fdpic: --fdpic}" + +/* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ +#if TARGET_BIG_ENDIAN_DEFAULT +#define TARGET_FDPIC_LINKER_EMULATION "armelfb_linux_fdpiceabi" +#else +#define TARGET_FDPIC_LINKER_EMULATION "armelf_linux_fdpiceabi" +#endif + +/* Unless we generate a shared library or a relocatable object, we + force -pie. */ +/* Even with -static, we have to define the dynamic-linker, as we + have some relocations to resolve at load time. */ +#undef SUBTARGET_EXTRA_LINK_SPEC +#define SUBTARGET_EXTRA_LINK_SPEC \ + "%{!mno-fdpic: -m " TARGET_FDPIC_LINKER_EMULATION \ + "%{!shared:%{!r: -pie}} \ + %{static:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" \ + "%{mno-fdpic: -m " TARGET_LINKER_EMULATION "}" \ + "%{!r:%{!mno-fdpic: -z now}}" + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "%{!mno-fdpic:%{!shared:crtreloc.o%s}} " \ + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC) diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt index b241ddb..c38b3f4 100644 --- a/libsanitizer/configure.tgt +++ b/libsanitizer/configure.tgt @@ -45,6 +45,9 @@ case "${target}" in ;; sparc*-*-solaris2.11*) ;; + arm*-*-uclinuxfdpiceabi) + UNSUPPORTED=1 + ;; arm*-*-linux*) ;; mips*64*-*-linux*) From patchwork Fri Nov 16 15:47:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151352 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp586753ljp; Fri, 16 Nov 2018 07:49:54 -0800 (PST) X-Google-Smtp-Source: AJdET5eRH6qNHU+TYvw6t0aSC2MJSCyXQI/elk+5Oc9XTDyQxkVscBt8qk0kZBnexO8aRjePCJ6i X-Received: by 2002:a62:6ec8:: with SMTP id j191mr203285pfc.198.1542383394251; Fri, 16 Nov 2018 07:49:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383394; cv=none; d=google.com; s=arc-20160816; b=zcpyICwo3r9cHIJv2zgQCrfv2LmNk9yu4ubFESDJUAe8wL9OC1M900Ew2IAxDnk2Ex DWwi7CJn3CJ+AWay+2b6m3yIwzJkqYIehZJSyLO+841MnNfC1XdR4cKSkGgGWEa5YJeO dX1P5pjm4hMk/GbeaBydu6Rqi2V8NtuPn0C19lEcM2zwReG6hMvKEIyyY3AaKoQY8LW4 0RgAJBp3xPhnaLlrwK4GCFQ8CeEsZvNJsN9G0kMgr6A4iOFT4i8hhCU/sTVhQZjX0tfT HzwG6t/Eu1pZkRr5dy6X+5b2eHIKDQAiOSjz5O+1DU53aOaecJ5NeYCZh/RS9XE/FlF+ L0EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=6YtJPaJelOHEsauKg0B7PZ45wFuVhEjSDFjLtrQVRBE=; b=Y0ByKMw6Ndtg34KRIOfNzvwlyh82ixjTnmexZvvLNJHqmmW78wy9YEipuTWYm6EIzh KNd5puIrYF/9G/Xi2gpWvFzobCgDQiMnZeP3zRKgT8wJLtYunHWLsun1tsOxKbz29/+6 M1OaU8Sb5sA464QokOkOiORrR3CyMQ3zkssIaqZ0wdIOU0wUMS8Q5P4/2w9LIoLtImdM sO72hJq4mY52eNeYGHFpy+OhDui1vII3HaBNofbrH+/mb/hTbUqNS00Eu4Y5gn2vt/kf WbhD6ulGhgWOEYJ5Q4ibJD2LS/y5IYE6uXvW2HU4etEr/uXSWBpqLTwX0QTpAJkFVm2O rn/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=qcyEkFVa; spf=pass (google.com: domain of gcc-patches-return-490266-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490266-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 144-v6si17059800pfw.109.2018.11.16.07.49.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:49:54 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490266-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=qcyEkFVa; spf=pass (google.com: domain of gcc-patches-return-490266-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490266-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=c1FLqFSPnK234OFwo/m9yd+Bj2/t2HzIfGrqhxKGT+ExpnaGl2uMU hNcwMHaoW1KDz7sgpTDdtGNxjaUplz/WeitABKSVJ94mIXUA4/0VkNSdL3f77PKZ U4g8Y8V7u0G3px7swvWq0KcZEcywVnaisV3jeCPcEq+uVyDmLrfulE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=bqjAeDDNrBzDM95QYPa3UwD6DxU=; b=qcyEkFVa4IF/0YphNcC1flaMnqiu EhCTNNnB/ZacQJAwWhI2Wc4sEUwHKgOMrehAJW8y1CvDKn1gzeP+eekp32yK3f+p wA+EBS7fCaesJNqLgmnwIn6V3b19mYmLn0QVmPWMDCM5IKy0CHI+6xsI+Jd97uJf EoBKr9DpAItnsgw= Received: (qmail 81652 invoked by alias); 16 Nov 2018 15:49:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 80572 invoked by uid 89); 16 Nov 2018 15:49:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:49:37 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFi9xM008764; Fri, 16 Nov 2018 16:49:34 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nr7cyrfyn-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:49:34 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 39E7E34; Fri, 16 Nov 2018 15:49:34 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 155505012; Fri, 16 Nov 2018 15:49:34 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:49:33 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 04/20] [ARM] FDPIC: Add support for FDPIC for arm architecture Date: Fri, 16 Nov 2018 16:47:32 +0100 Message-ID: <20181116154808.25154-5-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes The FDPIC register is hard-coded to r9, as defined in the ABI. We have to disable tailcall optimizations if we don't know if the target function is in the same module. If not, we have to set r9 to the value associated with the target module. When generating a symbol address, we have to take into account whether it is a pointer to data or to a function, because different relocations are needed. 2018-XX-XX Christophe Lyon Mickaël Guêné * config/arm/arm-c.c (__FDPIC__): Define new pre-processor macro in FDPIC mode. * config/arm/arm-protos.h (arm_load_function_descriptor): Declare new function. * config/arm/arm.c (arm_option_override): Define pic register to FDPIC_REGNUM. (arm_function_ok_for_sibcall): Disable sibcall optimization if we have no decl or go through PLT. (arm_load_pic_register): Handle TARGET_FDPIC. (arm_is_segment_info_known): New function. (arm_pic_static_addr): Add support for FDPIC. (arm_load_function_descriptor): New function. (arm_assemble_integer): Add support for FDPIC. * config/arm/arm.h (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Define. (FDPIC_REGNUM): New define. * config/arm/arm.md (call): Add support for FDPIC. (call_value): Likewise. (*restore_pic_register_after_call): New pattern. (untyped_call): Disable if FDPIC. (untyped_return): Likewise. * config/arm/unspecs.md (UNSPEC_PIC_RESTORE): New. -- 2.6.3 diff --git a/gcc/config/arm/arm-c.c b/gcc/config/arm/arm-c.c index 4471f79..90733cc 100644 --- a/gcc/config/arm/arm-c.c +++ b/gcc/config/arm/arm-c.c @@ -202,6 +202,8 @@ arm_cpu_builtins (struct cpp_reader* pfile) builtin_define ("__ARM_EABI__"); } + def_or_undef_macro (pfile, "__FDPIC__", TARGET_FDPIC); + def_or_undef_macro (pfile, "__ARM_ARCH_EXT_IDIV__", TARGET_IDIV); def_or_undef_macro (pfile, "__ARM_FEATURE_IDIV", TARGET_IDIV); diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 8d6d2395..314f710 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -136,6 +136,7 @@ extern int arm_max_const_double_inline_cost (void); extern int arm_const_double_inline_cost (rtx); extern bool arm_const_double_by_parts (rtx); extern bool arm_const_double_by_immediates (rtx); +extern rtx arm_load_function_descriptor (rtx funcdesc); extern void arm_emit_call_insn (rtx, rtx, bool); bool detect_cmse_nonsecure_call (tree); extern const char *output_call (rtx *); diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 8393f0b..63c68e5 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3475,6 +3475,15 @@ arm_option_override (void) if (flag_pic && TARGET_VXWORKS_RTP) arm_pic_register = 9; + /* If in FDPIC mode then force arm_pic_register to be r9. */ + if (TARGET_FDPIC) + { + arm_pic_register = FDPIC_REGNUM; + if (! TARGET_ARM && ! TARGET_THUMB2) + sorry ("FDPIC mode is supported on architecture versions that " + "support ARM or Thumb-2 only."); + } + if (arm_pic_register_string != NULL) { int pic_register = decode_reg_name (arm_pic_register_string); @@ -7259,6 +7268,21 @@ arm_function_ok_for_sibcall (tree decl, tree exp) if (cfun->machine->sibcall_blocked) return false; + if (TARGET_FDPIC) + { + /* In FDPIC, never tailcall something for which we have no decl: + the target function could be in a different module, requiring + a different FDPIC register value. */ + if (decl == NULL) + return false; + + /* Don't tailcall if we go through the PLT since the FDPIC + register is then corrupted and we don't restore it after + static function calls. */ + if (!targetm.binds_local_p (decl)) + return false; + } + /* Never tailcall something if we are generating code for Thumb-1. */ if (TARGET_THUMB1) return false; @@ -7637,7 +7661,9 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED) { rtx l1, labelno, pic_tmp, pic_rtx, pic_reg; - if (crtl->uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE) + if (crtl->uses_pic_offset_table == 0 + || TARGET_SINGLE_PIC_BASE + || TARGET_FDPIC) return; gcc_assert (flag_pic); @@ -7705,28 +7731,142 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED) emit_use (pic_reg); } +/* Try to determine whether an object, referenced via ORIG, will be + placed in the text or data segment. This is used in FDPIC mode, to + decide which relocations to use when accessing ORIG. IS_READONLY + is set to true if ORIG is a read-only location, false otherwise. + Return true if we could determine the location of ORIG, false + otherwise. IS_READONLY is valid only when we return true. */ +static bool +arm_is_segment_info_known (rtx orig, bool *is_readonly) +{ + bool res = false; + + *is_readonly = false; + + if (GET_CODE (orig) == LABEL_REF) + { + res = true; + *is_readonly = true; + } + else if (SYMBOL_REF_P (orig)) + { + if (CONSTANT_POOL_ADDRESS_P (orig)) + { + res = true; + *is_readonly = true; + } + else if (SYMBOL_REF_LOCAL_P (orig) + && !SYMBOL_REF_EXTERNAL_P (orig) + && SYMBOL_REF_DECL (orig) + && (!DECL_P (SYMBOL_REF_DECL (orig)) + || !DECL_COMMON (SYMBOL_REF_DECL (orig)))) + { + tree decl = SYMBOL_REF_DECL (orig); + tree init = (TREE_CODE (decl) == VAR_DECL) + ? DECL_INITIAL (decl) : (TREE_CODE (decl) == CONSTRUCTOR) + ? decl : 0; + int reloc = 0; + bool named_section, readonly; + + if (init && init != error_mark_node) + reloc = compute_reloc_for_constant (init); + + named_section = TREE_CODE (decl) == VAR_DECL + && lookup_attribute ("section", DECL_ATTRIBUTES (decl)); + readonly = decl_readonly_section (decl, reloc); + + /* We don't know where the link script will put a named + section, so return false in such a case. */ + res = !named_section; + + if (!named_section) + *is_readonly = readonly; + } + else + { + /* We don't know. */ + res = false; + } + } + else + gcc_unreachable (); + + return res; +} + /* Generate code to load the address of a static var when flag_pic is set. */ static rtx_insn * arm_pic_static_addr (rtx orig, rtx reg) { rtx l1, labelno, offset_rtx; + rtx_insn *insn; gcc_assert (flag_pic); - /* We use an UNSPEC rather than a LABEL_REF because this label - never appears in the code stream. */ - labelno = GEN_INT (pic_labelno++); - l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - l1 = gen_rtx_CONST (VOIDmode, l1); + bool is_readonly = false; + bool info_known = false; - /* On the ARM the PC register contains 'dot + 8' at the time of the - addition, on the Thumb it is 'dot + 4'. */ - offset_rtx = plus_constant (Pmode, l1, TARGET_ARM ? 8 : 4); - offset_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, orig, offset_rtx), - UNSPEC_SYMBOL_OFFSET); - offset_rtx = gen_rtx_CONST (Pmode, offset_rtx); + if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && !SYMBOL_REF_FUNCTION_P (orig)) + info_known = arm_is_segment_info_known (orig, &is_readonly); - return emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, labelno)); + if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && !SYMBOL_REF_FUNCTION_P (orig) + && !info_known) + { + /* We don't know where orig is stored, so we have be + pessimistic and use a GOT relocation. */ + rtx pat; + rtx mem; + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + + pat = gen_calculate_pic_address (reg, pic_reg, orig); + + /* Make the MEM as close to a constant as possible. */ + mem = SET_SRC (pat); + gcc_assert (MEM_P (mem) && !MEM_VOLATILE_P (mem)); + MEM_READONLY_P (mem) = 1; + MEM_NOTRAP_P (mem) = 1; + + insn = emit_insn (pat); + } + else if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && (SYMBOL_REF_FUNCTION_P (orig) + || (info_known && !is_readonly))) + { + /* We use the GOTOFF relocation. */ + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + + rtx l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, orig), UNSPEC_PIC_SYM); + emit_insn (gen_movsi (reg, l1)); + insn = emit_insn (gen_addsi3 (reg, reg, pic_reg)); + } + else + { + /* Not FDPIC, not SYMBOL_REF_P or readonly: we can use + PC-relative access. */ + /* We use an UNSPEC rather than a LABEL_REF because this label + never appears in the code stream. */ + labelno = GEN_INT (pic_labelno++); + l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + l1 = gen_rtx_CONST (VOIDmode, l1); + + /* On the ARM the PC register contains 'dot + 8' at the time of the + addition, on the Thumb it is 'dot + 4'. */ + offset_rtx = plus_constant (Pmode, l1, TARGET_ARM ? 8 : 4); + offset_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, orig, offset_rtx), + UNSPEC_SYMBOL_OFFSET); + offset_rtx = gen_rtx_CONST (Pmode, offset_rtx); + + insn = emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, + labelno)); + } + + return insn; } /* Return nonzero if X is valid as an ARM state addressing register. */ @@ -15941,9 +16081,36 @@ get_jump_table_size (rtx_jump_table_data *insn) return 0; } +/* Emit insns to load the function address from FUNCDESC (an FDPIC + function descriptor) into a register and the GOT address into the + FDPIC register, returning an rtx for the register holding the + function address. */ + +rtx +arm_load_function_descriptor (rtx funcdesc) +{ + rtx fnaddr_reg = gen_reg_rtx (Pmode); + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx fnaddr = gen_rtx_MEM (Pmode, funcdesc); + rtx gotaddr = gen_rtx_MEM (Pmode, plus_constant (Pmode, funcdesc, 4)); + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (3)); + + emit_move_insn (fnaddr_reg, fnaddr); + /* The ABI requires the entry point address to be loaded first, so + prevent the load from being moved after that of the GOT + address. */ + XVECEXP (par, 0, 0) = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (2, pic_reg, gotaddr), + UNSPEC_PIC_RESTORE); + XVECEXP (par, 0, 1) = gen_rtx_USE (VOIDmode, gotaddr); + XVECEXP (par, 0, 2) = gen_rtx_CLOBBER (VOIDmode, pic_reg); + emit_insn (par); + + return fnaddr_reg; +} + /* Return the maximum amount of padding that will be inserted before label LABEL. */ - static HOST_WIDE_INT get_label_padding (rtx label) { @@ -22898,9 +23065,37 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) && (!SYMBOL_REF_LOCAL_P (x) || (SYMBOL_REF_DECL (x) ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0)))) - fputs ("(GOT)", asm_out_file); + { + if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) + fputs ("(GOTFUNCDESC)", asm_out_file); + else + fputs ("(GOT)", asm_out_file); + } else - fputs ("(GOTOFF)", asm_out_file); + { + if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) + fputs ("(GOTOFFFUNCDESC)", asm_out_file); + else + { + bool is_readonly; + + if (arm_is_segment_info_known (x, &is_readonly)) + fputs ("(GOTOFF)", asm_out_file); + else + fputs ("(GOT)", asm_out_file); + } + } + } + + /* For FDPIC we also have to mark symbol for .data section. */ + if (TARGET_FDPIC + && NEED_GOT_RELOC + && flag_pic + && !making_const_table + && SYMBOL_REF_P (x)) + { + if (SYMBOL_REF_FUNCTION_P (x)) + fputs ("(FUNCDESC)", asm_out_file); } fputc ('\n', asm_out_file); return true; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 8472312..53c3b0e 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -874,6 +874,9 @@ extern int arm_arch_cmse; Pascal), so the following is not true. */ #define STATIC_CHAIN_REGNUM 12 +/* r9 is the FDPIC register (base register for GOT and FUNCDESC accesses). */ +#define FDPIC_REGNUM 9 + /* Define this to be where the real frame pointer is if it is not possible to work out the offset between the frame pointer and the automatic variables until after register allocation has taken place. FRAME_POINTER_REGNUM @@ -1930,6 +1933,10 @@ extern unsigned arm_pic_register; data addresses in memory. */ #define PIC_OFFSET_TABLE_REGNUM arm_pic_register +/* For FDPIC, the FDPIC register is call-clobbered (otherwise PLT + entries would need to handle saving and restoring it). */ +#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED TARGET_FDPIC + /* We can't directly access anything that contains a symbol, nor can we indirect via the constant pool. One exception is UNSPEC_TLS, which is always PIC. */ diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index c8dc947..1200886 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -8031,6 +8031,23 @@ rtx callee, pat; tree addr = MEM_EXPR (operands[0]); + /* Force FDPIC register (r9) before call. */ + if (TARGET_FDPIC) + { + /* No need to update r9 if calling a static function. + In other words: set r9 for indirect or non-local calls. */ + callee = XEXP (operands[0], 0); + if (!SYMBOL_REF_P (callee) + || !SYMBOL_REF_LOCAL_P (callee) + || arm_is_long_call_p (SYMBOL_REF_DECL (callee))) + { + emit_insn (gen_blockage ()); + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + emit_move_insn (pic_reg, get_hard_reg_initial_val (Pmode, FDPIC_REGNUM)); + emit_insn (gen_rtx_USE (VOIDmode, pic_reg)); + } + } + /* In an untyped call, we can get NULL for operand 2. */ if (operands[2] == NULL_RTX) operands[2] = const0_rtx; @@ -8044,6 +8061,13 @@ : !REG_P (callee)) XEXP (operands[0], 0) = force_reg (Pmode, callee); + if (TARGET_FDPIC && !SYMBOL_REF_P (XEXP (operands[0], 0))) + { + /* Indirect call: set r9 with FDPIC value of callee. */ + XEXP (operands[0], 0) + = arm_load_function_descriptor (XEXP (operands[0], 0)); + } + if (detect_cmse_nonsecure_call (addr)) { pat = gen_nonsecure_call_internal (operands[0], operands[1], @@ -8055,10 +8079,38 @@ pat = gen_call_internal (operands[0], operands[1], operands[2]); arm_emit_call_insn (pat, XEXP (operands[0], 0), false); } + + /* Restore FDPIC register (r9) after call. */ + if (TARGET_FDPIC) + { + /* No need to update r9 if calling a static function. */ + if (!SYMBOL_REF_P (callee) + || !SYMBOL_REF_LOCAL_P (callee) + || arm_is_long_call_p (SYMBOL_REF_DECL (callee))) + { + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + emit_move_insn (pic_reg, get_hard_reg_initial_val (Pmode, FDPIC_REGNUM)); + emit_insn (gen_rtx_USE (VOIDmode, pic_reg)); + emit_insn (gen_blockage ()); + } + } DONE; }" ) +(define_insn "*restore_pic_register_after_call" + [(parallel [(unspec [(match_operand:SI 0 "s_register_operand" "=r,r") + (match_operand:SI 1 "nonimmediate_operand" "r,m")] + UNSPEC_PIC_RESTORE) + (use (match_dup 1)) + (clobber (match_dup 0))]) + ] + "" + "@ + mov\t%0, %1 + ldr\t%0, %1" +) + (define_expand "call_internal" [(parallel [(call (match_operand 0 "memory_operand" "") (match_operand 1 "general_operand" "")) @@ -8119,6 +8171,30 @@ rtx pat, callee; tree addr = MEM_EXPR (operands[1]); + /* Force FDPIC register (r9) before call. */ + if (TARGET_FDPIC) + { + /* No need to update the FDPIC register (r9) if calling a static function. + In other words: set r9 for indirect or non-local calls. */ + callee = XEXP (operands[1], 0); + if (!SYMBOL_REF_P (callee) + || !SYMBOL_REF_LOCAL_P (callee) + || arm_is_long_call_p (SYMBOL_REF_DECL (callee))) + { + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (3)); + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg = + get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + XVECEXP (par, 0, 0) = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (2, fdpic_reg, initial_fdpic_reg), + UNSPEC_PIC_RESTORE); + XVECEXP (par, 0, 1) = gen_rtx_USE (VOIDmode, initial_fdpic_reg); + XVECEXP (par, 0, 2) = gen_rtx_CLOBBER (VOIDmode, fdpic_reg); + emit_insn (par); + } + } + /* In an untyped call, we can get NULL for operand 2. */ if (operands[3] == 0) operands[3] = const0_rtx; @@ -8132,6 +8208,14 @@ : !REG_P (callee)) XEXP (operands[1], 0) = force_reg (Pmode, callee); + if (TARGET_FDPIC + && !SYMBOL_REF_P (XEXP (operands[1], 0))) + { + /* Indirect call: set r9 with FDPIC value of callee. */ + XEXP (operands[1], 0) + = arm_load_function_descriptor (XEXP (operands[1], 0)); + } + if (detect_cmse_nonsecure_call (addr)) { pat = gen_nonsecure_call_value_internal (operands[0], operands[1], @@ -8144,6 +8228,28 @@ operands[2], operands[3]); arm_emit_call_insn (pat, XEXP (operands[1], 0), false); } + /* Restore FDPIC register (r9) after call. */ + if (TARGET_FDPIC) + { + /* No need to update r9 if calling a static function. */ + if (!SYMBOL_REF_P (callee) + || !SYMBOL_REF_LOCAL_P (callee) + || arm_is_long_call_p (SYMBOL_REF_DECL (callee))) + { + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (3)); + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg = + get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + XVECEXP (par, 0, 0) = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (2, fdpic_reg, initial_fdpic_reg), + UNSPEC_PIC_RESTORE); + XVECEXP (par, 0, 1) = gen_rtx_USE (VOIDmode, initial_fdpic_reg); + XVECEXP (par, 0, 2) = gen_rtx_CLOBBER (VOIDmode, fdpic_reg); + emit_insn (par); + } + } + DONE; }" ) @@ -8486,7 +8592,7 @@ (const_int 0)) (match_operand 1 "" "") (match_operand 2 "" "")])] - "TARGET_EITHER" + "TARGET_EITHER && !TARGET_FDPIC" " { int i; @@ -8553,7 +8659,7 @@ (define_expand "untyped_return" [(match_operand:BLK 0 "memory_operand" "") (match_operand 1 "" "")] - "TARGET_EITHER" + "TARGET_EITHER && !TARGET_FDPIC" " { int i; diff --git a/gcc/config/arm/unspecs.md b/gcc/config/arm/unspecs.md index 1941673..349ae0e 100644 --- a/gcc/config/arm/unspecs.md +++ b/gcc/config/arm/unspecs.md @@ -86,6 +86,7 @@ UNSPEC_PROBE_STACK ; Probe stack memory reference UNSPEC_NONSECURE_MEM ; Represent non-secure memory in ARMv8-M with ; security extension + UNSPEC_PIC_RESTORE ; Use to restore fdpic register ]) (define_c_enum "unspec" [ From patchwork Fri Nov 16 15:47:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151353 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp587029ljp; Fri, 16 Nov 2018 07:50:11 -0800 (PST) X-Google-Smtp-Source: AJdET5f0XqFyiOg7FJ6acEAMjtD3ocldY8CFSctYrJK72u7fLNSRJ1s7S8LFDsEcwdYrogmKOCLk X-Received: by 2002:a17:902:6946:: with SMTP id k6mr8193917plt.101.1542383411645; Fri, 16 Nov 2018 07:50:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383411; cv=none; d=google.com; s=arc-20160816; b=BiY1r/RKYaOSFg63rfOrcXpMvy3fbiukCibYMoPNPo2ftp8ETH+ufzWKrV4fec+9wo ExEfXChPnSZ7dNDDeXfwk/3GgmGIOzOpQUoJvAIqPR/OaCD7sH+cQzgmKIXoUXv3YmGF 2u3bygicUOjp2UkCjOr1tzjW31KaAkwk5CzDxw1cjGEIZzBMuOlINIroO7QW0dl11a49 9+LnBRIbpMBorPT/XuDufD5oefrikiucIoAxgGQAiegcmnwWkWsViL3RBVFcgB+cip+T fCMQ/JXA9SJRXrFH2K5H9OWAtJaM0QPQ+f4z8jFrxqvfv7DZ3jTwVip0Nl+eJ6Twe4se fZgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=3Vy0QheEv/32LOyHrIJ0wqWALWc0o6pSk3L7dSne9sM=; b=zxxtE0N/ohsJSoasQ+7K+JWCYjsd3d9T4p30bblLc2I6UIOIFkIzbNLeEeIdHCW7OB 4h/5kxp7vuUG0ovLv20fUutSXvtVPbL57QnRKuO41aT4rHHxJvHIRNUDQXmTLDCGxzvJ JduyF6uytaWB0hU44MPHHwlPQo0MGAj1/DtGt+R9tW67SKEKhp3Y5kc5jZ/ZqCxqsgoC J8s+mMOBhDWHFrXy7ch0rMZlO5k63epkK6XTIKZoV3YprU1xNoHMBvdeSbrLRBrBFbvm CBKVF8nOKijjiVE6BUsaJ47QkNQrpO6qkQo+tMA/demKMmO3Y1C1qRYGqb8tYa2PJKs7 acjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bnf3Zx25; spf=pass (google.com: domain of gcc-patches-return-490267-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490267-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id k190-v6si29980270pgk.261.2018.11.16.07.50.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:50:11 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490267-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=bnf3Zx25; spf=pass (google.com: domain of gcc-patches-return-490267-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490267-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=AGn5xUb1aE1ihCa+l2fMb0ZJHamykglGf3Shm6Lab5XSENYWL/OOw NB1F63ZEBnjcje6lEohk++z8BtuDxCNuNN6+bEce/jmTkHhWF4IpTfUHv5Um1Stl Mrl2moHINshWMH1gf2tb/kqJxqzPSt1uPDPJ91/WEAC03NQ7Sgn8RQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=VIPH3qGuoUMrP9F189Ftz96r7Fw=; b=bnf3Zx254Sv/BCPXoBZHN8XQFJNn qVQjo0utmYMnroYc3H9zRFhJIVTKsiJ1FP789I1QpEueBlaQkOYMIEDlT49biaso S/4cKYK7rt/MFWGfD+G4qbLBBeaenT4maUj7mC9XBef724EgSjDRmlhGgA2dtx33 isXNbJti04KSbPU= Received: (qmail 91437 invoked by alias); 16 Nov 2018 15:50:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 90587 invoked by uid 89); 16 Nov 2018 15:49:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:49:58 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFim6K002148; Fri, 16 Nov 2018 16:49:56 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nsx068w2q-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:49:56 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 61C8338; Fri, 16 Nov 2018 15:49:54 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4B2C25011; Fri, 16 Nov 2018 15:49:54 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:49:53 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 05/20] [ARM] FDPIC: Fix __do_global_dtors_aux and frame_dummy generation Date: Fri, 16 Nov 2018 16:47:33 +0100 Message-ID: <20181116154808.25154-6-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes In FDPIC, we need to make sure __do_global_dtors_aux and frame_dummy are referenced by their address, not by pointers to the function descriptors. 2018-XX-XX Christophe Lyon Mickaël Guêné * libgcc/crtstuff.c: Add support for FDPIC. -- 2.6.3 diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c index d81c527..8d4ce81 100644 --- a/libgcc/crtstuff.c +++ b/libgcc/crtstuff.c @@ -429,9 +429,18 @@ __do_global_dtors_aux (void) #ifdef FINI_SECTION_ASM_OP CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux) #elif defined (FINI_ARRAY_SECTION_ASM_OP) +#if defined(__FDPIC__) +__asm__( + " .section .fini_array\n" + " .align 2\n" + " .word __do_global_dtors_aux\n" +); +asm (TEXT_SECTION_ASM_OP); +#else /* defined(__FDPIC__) */ static func_ptr __do_global_dtors_aux_fini_array_entry[] __attribute__ ((__used__, section(".fini_array"), aligned(sizeof(func_ptr)))) = { __do_global_dtors_aux }; +#endif /* defined(__FDPIC__) */ #else /* !FINI_SECTION_ASM_OP && !FINI_ARRAY_SECTION_ASM_OP */ static void __attribute__((used)) __do_global_dtors_aux_1 (void) @@ -473,9 +482,18 @@ frame_dummy (void) #ifdef __LIBGCC_INIT_SECTION_ASM_OP__ CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__, frame_dummy) #else /* defined(__LIBGCC_INIT_SECTION_ASM_OP__) */ +#if defined(__FDPIC__) +__asm__( + " .section .init_array\n" + " .align 2\n" + " .word frame_dummy\n" +); +asm (TEXT_SECTION_ASM_OP); +#else /* defined(__FDPIC__) */ static func_ptr __frame_dummy_init_array_entry[] __attribute__ ((__used__, section(".init_array"), aligned(sizeof(func_ptr)))) = { frame_dummy }; +#endif /* defined(__FDPIC__) */ #endif /* !defined(__LIBGCC_INIT_SECTION_ASM_OP__) */ #endif /* USE_EH_FRAME_REGISTRY || USE_TM_CLONE_REGISTRY */ From patchwork Fri Nov 16 15:47:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151354 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp587349ljp; Fri, 16 Nov 2018 07:50:32 -0800 (PST) X-Google-Smtp-Source: AJdET5fQBEDRCGwgCkhGdLX8KZigkWFC5szG9jZKpbucir96fbpzhmfqYwcHlUiNXEuojTYF7MIH X-Received: by 2002:a63:26c1:: with SMTP id m184mr9786285pgm.367.1542383432821; Fri, 16 Nov 2018 07:50:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383432; cv=none; d=google.com; s=arc-20160816; b=vD3Anmc1ZZ3T6YC69sBCvcGyo1pLF3eXE7NokVcwncsRKvr/o5uDQhOY3i7S5gvALg j2ycRcF1LwxhvsuL/Y97l1z097r55E0sNSrV1Loq+8RR9z9dh8VfmrkPVFefrVZgXyEx SLe5QVrpgjlP5+VdZ54h3EHrV9NSJC1TfRShcX9NmmVka9o6IbIswbCH61LGyKe4ZVTo xTNoxIbVRteTtYOmQkZUTkWscmVpaFWTvbV5tQPj6MimfRPzS/57jOGCvoe7IjYDv9GJ cx4LrcljA4axgIe2gkdmAF7F+LyFbe9q0IMR9kgyzS65DSGXYimsZg/WHbA6K1+IpZ+Z 1YTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=SHf9hmLLR15jgnBhi0yZubgF1GXPdBQk9Xlcjq1LAkg=; b=fNDH5X4WlyxtCCBd6ybNc15ZSg3pE3/v5c24C6TTe8x06/48W10+utoIQefuIldmFr kkxtOXtrLTUmECWZ9FIIDpfV89bGQPWHilGqeEYq0U8jH0ym1g3nS2pmcdhbK316JeWc D6Tr/5M+MfinLpDQc/quj3n1uZmLFE3Yja4WzM94qGv3Su/TJUrZsx0avaOvPvDTaJM4 lc0aYo70qSgXPkoeu4TTlQzZpDkSeqUeKCH6CKU5Bt7FGY/A57ulZwTmm18Q46IthMjz ENZPsI/+G20Dty599IPRSK1OyfLx8OsyRzJc097fgrfTEBjcc3HJ9z2Fi5qDEGBwknhN zNDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Wq8DRsaW; spf=pass (google.com: domain of gcc-patches-return-490268-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490268-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id o6-v6si36107965pfa.162.2018.11.16.07.50.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:50:32 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490268-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Wq8DRsaW; spf=pass (google.com: domain of gcc-patches-return-490268-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490268-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=nAcvdtIkfCRFhPygOy92Zo1QACCyjfKLdTuncidVBaCjY4QcvgOPp B2+0LZ2WR8Oeud/oF0m05psvbB0i/G54qatd4+Rb/WkvAePs8rmCRgoGgU449Sl+ n36+XOi3POAzTUnLgwigcACvlFwmXRrKwn3WGbGWgw2MoMN78AAy/A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=N0oK8hyBEyComdO0GnEVmKo4Anw=; b=Wq8DRsaWqrqEwHDB80VPHGhXb9NS zcOE5/oTfQ8PboVHdvIADkEfxg9+gcet/ostou/CWZjW2CL+u7xmTmO+DyCaKspx lv18zRoUOLn924ORH6zN3skJMnPPuQJzJNAT5mp1ZOb7GMt9xp/4rjXZaiWK8Sc8 3q67gA6eO0XMTuY= Received: (qmail 106580 invoked by alias); 16 Nov 2018 15:50:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 105637 invoked by uid 89); 16 Nov 2018 15:50:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=enter, cope X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:50:17 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFiA91008773; Fri, 16 Nov 2018 16:50:15 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nr7cyrg38-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:50:15 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id AFC7C31; Fri, 16 Nov 2018 15:50:14 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8EE735015; Fri, 16 Nov 2018 15:50:14 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:50:14 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 06/20] [ARM] FDPIC: Add support for c++ exceptions Date: Fri, 16 Nov 2018 16:47:34 +0100 Message-ID: <20181116154808.25154-7-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes The main difference with existing support is that function addresses are function descriptor addresses instead. This means that all code dealing with function pointers now has to cope with function descriptors instead. For the same reason, Linux kernel helpers can no longer be called by dereferencing their address, so we implement wrappers that directly call the kernel helpers. When restoring a function address, we also have to restore the FDPIC register value (r9). 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * ginclude/unwind-arm-common.h (unwinder_cache): Add reserved5 field. (FDPIC_REGNUM): New define. libgcc/ * config/arm/linux-atomic.c (__kernel_cmpxchg): Add FDPIC support. (__kernel_dmb): Likewise. (__fdpic_cmpxchg): New function. (__fdpic_dmb): New function. * config/arm/unwind-arm.h (FDPIC_REGNUM): New define. (gnu_Unwind_Find_got): New function. (_Unwind_decode_typeinfo_ptr): Add FDPIC support. * unwind-arm-common.inc (UCB_PR_GOT): New. (funcdesc_t): New struct. (get_eit_entry): Add FDPIC support. (unwind_phase2): Likewise. (unwind_phase2_forced): Likewise. (__gnu_Unwind_RaiseException): Likewise. (__gnu_Unwind_Resume): Likewise. (__gnu_Unwind_Backtrace): Likewise. * unwind-pe.h (read_encoded_value_with_base): Likewise. libstdc++/ * libsupc++/eh_personality.cc (get_ttype_entry): Add FDPIC support. -- 2.6.3 diff --git a/gcc/ginclude/unwind-arm-common.h b/gcc/ginclude/unwind-arm-common.h index 8a1a919..150bd0f 100644 --- a/gcc/ginclude/unwind-arm-common.h +++ b/gcc/ginclude/unwind-arm-common.h @@ -91,7 +91,7 @@ extern "C" { _uw reserved2; /* Personality routine address */ _uw reserved3; /* Saved callsite address */ _uw reserved4; /* Forced unwind stop arg */ - _uw reserved5; + _uw reserved5; /* Personality routine GOT value in FDPIC mode. */ } unwinder_cache; /* Propagation barrier cache (valid after phase 1): */ diff --git a/libgcc/config/arm/linux-atomic.c b/libgcc/config/arm/linux-atomic.c index d334c58..f8836ba 100644 --- a/libgcc/config/arm/linux-atomic.c +++ b/libgcc/config/arm/linux-atomic.c @@ -25,11 +25,62 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* Kernel helper for compare-and-exchange. */ typedef int (__kernel_cmpxchg_t) (int oldval, int newval, int *ptr); -#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) 0xffff0fc0) + +#define STR(X) #X +#define XSTR(X) STR(X) + +#define KERNEL_CMPXCHG 0xffff0fc0 + +#if __FDPIC__ +/* Non-FDPIC ABIs call __kernel_cmpxchg directly by dereferencing its + address, but under FDPIC we would generate a broken call + sequence. That's why we have to implement __kernel_cmpxchg and + __kernel_dmb here: this way, the FDPIC call sequence works. */ +#define __kernel_cmpxchg __fdpic_cmpxchg +#else +#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) KERNEL_CMPXCHG) +#endif /* Kernel helper for memory barrier. */ typedef void (__kernel_dmb_t) (void); -#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0) + +#define KERNEL_DMB 0xffff0fa0 + +#if __FDPIC__ +#define __kernel_dmb __fdpic_dmb +#else +#define __kernel_dmb (*(__kernel_dmb_t *) KERNEL_DMB) +#endif + +#if __FDPIC__ +static int __fdpic_cmpxchg (int oldval, int newval, int *ptr) +{ + int result; + + asm volatile ( + "ldr ip, 1f\n\t" + "bx ip\n\t" + "1:\n\t" + ".word " XSTR(KERNEL_CMPXCHG) "\n\t" + : "=r" (result) + : "r" (oldval) , "r" (newval), "r" (ptr) + : "r3", "memory"); + /* The result is actually returned by the kernel helper, we need + this to avoid a warning. */ + return result; +} + +static void __fdpic_dmb (void) +{ + asm volatile ( + "ldr ip, 1f\n\t" + "bx ip\n\t" + "1:\n\t" + ".word " XSTR(KERNEL_DMB) "\n\t" + ); +} + +#endif /* Note: we implement byte, short and int versions of atomic operations using the above kernel helpers; see linux-atomic-64bit.c for "long long" (64-bit) diff --git a/libgcc/config/arm/unwind-arm.h b/libgcc/config/arm/unwind-arm.h index 9f7d3f2..9cb6fd8 100644 --- a/libgcc/config/arm/unwind-arm.h +++ b/libgcc/config/arm/unwind-arm.h @@ -33,9 +33,33 @@ /* Use IP as a scratch register within the personality routine. */ #define UNWIND_POINTER_REG 12 +#define FDPIC_REGNUM 9 + +#define STR(x) #x +#define XSTR(x) STR(x) + #ifdef __cplusplus extern "C" { #endif +_Unwind_Ptr __attribute__((weak)) __gnu_Unwind_Find_got (_Unwind_Ptr); + +static inline _Unwind_Ptr gnu_Unwind_Find_got (_Unwind_Ptr ptr) +{ + _Unwind_Ptr res; + + if (__gnu_Unwind_Find_got) + res = __gnu_Unwind_Find_got (ptr); + else + { + asm volatile ("mov %[result], r" XSTR(FDPIC_REGNUM) + : [result]"=r" (res) + : + :); + } + + return res; +} + /* Decode an R_ARM_TARGET2 relocation. */ static inline _Unwind_Word _Unwind_decode_typeinfo_ptr (_Unwind_Word base __attribute__ ((unused)), @@ -48,7 +72,12 @@ extern "C" { if (!tmp) return 0; -#if (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__) \ +#if __FDPIC__ + /* For FDPIC, we store the offset of the GOT entry. */ + /* So, first get GOT from dynamic linker and then use indirect access. */ + tmp += gnu_Unwind_Find_got (ptr); + tmp = *(_Unwind_Word *) tmp; +#elif (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__) \ || defined(__FreeBSD__) || defined(__fuchsia__) /* Pc-relative indirect. */ #define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_pcrel | DW_EH_PE_indirect) diff --git a/libgcc/unwind-arm-common.inc b/libgcc/unwind-arm-common.inc index 76f8fc3..0d2ec0b 100644 --- a/libgcc/unwind-arm-common.inc +++ b/libgcc/unwind-arm-common.inc @@ -62,6 +62,7 @@ __gnu_Unwind_Find_exidx (_Unwind_Ptr, int *); #define UCB_PR_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved2) #define UCB_SAVED_CALLSITE_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved3) #define UCB_FORCED_STOP_ARG(ucbp) ((ucbp)->unwinder_cache.reserved4) +#define UCB_PR_GOT(ucbp) ((ucbp)->unwinder_cache.reserved5) /* Unwind descriptors. */ @@ -85,6 +86,16 @@ typedef struct __EIT_entry _uw content; } __EIT_entry; +#ifdef __FDPIC__ + +/* Only used in FDPIC case. */ +struct funcdesc_t +{ + unsigned int ptr; + unsigned int got; +}; +#endif + /* Assembly helper functions. */ /* Restore core register state. Never returns. */ @@ -259,7 +270,21 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) { /* One of the predefined standard routines. */ _uw idx = (*(_uw *) ucbp->pr_cache.ehtp >> 24) & 0xf; +#if __FDPIC__ + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) __gnu_unwind_get_pr_addr (idx); + if (funcdesc) + { + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + } + else + UCB_PR_ADDR (ucbp) = 0; + } +#else UCB_PR_ADDR (ucbp) = __gnu_unwind_get_pr_addr (idx); +#endif if (UCB_PR_ADDR (ucbp) == 0) { /* Failed */ @@ -270,6 +295,10 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) { /* Execute region offset to PR */ UCB_PR_ADDR (ucbp) = selfrel_offset31 (ucbp->pr_cache.ehtp); +#if __FDPIC__ + UCB_PR_GOT (ucbp) + = (unsigned int) gnu_Unwind_Find_got ((_Unwind_Ptr) UCB_PR_ADDR (ucbp)); +#endif } return _URC_OK; } @@ -291,14 +320,29 @@ unwind_phase2 (_Unwind_Control_Block * ucbp, phase2_vrs * vrs) UCB_SAVED_CALLSITE_ADDR (ucbp) = VRS_PC(vrs); /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_UNWIND_FRAME_STARTING, ucbp, (_Unwind_Context *) vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_UNWIND_FRAME_STARTING, ucbp, (_Unwind_Context *) vrs); +#endif } while (pr_result == _URC_CONTINUE_UNWIND); if (pr_result != _URC_INSTALL_CONTEXT) abort(); +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + vrs->core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (vrs)); +#endif + uw_restore_core_regs (vrs, &vrs->core); } @@ -346,8 +390,18 @@ unwind_phase2_forced (_Unwind_Control_Block *ucbp, phase2_vrs *entry_vrs, next_vrs = saved_vrs; /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (action, ucbp, (void *) &next_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (action, ucbp, (void *) &next_vrs); +#endif saved_vrs.prev_sp = VRS_SP (&next_vrs); } @@ -384,6 +438,11 @@ unwind_phase2_forced (_Unwind_Control_Block *ucbp, phase2_vrs *entry_vrs, return _URC_FAILURE; } +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + saved_vrs.core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (&saved_vrs)); +#endif + uw_restore_core_regs (&saved_vrs, &saved_vrs.core); } @@ -429,8 +488,18 @@ __gnu_Unwind_RaiseException (_Unwind_Control_Block * ucbp, return _URC_FAILURE; /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_VIRTUAL_UNWIND_FRAME, ucbp, (void *) &saved_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_VIRTUAL_UNWIND_FRAME, ucbp, (void *) &saved_vrs); +#endif } while (pr_result == _URC_CONTINUE_UNWIND); @@ -488,13 +557,27 @@ __gnu_Unwind_Resume (_Unwind_Control_Block * ucbp, phase2_vrs * entry_vrs) } /* Call the cached PR. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_UNWIND_FRAME_RESUME, ucbp, (_Unwind_Context *) entry_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_UNWIND_FRAME_RESUME, ucbp, (_Unwind_Context *) entry_vrs); +#endif switch (pr_result) { case _URC_INSTALL_CONTEXT: /* Upload the registers to enter the landing pad. */ +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + entry_vrs->core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (entry_vrs)); +#endif uw_restore_core_regs (entry_vrs, &entry_vrs->core); case _URC_CONTINUE_UNWIND: @@ -586,9 +669,20 @@ __gnu_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument, } /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + code = ((personality_routine) &funcdesc) + (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND, + ucbp, (void *) &saved_vrs); + } +#else code = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND, ucbp, (void *) &saved_vrs); +#endif } while (code != _URC_END_OF_STACK && code != _URC_FAILURE); diff --git a/libgcc/unwind-pe.h b/libgcc/unwind-pe.h index dd5ae95..9c5177f 100644 --- a/libgcc/unwind-pe.h +++ b/libgcc/unwind-pe.h @@ -259,10 +259,27 @@ read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base, if (result != 0) { +#if __FDPIC__ + /* FDPIC relative addresses imply taking the GOT address + into account. */ + if ((encoding & DW_EH_PE_pcrel) && (encoding & DW_EH_PE_indirect)) + { + result += gnu_Unwind_Find_got ((_Unwind_Ptr) u); + result = *(_Unwind_Internal_Ptr *) result; + } + else + { + result += ((encoding & 0x70) == DW_EH_PE_pcrel + ? (_Unwind_Internal_Ptr) u : base); + if (encoding & DW_EH_PE_indirect) + result = *(_Unwind_Internal_Ptr *) result; + } +#else result += ((encoding & 0x70) == DW_EH_PE_pcrel ? (_Unwind_Internal_Ptr) u : base); if (encoding & DW_EH_PE_indirect) result = *(_Unwind_Internal_Ptr *) result; +#endif } } diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc index 1b336c7..7b26b8d 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -93,7 +93,15 @@ get_ttype_entry (lsda_header_info *info, _uleb128_t i) _Unwind_Ptr ptr; i *= size_of_encoded_value (info->ttype_encoding); - read_encoded_value_with_base (info->ttype_encoding, info->ttype_base, + read_encoded_value_with_base ( +#if __FDPIC__ + /* Force these flags to nake sure to + take the GOT into account. */ + (DW_EH_PE_pcrel | DW_EH_PE_indirect), +#else + info->ttype_encoding, +#endif + info->ttype_base, info->TType - i, &ptr); return reinterpret_cast(ptr); From patchwork Fri Nov 16 15:47:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151355 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp587721ljp; Fri, 16 Nov 2018 07:50:55 -0800 (PST) X-Google-Smtp-Source: AJdET5cmNXsBcPR4DOL/IOogcTA/DXGI6bDfrvhbrlBZDvRsmPEkMQnHdSbm2dEPUghM2VeuE79W X-Received: by 2002:a62:114c:: with SMTP id z73-v6mr11405522pfi.192.1542383454943; Fri, 16 Nov 2018 07:50:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383454; cv=none; d=google.com; s=arc-20160816; b=a2Hbi5UGfQ9W2P4BmxomVM5xCrYq6iQyEm+CA3QBR8Kg9Ta9zTjJgruHVAmoMPjCtn DhD21jBMtIsxApIANw4p7mdfDG4y2c2b1kqDbEsygLmyATqGYItq+u6lSY1lINtOB8LK YcBWdL3QcWAVEDbQ5KBiC7b4Jb8N1G8Wyj1B7vrLInIrOGKfuldp/2fpLHs8b1GKICWi HA0K6+LBgbqPcP9/z7Mxyow9rj92M0uIUQol5rZmi2iaMBCDM0unqgVgrUu+I02mKmsS G5ZfVkjbd8GLlaGULPyMzmpQjtDyRanH2+sl9VlS7Npxx01rr7EnxMmnAM/JDbqANWVY 4PSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=DoOplgRwLWcxdaybOaJYQAZ/032SIA92JMlAg8Rxryk=; b=rR6CHOTovexz8Qxre0AxDJgzX/doPxLZHbDsYYSqnA4azLXFGtf5cE53Ols9+RGy91 Tj34iAFKxhgZMCvLBGv49msi+VIT0govfCy2AVYXVl0UclV2Nh7NOqVQprzl99iUFOxu OH1LtkxJPLcR2Say+PfPtgXOA+TU9iavsfZz9GY4/Dg+evUs9TsKMINnXzpceI+esmiv LpdgleJBl5jW5WX+UxVMlHUVGlKtfkqHjowxErOUhB+Jq+7VRER7VlK2bw4EfDiRD/vk hEefPOVe0g+ImgYq2St5XCgtZGCM5yDXTle/BK834nd+7UK9C+22HIckjza2K0jXtcgm NKvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gChOhnAX; spf=pass (google.com: domain of gcc-patches-return-490269-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490269-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b22-v6si35960327pff.192.2018.11.16.07.50.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:50:54 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490269-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gChOhnAX; spf=pass (google.com: domain of gcc-patches-return-490269-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490269-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=LXQ3el3JOH8cwc6d2y/5RUPK+rjO4+RJHvWpYt4pJJ34OHGnkKGFh PuATAQGjlWEgcy0g4Bzi+lxdI0CombDL84jQB/cGNosARlXc+WgJwaMExwlReDkk pEpg0cuK4JMb/uDB5jQ4OJSWjxXk14ktPc1kkGiJfMY+mSeZEm93lM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=EY3Lwdol7UFgRfjACdUT5mTasCw=; b=gChOhnAX35Lyo821oatT8/RdNzuc b7NVNx9kyUCZBI084QNyv5IZBoSmn7bv1yYNCut15JvLpofQZpqE0eP8Tv2kxHCK luGeT4lmeTIZvrMvITiLZqQGJy7VqwhsAe0T/OFowqqvPg8zTrP8CmilykojfhKp 1yn3i8oCKfv9KlQ= Received: (qmail 118825 invoked by alias); 16 Nov 2018 15:50:39 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 117731 invoked by uid 89); 16 Nov 2018 15:50:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:50:37 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFikRu002137; Fri, 16 Nov 2018 16:50:35 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nsx068w6c-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:50:35 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E3D0634; Fri, 16 Nov 2018 15:50:34 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CB7A45015; Fri, 16 Nov 2018 15:50:34 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:50:34 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 07/20] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is read-only Date: Fri, 16 Nov 2018 16:47:35 +0100 Message-ID: <20181116154808.25154-8-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.h (PIC_REGISTER_MAY_NEED_SAVING): New helper. * config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Handle FDPIC. Change-Id: I0f3b2023ab2a2a0433dfe081dac6bbb194b7a76c -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 63c68e5..7e7f747 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -19480,9 +19480,7 @@ arm_compute_save_reg0_reg12_mask (void) save_reg_mask |= (1 << reg); /* Also save the pic base register if necessary. */ - if (flag_pic - && !TARGET_SINGLE_PIC_BASE - && arm_pic_register != INVALID_REGNUM + if (PIC_REGISTER_MAY_NEED_SAVING && crtl->uses_pic_offset_table) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; } @@ -19514,9 +19512,7 @@ arm_compute_save_reg0_reg12_mask (void) /* If we aren't loading the PIC register, don't stack it even though it may be live. */ - if (flag_pic - && !TARGET_SINGLE_PIC_BASE - && arm_pic_register != INVALID_REGNUM + if (PIC_REGISTER_MAY_NEED_SAVING && (df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM) || crtl->uses_pic_offset_table)) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 53c3b0e..35a2bd2 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1949,6 +1949,13 @@ extern unsigned arm_pic_register; || label_mentioned_p (get_pool_constant (X))))) \ || tls_mentioned_p (X)) +/* We may want to save the PIC register if it is a dedicated one. */ +#define PIC_REGISTER_MAY_NEED_SAVING \ + (flag_pic \ + && !TARGET_SINGLE_PIC_BASE \ + && !TARGET_FDPIC \ + && arm_pic_register != INVALID_REGNUM) + /* We need to know when we are making a constant pool; this determines whether data needs to be in the GOT or can be referenced via a GOT offset. */ From patchwork Fri Nov 16 15:47:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151356 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp587986ljp; Fri, 16 Nov 2018 07:51:11 -0800 (PST) X-Google-Smtp-Source: AJdET5d6FC+mogEDwZhhxFwpIvvFKdkEsclkVRoa1BdVNRXXzVsFC7q8dKJvN4N4wJqd7prbNyqh X-Received: by 2002:a62:5d0c:: with SMTP id r12mr12107460pfb.0.1542383471534; Fri, 16 Nov 2018 07:51:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383471; cv=none; d=google.com; s=arc-20160816; b=EJ5/c+vRUoghirxsXb5Gq7wnFIsCrDNMffKBBhqFbTHD0nkngjpPM+KvbOux9Vt0Vd chctmtUav6NMBHxkB/tn7d2YwNaDKYbOac0AflM46eQhaxXeB9EtvaY88/6FFx1wRQH2 S0y53OGTs3dsI4H+ZOSoB6AGJnK4HXJgZyBxOaaH2IsFRcMTlRPiaKUgyZL68Pibb6G2 EMKdlz11i1n0jp0vIUaCBSpr6lTkipDjPkHb3oZN19FBVRB9ikvHPJ9WUP0+KU8ugVtl roUGteyr3r2tJkYYtUHihzVbr28TuUawKCnqIE9xmyNGZB/KowtWwucd9Bu4T5wG2qzO vq6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=O9N8xG/f1B8MUgTe0pkCwXyF7I7fCofINDcpI+47q40=; b=0NcI3dcO6+HmXhGWTguqd8ebEKo/oy8DUczTV+ewBGgnPuoE/Dr0DeF4/EXHLlUujp DoqguUVlJtDyCxmRe9sYdSvncMjdBJ+m5kL4WC30U1xUvP1YL3F7krcmWsayKZOEQlD5 KTyPgS8LgA1OOsxPkTuuUx4869v+Z9QVAQJL8iGJFurMSKnIop9icG8/XU06mlUN9p+i 1WZq0Gwalh5O19IMTSMQk4VhknznHb35wYtkA3oO4VeP1Jz9c0kIlau50eOAYGcvQ5qm Anmzr8ytAto0HYvzQB9fWZ8mE7J7Qhc1H5CJQnMM4dwI+qV2Qzrs1UmT51BW7mZwfoSz rctw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=AY+2fTtp; spf=pass (google.com: domain of gcc-patches-return-490270-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490270-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 131-v6si33388995pfx.213.2018.11.16.07.51.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:51:11 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490270-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=AY+2fTtp; spf=pass (google.com: domain of gcc-patches-return-490270-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490270-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=u6XwWMsGVGIhJwPPX0LRsXY20rk+1wCs7tEBNxXLNo/TL1CY8m5C2 YPengSWcXpKJb/g61wpF3G4PxoDgqbH8qp4aP5mZMcoUNDfDhrPiWIqdF6kS5L6+ 6iZJtockvxU42uVd5DDiFSs9ddU3anD2brKW5OOBUMuKxPZ3YZhVnM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=zVCPwOcTSDdCGVF9BrpduJYNB0g=; b=AY+2fTtph5csym088/Ul7Cy2QRLe b4PSdPg9jz6ucRlTeaEM/S3nZ+R/+H8mtSK4vWlVyo2TUHgXXKJ72LPppAAWdRbL +yLO9APhkivOqy0YuwM7Y57u/kzxF1PELI9I1BowPvfkc1q8fdhWv1yhADrNsXS0 YWGmaFMKE+qMq0c= Received: (qmail 127360 invoked by alias); 16 Nov 2018 15:50:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 126363 invoked by uid 89); 16 Nov 2018 15:50:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:50:57 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFilWu002140; Fri, 16 Nov 2018 16:50:55 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nsx068w7u-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:50:55 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1B85634; Fri, 16 Nov 2018 15:50:55 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 095295015; Fri, 16 Nov 2018 15:50:55 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:50:54 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 08/20] [ARM] FDPIC: Enforce local/global binding for function descriptors Date: Fri, 16 Nov 2018 16:47:36 +0100 Message-ID: <20181116154808.25154-9-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Use local binding rules to decide whether we can use GOTOFFFUNCDESC to compute the function address. 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_local_funcdesc_p): New function. (legitimize_pic_address): Enforce binding rules on function pointers in FDPIC mode. (arm_assemble_integer): Likewise. Change-Id: I3fa0b63bc0f672903f405aa72cc46052de1c0feb -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 7e7f747..ca53eae 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3777,6 +3777,42 @@ arm_options_perform_arch_sanity_checks (void) } } +/* Test whether a local function descriptor is canonical, i.e., + whether we can use GOTOFFFUNCDESC to compute the address of the + function. */ +static bool +arm_fdpic_local_funcdesc_p (rtx fnx) +{ + tree fn; + enum symbol_visibility vis; + bool ret; + + if (!TARGET_FDPIC) + return TRUE; + + if (! SYMBOL_REF_LOCAL_P (fnx)) + return FALSE; + + fn = SYMBOL_REF_DECL (fnx); + + if (! fn) + return FALSE; + + vis = DECL_VISIBILITY (fn); + + if (vis == VISIBILITY_PROTECTED) + /* Private function descriptors for protected functions are not + canonical. Temporarily change the visibility to global so that + we can ensure uniqueness of funcdesc pointers. */ + DECL_VISIBILITY (fn) = VISIBILITY_DEFAULT; + + ret = default_binds_local_p_1 (fn, flag_pic); + + DECL_VISIBILITY (fn) = vis; + + return ret; +} + static void arm_add_gc_roots (void) { @@ -7494,7 +7530,9 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg) || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig) && (SYMBOL_REF_DECL (orig) - ? !DECL_WEAK (SYMBOL_REF_DECL (orig)) : 1))) + ? !DECL_WEAK (SYMBOL_REF_DECL (orig)) : 1) + && (!SYMBOL_REF_FUNCTION_P (orig) + || arm_fdpic_local_funcdesc_p (orig)))) && NEED_GOT_RELOC && arm_pic_data_is_text_relative) insn = arm_pic_static_addr (orig, reg); @@ -23060,7 +23098,9 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) || (GET_CODE (x) == SYMBOL_REF && (!SYMBOL_REF_LOCAL_P (x) || (SYMBOL_REF_DECL (x) - ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0)))) + ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0) + || (SYMBOL_REF_FUNCTION_P (x) + && !arm_fdpic_local_funcdesc_p (x))))) { if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) fputs ("(GOTFUNCDESC)", asm_out_file); From patchwork Fri Nov 16 15:47:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151357 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp588485ljp; Fri, 16 Nov 2018 07:51:38 -0800 (PST) X-Google-Smtp-Source: AJdET5dMpuXaCXGArt01gAo8HRCo+lc0roR464OWQ4jnWIkADYoAnMKuElUbK+LUddw2MRNGfD03 X-Received: by 2002:a17:902:5a4d:: with SMTP id f13mr11731248plm.49.1542383498085; Fri, 16 Nov 2018 07:51:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383498; cv=none; d=google.com; s=arc-20160816; b=AHQILl/6DuoOIpkys8UadDncECLYCNwiie/bQw2nt2PXnKilhbgTVg3AgjUjH/QhhD 9nsDf/LtNVaHmwMLjpQj0z0ZZ0tzOov4f910lwJYdJjraUVVRO2hQC0Ymi8tlQ6aRS/D 0etZn38ScQyKwXq4mml19POmZhIOqMmHk1rYfLSerx5zuKfTthlSJNgYoUH8qA9WM4X+ 99NuI0H1z3t7F6uQrLwb4ZHqidTnKn5scKYbsv/gv860+YjgPk3HZACk0HkKafmqwTn6 jeZb7qQF+rrhvQe3CSjuyoAlAwyLdU8K7mlIMAa51mzrJ7b75/DioDFrxjSLtgtxDzKJ daWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=WZyVB7p2Ni9OcXRQXmrMXZ8mHWor4XFROT7XMnLU3xc=; b=K1y+/xA0LzifX3tEwxf7FiXhXblLFL4gYCHXE4w1fJZbq/3HG9iz6v+0AW1b62yMzd /eu218DHyzdntWGEIs61fhGCwe61eaL/BQaJ/fYSpYOYLnlLJkQEWH4F37dkph5az1un ZtzxKnkRkv4tdsIuRchXiRAFl8L//3tAtUzN3nt7ZHkL+NVuSmQQBoDIXA0tdRyIrJKB phWPoUnqsNFL0EFAWvRN2Iumct1tkY+81N6nOrfv+lOjE8tdXgLUoJydiuo2MxQLhEMq rBHA7SztC7M9ROuIY0MNcv0kHztz00zEzltdhlXOfr5xeahGGLKXL5BemtP2VrM0YWkG GYLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=AI3hnOKb; spf=pass (google.com: domain of gcc-patches-return-490272-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490272-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b19si6000181pfm.100.2018.11.16.07.51.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:51:38 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490272-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=AI3hnOKb; spf=pass (google.com: domain of gcc-patches-return-490272-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490272-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=WRBeAHV2AGq6QbuWdZBdB7bZ6oqhtSxfzJhjDXtMoRqGlk0bXtbf8 QomrJBaBoJPQ5X8w8/IU3whqXTg14TxN5apQrABVCzZhYvBZtV9+4w8KyVxkQqN0 /6dlHE3bUHQvZjqZYeIkzG4pKBa3rtDsAVyF2zJ9q7q58NK2Y6PK4Q= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=AbwnA+mTEbRkxJves91C6FHr+3k=; b=AI3hnOKbgpc+sEcHS3txmstkluR+ Y8rx4vq/ROxkM7pcXg5UuUGMTQLkK4RYH2oxRJVkIaizgD4ZWFHvwG0ZhAuvg/th 9/PZ6NhRU+WmWgRl0kbxVJg9xSd7vX+iLN/3YXOPzNa/DPQH6/hA7AW90dJavHue bOrzlAhZxtl7Bhs= Received: (qmail 3349 invoked by alias); 16 Nov 2018 15:51:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 3233 invoked by uid 89); 16 Nov 2018 15:51:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=IOR, trampoline_size, trampoline, TRAMPOLINE_SIZE X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:51:18 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFiXU2030555; Fri, 16 Nov 2018 16:51:16 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2nsxqxrpfq-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:51:16 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5D74B3A; Fri, 16 Nov 2018 15:51:15 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 43EF45019; Fri, 16 Nov 2018 15:51:15 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:51:14 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 09/20] [ARM] FDPIC: Add support for taking address of nested function Date: Fri, 16 Nov 2018 16:47:37 +0100 Message-ID: <20181116154808.25154-10-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes In FDPIC mode, the trampoline generated to support pointers to nested functions looks like: .word trampoline address .word trampoline GOT address ldr r12, [pc, #8] ldr r9, [pc, #8] ldr pc, [pc, #8] .word static chain value .word GOT address .word function's address because in FDPIC function pointers are actually pointers to function descriptors, we have to actually generate a function descriptor for the trampoline. 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_asm_trampoline_template): Add FDPIC support. (arm_trampoline_init): Likewise. (arm_trampoline_init): Likewise. * config/arm/arm.h (TRAMPOLINE_SIZE): Likewise. -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index ca53eae..8c2b9d0 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3963,13 +3963,50 @@ arm_warn_func_return (tree decl) .word static chain value .word function's address XXX FIXME: When the trampoline returns, r8 will be clobbered. */ +/* In FDPIC mode, the trampoline looks like: + .word trampoline address + .word trampoline GOT address + ldr r12, [pc, #8] ; #4 for Thumb2 + ldr r9, [pc, #8] ; #4 for Thumb2 + ldr pc, [pc, #8] ; #4 for Thumb2 + .word static chain value + .word GOT address + .word function's address +*/ static void arm_asm_trampoline_template (FILE *f) { fprintf (f, "\t.syntax unified\n"); - if (TARGET_ARM) + if (TARGET_FDPIC) + { + /* The first two words are a function descriptor pointing to the + trampoline code just below. */ + if (TARGET_ARM) + fprintf (f, "\t.arm\n"); + else if (TARGET_THUMB2) + fprintf (f, "\t.thumb\n"); + else + /* Only ARM and Thumb-2 are supported. */ + gcc_unreachable (); + + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + /* Trampoline code which sets the static chain register but also + PIC register before jumping into real code. */ + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + STATIC_CHAIN_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + PIC_OFFSET_TABLE_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + PC_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + } + else if (TARGET_ARM) { fprintf (f, "\t.arm\n"); asm_fprintf (f, "\tldr\t%r, [%r, #0]\n", STATIC_CHAIN_REGNUM, PC_REGNUM); @@ -4010,12 +4047,40 @@ arm_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) emit_block_move (m_tramp, assemble_trampoline_template (), GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL); - mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 8 : 12); - emit_move_insn (mem, chain_value); + if (TARGET_FDPIC) + { + rtx funcdesc = XEXP (DECL_RTL (fndecl), 0); + rtx fnaddr = gen_rtx_MEM (Pmode, funcdesc); + rtx gotaddr = gen_rtx_MEM (Pmode, plus_constant (Pmode, funcdesc, 4)); + /* The function start address is at offset 8, but in Thumb mode + we want bit 0 set to 1 to indicate Thumb-ness, hence 9 + below. */ + rtx trampoline_code_start + = plus_constant (Pmode, XEXP (m_tramp, 0), TARGET_THUMB2 ? 9 : 8); + + /* Write initial funcdesc which points to the trampoline. */ + mem = adjust_address (m_tramp, SImode, 0); + emit_move_insn (mem, trampoline_code_start); + mem = adjust_address (m_tramp, SImode, 4); + emit_move_insn (mem, gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM)); + /* Setup static chain. */ + mem = adjust_address (m_tramp, SImode, 20); + emit_move_insn (mem, chain_value); + /* GOT + real function entry point. */ + mem = adjust_address (m_tramp, SImode, 24); + emit_move_insn (mem, gotaddr); + mem = adjust_address (m_tramp, SImode, 28); + emit_move_insn (mem, fnaddr); + } + else + { + mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 8 : 12); + emit_move_insn (mem, chain_value); - mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 12 : 16); - fnaddr = XEXP (DECL_RTL (fndecl), 0); - emit_move_insn (mem, fnaddr); + mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 12 : 16); + fnaddr = XEXP (DECL_RTL (fndecl), 0); + emit_move_insn (mem, fnaddr); + } a_tramp = XEXP (m_tramp, 0); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), @@ -4029,7 +4094,9 @@ arm_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) static rtx arm_trampoline_adjust_address (rtx addr) { - if (TARGET_THUMB) + /* For FDPIC don't fix trampoline address since it's a function + descriptor and not a function address. */ + if (TARGET_THUMB && !TARGET_FDPIC) addr = expand_simple_binop (Pmode, IOR, addr, const1_rtx, NULL, 0, OPTAB_LIB_WIDEN); return addr; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 35a2bd2..8e30a23 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1584,7 +1584,7 @@ typedef struct #define INIT_EXPANDERS arm_init_expanders () /* Length in units of the trampoline for entering a nested function. */ -#define TRAMPOLINE_SIZE (TARGET_32BIT ? 16 : 20) +#define TRAMPOLINE_SIZE (TARGET_FDPIC ? 32 : (TARGET_32BIT ? 16 : 20)) /* Alignment required for a trampoline in bits. */ #define TRAMPOLINE_ALIGNMENT 32 From patchwork Fri Nov 16 15:47:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151358 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp588668ljp; Fri, 16 Nov 2018 07:51:52 -0800 (PST) X-Google-Smtp-Source: AJdET5cs7LrbiS7tMqKfrcCXIh8WTvsdDTREOdi4Mikt2GgKd5MNkzf/ShUCpAeIZ5/c3/WOKTZy X-Received: by 2002:a63:8549:: with SMTP id u70mr10472302pgd.401.1542383512495; Fri, 16 Nov 2018 07:51:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383512; cv=none; d=google.com; s=arc-20160816; b=NDtMoaXveDxFThjmz6wLAy9iFcBbsf5Hqd+t8Y2mqCwMuigJ7qPW/4hjieXAcTsgGt q4UpvB7S+GD8/zcxtambrAFtMZ0ix3ap+GX7ZA2XYYPhxycrhx0N3y6taj4h41VBhIgV pCdnju4FnPvj/nolbD6rhNa7buP1BPqjDyfGqvH3RYPIA6RmwjO6N3N5stVkQvhYuf6j va4E+nfRuh7lXb/v0XEn9hLU6RH4+/3ZWN0yGAI5PsONz3hzOoJsNgY7UWx8rpzLAiok qFOL/nwXErhVKlQ6010q723CYctNOw4hB+EiIAT8pfxTHj6CLdi4rxyqh7mVeiGrR4lD wpyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=Y+65n+MrGtfqtAAj4dUZjenJKa26gISj0iHYYR/UB6c=; b=c3/8Nla6h8Gkzd2X9Q5QORtOATeEjZLsFXi7EL7b+owngvVEYZ3i6Nu1ayeUvFu32/ beEf3lxFINQ7BelDi7xs1pk44y+Wsu2ph9e9jiq0pTkn74JlDzIQV82jTwhkcaetQRho 1QdzkytNAJWxdrC66LSPIPw1ZjkapS4kemqmGq92dNnYy20K6lkN0ZCXcNL3xzCuiuCa ERZRO8YzRE1SOI0IKG3WYP+ZMLwf0TQGq+4GjZ3JdcoBQAv2lYqWWgwfxhWgzB+oNOyP OF1n6JSFoC7R5We8jk80+zBxh8js+/ZLSkd0pO92+N+9XANZA9kz4KOSi/V/cZwv40vG 8xsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VwLOacfK; spf=pass (google.com: domain of gcc-patches-return-490273-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490273-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id r68-v6si35040595pfk.151.2018.11.16.07.51.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:51:52 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490273-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VwLOacfK; spf=pass (google.com: domain of gcc-patches-return-490273-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490273-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=lF8AjZ6MCusweBRXggXQ6Dh9NBmf3rFAPvEMG87feC0vDM9+bmwVK N4msp18mX5dptSRZq69YkzO0HLlIEg1nvf6quayWp4bbX/6uDLNog+wlNeqTDFbq iiRpSyjimcmvTtZfT+3eFP2mfkR2DfNrpsp8dvXQgK0wy7gTLkZEXA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=EGi/T6VJe5wE8U7Vq752A9QF3xs=; b=VwLOacfKxSJxqQn0oE7txHldnNeY RxYQwBFay6OSgNUXJckYlLr+mW1hEXuDMW6KNZA0Ac5MaUTiRW6D8WCx86XGiFaS 5hQ50EAlDcW4g3XL8YfKOrVRN+6U7xYeHfsTY9hMD4engcYzPCWs9XcTXwGKq10b krh0LM80XX3aAms= Received: (qmail 9351 invoked by alias); 16 Nov 2018 15:51:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 8549 invoked by uid 89); 16 Nov 2018 15:51:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=reg_equiv, REG_EQUIV, optimizers X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:51:38 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFi9xk008764; Fri, 16 Nov 2018 16:51:36 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nr7cyrg8x-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:51:36 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E20D438; Fri, 16 Nov 2018 15:51:35 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C4AF35019; Fri, 16 Nov 2018 15:51:35 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:51:34 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 10/20] [ARM] FDPIC: Implement TLS support. Date: Fri, 16 Nov 2018 16:47:38 +0100 Message-ID: <20181116154808.25154-11-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Support additional relocations: TLS_GD32_FDPIC, TLS_LDM32_FDPIC, and TLS_IE32_FDPIC. We do not support the GNU2 TLS dialect. 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (tls_reloc): Add TLS_GD32_FDPIC, TLS_LDM32_FDPIC and TLS_IE32_FDPIC. (arm_call_tls_get_addr): Add FDPIC support. (legitimize_tls_address): Likewise. (arm_emit_tls_decoration): Likewise. Change-Id: I4ea5034ff654540c4658d0a79fb92f70550cdf4a -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 8c2b9d0..47e8203 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2373,9 +2373,12 @@ char arm_arch_name[] = "__ARM_ARCH_PROFILE__"; enum tls_reloc { TLS_GD32, + TLS_GD32_FDPIC, TLS_LDM32, + TLS_LDM32_FDPIC, TLS_LDO32, TLS_IE32, + TLS_IE32_FDPIC, TLS_LE32, TLS_DESCSEQ /* GNU scheme */ }; @@ -8685,20 +8688,34 @@ arm_call_tls_get_addr (rtx x, rtx reg, rtx *valuep, int reloc) gcc_assert (reloc != TLS_DESCSEQ); start_sequence (); - labelno = GEN_INT (pic_labelno++); - label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - label = gen_rtx_CONST (VOIDmode, label); + if (TARGET_FDPIC) + { + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (reloc)), + UNSPEC_TLS); + } + else + { + labelno = GEN_INT (pic_labelno++); + label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + label = gen_rtx_CONST (VOIDmode, label); - sum = gen_rtx_UNSPEC (Pmode, - gen_rtvec (4, x, GEN_INT (reloc), label, - GEN_INT (TARGET_ARM ? 8 : 4)), - UNSPEC_TLS); + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (4, x, GEN_INT (reloc), label, + GEN_INT (TARGET_ARM ? 8 : 4)), + UNSPEC_TLS); + } reg = load_tls_operand (sum, reg); - if (TARGET_ARM) - emit_insn (gen_pic_add_dot_plus_eight (reg, reg, labelno)); + if (TARGET_FDPIC) + { + emit_insn (gen_addsi3 (reg, reg, gen_rtx_REG (Pmode, FDPIC_REGNUM))); + } else - emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); + if (TARGET_ARM) + emit_insn (gen_pic_add_dot_plus_eight (reg, reg, labelno)); + else + emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); *valuep = emit_library_call_value (get_tls_get_addr (), NULL_RTX, LCT_PURE, /* LCT_CONST? */ @@ -8733,6 +8750,7 @@ arm_tls_descseq_addr (rtx x, rtx reg) return reg; } + rtx legitimize_tls_address (rtx x, rtx reg) { @@ -8745,6 +8763,9 @@ legitimize_tls_address (rtx x, rtx reg) case TLS_MODEL_GLOBAL_DYNAMIC: if (TARGET_GNU2_TLS) { + if (TARGET_FDPIC) + gcc_unreachable(); + reg = arm_tls_descseq_addr (x, reg); tp = arm_load_tp (NULL_RTX); @@ -8754,7 +8775,10 @@ legitimize_tls_address (rtx x, rtx reg) else { /* Original scheme */ - insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32); + if (TARGET_FDPIC) + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32_FDPIC); + else + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32); dest = gen_reg_rtx (Pmode); emit_libcall_block (insns, dest, ret, x); } @@ -8763,6 +8787,9 @@ legitimize_tls_address (rtx x, rtx reg) case TLS_MODEL_LOCAL_DYNAMIC: if (TARGET_GNU2_TLS) { + if (TARGET_FDPIC) + gcc_unreachable(); + reg = arm_tls_descseq_addr (x, reg); tp = arm_load_tp (NULL_RTX); @@ -8771,7 +8798,10 @@ legitimize_tls_address (rtx x, rtx reg) } else { - insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32); + if (TARGET_FDPIC) + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32_FDPIC); + else + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32); /* Attach a unique REG_EQUIV, to allow the RTL optimizers to share the LDM result with other LD model accesses. */ @@ -8790,23 +8820,35 @@ legitimize_tls_address (rtx x, rtx reg) return dest; case TLS_MODEL_INITIAL_EXEC: - labelno = GEN_INT (pic_labelno++); - label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - label = gen_rtx_CONST (VOIDmode, label); - sum = gen_rtx_UNSPEC (Pmode, - gen_rtvec (4, x, GEN_INT (TLS_IE32), label, - GEN_INT (TARGET_ARM ? 8 : 4)), - UNSPEC_TLS); - reg = load_tls_operand (sum, reg); - - if (TARGET_ARM) - emit_insn (gen_tls_load_dot_plus_eight (reg, reg, labelno)); - else if (TARGET_THUMB2) - emit_insn (gen_tls_load_dot_plus_four (reg, NULL, reg, labelno)); + if (TARGET_FDPIC) + { + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (TLS_IE32_FDPIC)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + emit_insn (gen_addsi3 (reg, reg, gen_rtx_REG (Pmode, FDPIC_REGNUM))); + emit_move_insn (reg, gen_rtx_MEM (Pmode, reg)); + } else { - emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); - emit_move_insn (reg, gen_const_mem (SImode, reg)); + labelno = GEN_INT (pic_labelno++); + label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + label = gen_rtx_CONST (VOIDmode, label); + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (4, x, GEN_INT (TLS_IE32), label, + GEN_INT (TARGET_ARM ? 8 : 4)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + + if (TARGET_ARM) + emit_insn (gen_tls_load_dot_plus_eight (reg, reg, labelno)); + else if (TARGET_THUMB2) + emit_insn (gen_tls_load_dot_plus_four (reg, NULL, reg, labelno)); + else + { + emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); + emit_move_insn (reg, gen_const_mem (SImode, reg)); + } } tp = arm_load_tp (NULL_RTX); @@ -28041,15 +28083,24 @@ arm_emit_tls_decoration (FILE *fp, rtx x) case TLS_GD32: fputs ("(tlsgd)", fp); break; + case TLS_GD32_FDPIC: + fputs ("(tlsgd_fdpic)", fp); + break; case TLS_LDM32: fputs ("(tlsldm)", fp); break; + case TLS_LDM32_FDPIC: + fputs ("(tlsldm_fdpic)", fp); + break; case TLS_LDO32: fputs ("(tlsldo)", fp); break; case TLS_IE32: fputs ("(gottpoff)", fp); break; + case TLS_IE32_FDPIC: + fputs ("(gottpoff_fdpic)", fp); + break; case TLS_LE32: fputs ("(tpoff)", fp); break; From patchwork Fri Nov 16 15:47:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151359 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp588994ljp; Fri, 16 Nov 2018 07:52:13 -0800 (PST) X-Google-Smtp-Source: AJdET5fJO3UwYIQB1sUOInQiKPAvEDk1y2HHErOJt0FDKuQgeQoUMVcA1fxPG++BF1NAeoV7CSsL X-Received: by 2002:a63:680a:: with SMTP id d10mr10476861pgc.396.1542383533039; Fri, 16 Nov 2018 07:52:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383533; cv=none; d=google.com; s=arc-20160816; b=pteBFBYicBAZWv23Bmdry/wdf09byH/MmnuFJHgfGfySJwFR3LAzfFdR16UvomZ3l4 m4rM1VCaL2xox9BiaXiFmMuF832Cv5Fr6/DR/d16Rh/eVvl5Sk2iYUtuaapiMWFRrgQK V0CMKIY2VwMaJVyeN/bCvcIEx9ybUgBeIFTWPFin1P+NWQAVjPoN07Xj50ZxDF//rPgt ygCcRik4c24J5bUuPLb+OEtpKAsXdIe2mSUyDzABSB67TeVBdlIQKHnPl7ef+yd1rl9q zyrOyQkZkiZ7ko8rOks/yKSD7vGRPv4l0eg4bLhbM0M+r21CcF2JSgP9khW1J52GbRuG ZOAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=csVkohY9p5ABBjT141HIuB82C0uVjhSv5KqNQidVFBo=; b=Uzyy/DJgRXSwmlbcNGqWXfUM8Kqe9nkvnc6OovrzZ/G7KtHCZe1HLK+3o2CFb8KTS8 o2BFxdAMe/wwSIdtNM/cuyU2ztZbw+jOX4ZV/gW0358cFSCKm+Hpng6ZGVTSVhp6wDcR nPaQKyb0c1KFg3sdVk0OuqTpPZr7U4yD26BftNFdXSWF4mN0FHERAk71F80NeNXfIEqD 9X8uAwxu+pE+1HWIPSHGGeIM9xA6n9wReSE1/8Zx4ekHsX1iVaGOBd/XGoOQtvWcaJTT Xi7EJqglHQTX3TODCtus7VWl3qVFg6WO3x/w/5BvMQcl+nyUsYsokLHKF3Sq3AgtTb1u 1llA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VimAQ0NI; spf=pass (google.com: domain of gcc-patches-return-490274-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490274-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 28si28006700pgz.593.2018.11.16.07.52.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:52:13 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490274-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VimAQ0NI; spf=pass (google.com: domain of gcc-patches-return-490274-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490274-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=HtBaDMx9btybO+0a6L4uCE6IsZ+WLb4jdJrxyPGbiB6BN/GEqjFUR OIq6GmGRH2VAV8dbtYeocVTDcztQxrDYF88YmEABn/hS92Mdok3CI796ASScSUAU Glp55DPSZrTkHX6joNDslzvIKryutog7aljQCC/Lz+SXUXCTLNi2eY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=uAf7ok1GPaboK+yYjplterNRiiE=; b=VimAQ0NIy3Kg2sVcX+ilBExuoJG5 xW9CDAGXboHASEy73rIFy/zDLw6gSzHRSK2IpB/GVisiBSNxcYghpLbnNcteIWHw /G9VExYN7p1hU1hvM+DR5E1qcxBZprZVqbt22L91DvWjcJr4Nq3mJJKLoFbSjuej C5fNeffvSoW5FOk= Received: (qmail 13348 invoked by alias); 16 Nov 2018 15:52:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 13328 invoked by uid 89); 16 Nov 2018 15:52:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:51:58 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFi9G7008767; Fri, 16 Nov 2018 16:51:56 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nr7cyrgaj-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:51:56 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E113634; Fri, 16 Nov 2018 15:51:55 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C6BEC501A; Fri, 16 Nov 2018 15:51:55 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:51:55 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 11/20] [ARM] FDPIC: Add support to unwind FDPIC signal frame Date: Fri, 16 Nov 2018 16:47:39 +0100 Message-ID: <20181116154808.25154-12-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes 2018-XX-XX Christophe Lyon Mickaël Guêné libgcc/ * unwind-arm-common.inc (ARM_SET_R7_RT_SIGRETURN) (THUMB2_SET_R7_RT_SIGRETURN, FDPIC_LDR_R12_WITH_FUNCDESC) (FDPIC_LDR_R9_WITH_GOT, FDPIC_LDR_PC_WITH_RESTORER) (FDPIC_FUNCDESC_OFFSET, ARM_NEW_RT_SIGFRAME_UCONTEXT) (ARM_UCONTEXT_SIGCONTEXT, ARM_SIGCONTEXT_R0, FDPIC_T2_LDR_R12_WITH_FUNCDESC) (FDPIC_T2_LDR_R9_WITH_GOT, FDPIC_T2_LDR_PC_WITH_RESTORER): New. (__gnu_personality_sigframe_fdpic): New. (get_eit_entry): Add FDPIC signal frame support. Change-Id: I7f9527cc50665dd1a731b7badf71c319fb38bf57 -- 2.6.3 diff --git a/libgcc/unwind-arm-common.inc b/libgcc/unwind-arm-common.inc index 0d2ec0b..3151957 100644 --- a/libgcc/unwind-arm-common.inc +++ b/libgcc/unwind-arm-common.inc @@ -30,6 +30,26 @@ #include #endif +#if __FDPIC__ +/* Load r7 with rt_sigreturn value. */ +#define ARM_SET_R7_RT_SIGRETURN 0xe3a070ad /* mov r7, #0xad */ +#define THUMB2_SET_R7_RT_SIGRETURN 0x07adf04f /* mov.w r7, #0xad */ + +/* FDPIC jump to restorer sequence. */ +#define FDPIC_LDR_R12_WITH_FUNCDESC 0xe59fc004 /* ldr r12, [pc, #4] */ +#define FDPIC_LDR_R9_WITH_GOT 0xe59c9004 /* ldr r9, [r12, #4] */ +#define FDPIC_LDR_PC_WITH_RESTORER 0xe59cf000 /* ldr pc, [r12] */ +#define FDPIC_T2_LDR_R12_WITH_FUNCDESC 0xc008f8df /* ldr.w r12, [pc, #8] */ +#define FDPIC_T2_LDR_R9_WITH_GOT 0x9004f8dc /* ldr.w r9, [r12, #4] */ +#define FDPIC_T2_LDR_PC_WITH_RESTORER 0xf000f8dc /* ldr.w pc, [r12] */ +#define FDPIC_FUNCDESC_OFFSET 12 + +/* Signal frame offsets. */ +#define ARM_NEW_RT_SIGFRAME_UCONTEXT 0x80 +#define ARM_UCONTEXT_SIGCONTEXT 0x14 +#define ARM_SIGCONTEXT_R0 0xc +#endif + /* We add a prototype for abort here to avoid creating a dependency on target headers. */ extern void abort (void); @@ -199,6 +219,45 @@ search_EIT_table (const __EIT_entry * table, int nrec, _uw return_address) } } +#if __FDPIC__ +/* VFP is not restored, but this is sufficient to allow unwinding. */ +static _Unwind_Reason_Code +__gnu_personality_sigframe_fdpic (_Unwind_State state, + _Unwind_Control_Block *ucbp, + _Unwind_Context *context) +{ + unsigned int sp; + unsigned int pc; + unsigned int funcdesc; + unsigned int handler; + unsigned int first_handler_instruction; + int i; + + _Unwind_VRS_Get (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, &sp); + _Unwind_VRS_Get (context, _UVRSC_CORE, R_PC, _UVRSD_UINT32, &pc); + + funcdesc = *(unsigned int *)((pc & ~1) + FDPIC_FUNCDESC_OFFSET); + handler = *(unsigned int *)(funcdesc); + first_handler_instruction = *(unsigned int *)(handler & ~1); + + /* Adjust SP to point to the start of registers according to + signal type. */ + if (first_handler_instruction == ARM_SET_R7_RT_SIGRETURN + || first_handler_instruction == THUMB2_SET_R7_RT_SIGRETURN) + sp += ARM_NEW_RT_SIGFRAME_UCONTEXT + + ARM_UCONTEXT_SIGCONTEXT + + ARM_SIGCONTEXT_R0; + else + sp += ARM_UCONTEXT_SIGCONTEXT + + ARM_SIGCONTEXT_R0; + /* Restore regs saved on stack by the kernel. */ + for (i = 0; i < 16; i++) + _Unwind_VRS_Set (context, _UVRSC_CORE, i, _UVRSD_UINT32, sp + 4 * i); + + return _URC_CONTINUE_UNWIND; +} +#endif + /* Find the exception index table eintry for the given address. Fill in the relevant fields of the UCB. Returns _URC_FAILURE if an error occurred, _URC_OK on success. */ @@ -222,6 +281,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) &nrec); if (!eitp) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_FAILURE; } @@ -236,6 +316,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) if (!eitp) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_FAILURE; } @@ -244,6 +345,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) /* Can this frame be unwound at all? */ if (eitp->content == EXIDX_CANTUNWIND) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_END_OF_STACK; } From patchwork Fri Nov 16 15:47:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151360 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp589320ljp; Fri, 16 Nov 2018 07:52:34 -0800 (PST) X-Google-Smtp-Source: AJdET5d8EDFNEP44ryUbfbTIjqJuEkQgIAa/w/pd8pplcyEe/ETiTkrHU03lfuzmj+K3kY/WY1sS X-Received: by 2002:a17:902:b103:: with SMTP id q3-v6mr11422296plr.83.1542383554539; Fri, 16 Nov 2018 07:52:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383554; cv=none; d=google.com; s=arc-20160816; b=OoAXH36mQquGQJNV9EmK2B3KwJAf6j0JG3dwC4OKKg5k+k8w36fsicJOYli0PcVJml g02UgD7VyvHAB43o3Mn8a7m4Jb1E18NbodLIgG5sYWOwj03hw/kHtBGz2HtzWdfOFKFc 2MwZSiG5hrpDjGf7gMTrLUlKpXvDM9qYQklhEr1PegeaSzy1qFDvkq4yrW8uztXjkjFq w+WFjn4l83qEwLyRm+1VTfjWiSqLRc70uX6caALvuiwXdQjK81iCSf947zH8/rSKysq0 7wKE4ljEyNZJ6p5FiwactIzLs0qMROk3cCpMUMyw4MCAz1Z698IU2ZElwS57CQPHBv9H g9NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=JojYzwZplUfWBd9fNbYvfNjLNQMeKm1ACWqlpjUAGfI=; b=lXW5Qd4g9eGmw6cmnSIuevekFUqbsIqd2uDzrAEpJDPCAFUeAE2opp1VFEF04QNZHd 4xQTMwCJSz5ozkJmx6iDSr0GPJ4YjS3f7yJBsiZUqHcfm+1Tfd6YxMBMjZAgOQGry5Eq /6+nEObYOpOBo/JH8rg4ebpDHAJnMm+9eyjD23fXShAdRiOZoIZ4jSYZcyf3/EPmffc/ 31Qa9EFf61T1aRQ6aSin6Ke2J+X4tNWOg8gHyfCjIXz0LT4VnG/Z7176YURxx2DtJKQN 0ARw21z15hLQ6F/wWJ9RKcGKULW9JAIil/Gy0F/eFYOrJkBcc2YmWayjNgkCkg+M+ulO 3pLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uN7jM8ga; spf=pass (google.com: domain of gcc-patches-return-490275-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490275-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 37si29912039pgs.447.2018.11.16.07.52.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:52:34 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490275-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uN7jM8ga; spf=pass (google.com: domain of gcc-patches-return-490275-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490275-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=FyrO6V3MGkxD6lh4eCJ/QiMgpNAuetdbr0ICYDms3uuiX3Luqv5Nx Y5tHfhpJdwjzYHn9NmDqXlEq9vPXTJN9rf6dD4f4soUm357MvUedqtdwtwdhFSMq BK6bgqRsLsvFIj+tD+PoiGmChBi/hOG81nsBtmvE5qdC6IPEW+UFpo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=A+/nwgQ2UBkHJNXumMmXWz2zAc8=; b=uN7jM8ga9prMSPjmCXNIhoVzS+0W YRQeHjC3IrzRm9dQq1YcNXqEDIDDmlHCgyIIZun6hy+s3fQb0/frqS/Ogu9C+oQe KD5CwuZjR8+tdPWvHimLDEE1DhCD0a92QceApR/bmU12YTtHDO+pZ60vmn31mXW2 i4jtCfeSv6iWhn4= Received: (qmail 15102 invoked by alias); 16 Nov 2018 15:52:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 15071 invoked by uid 89); 16 Nov 2018 15:52:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:52:19 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFilX5002140; Fri, 16 Nov 2018 16:52:16 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nsx068wdk-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:52:16 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 720C734; Fri, 16 Nov 2018 15:52:16 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5E30D501D; Fri, 16 Nov 2018 15:52:16 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:52:15 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 12/20] [ARM] FDPIC: Restore r9 after we call __aeabi_read_tp Date: Fri, 16 Nov 2018 16:47:40 +0100 Message-ID: <20181116154808.25154-13-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes We call __aeabi_read_tp() to get the thread pointer. Since this is a function call, we have to restore the FDPIC register afterwards. 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_load_tp): Add FDPIC support. * config/arm/arm.md (load_tp_soft_fdpic): New pattern. (load_tp_soft): Disable in FDPIC mode. -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 47e8203..f2df815 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -8657,7 +8657,25 @@ arm_load_tp (rtx target) rtx tmp; - emit_insn (gen_load_tp_soft ()); + if (TARGET_FDPIC) + { + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (3)); + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg = get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + emit_insn (gen_load_tp_soft_fdpic ()); + + /* Restore r9. */ + XVECEXP (par, 0, 0) = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (2, fdpic_reg, + initial_fdpic_reg), + UNSPEC_PIC_RESTORE); + XVECEXP (par, 0, 1) = gen_rtx_USE (VOIDmode, initial_fdpic_reg); + XVECEXP (par, 0, 2) = gen_rtx_CLOBBER (VOIDmode, fdpic_reg); + emit_insn (par); + } + else + emit_insn (gen_load_tp_soft ()); tmp = gen_rtx_REG (SImode, R0_REGNUM); emit_move_insn (target, tmp); diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 1200886..c6b4461 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -11485,12 +11485,25 @@ ) ;; Doesn't clobber R1-R3. Must use r0 for the first operand. +(define_insn "load_tp_soft_fdpic" + [(set (reg:SI 0) (unspec:SI [(const_int 0)] UNSPEC_TLS)) + (clobber (reg:SI 9)) + (clobber (reg:SI LR_REGNUM)) + (clobber (reg:SI IP_REGNUM)) + (clobber (reg:CC CC_REGNUM))] + "TARGET_SOFT_TP && TARGET_FDPIC" + "bl\\t__aeabi_read_tp\\t@ load_tp_soft" + [(set_attr "conds" "clob") + (set_attr "type" "branch")] +) + +;; Doesn't clobber R1-R3. Must use r0 for the first operand. (define_insn "load_tp_soft" [(set (reg:SI 0) (unspec:SI [(const_int 0)] UNSPEC_TLS)) (clobber (reg:SI LR_REGNUM)) (clobber (reg:SI IP_REGNUM)) (clobber (reg:CC CC_REGNUM))] - "TARGET_SOFT_TP" + "TARGET_SOFT_TP && !TARGET_FDPIC" "bl\\t__aeabi_read_tp\\t@ load_tp_soft" [(set_attr "conds" "clob") (set_attr "type" "branch")] From patchwork Fri Nov 16 15:47:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151361 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp589616ljp; Fri, 16 Nov 2018 07:52:53 -0800 (PST) X-Google-Smtp-Source: AJdET5e148UhCroHp/StGSvUXx+BJuizmysy0Dd3iCQAubrSErTluzK65ZSXMIRdySxGswEKSU1t X-Received: by 2002:a63:4c04:: with SMTP id z4mr10470912pga.312.1542383573023; Fri, 16 Nov 2018 07:52:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383573; cv=none; d=google.com; s=arc-20160816; b=Jx1EAwSowoJwZlUO9K3Rtwd/SeUUgKr/CCi6HvAsqExfhWmbY+423NNeFnpg7vWQOo n1/zhD0wo+KuC2PKAxsgG6cnmVfqY+9KfVGazxPegm+q/dIsgVS3JTae4FyDV91L2drQ xnpMx3lSxvcjJ7ZIsFN5LAQnHRiZxxXnNZ7kUZS1RF+yM5aAR8vEu5mg/j2PoTeRdQaP ewtgRacW2egW5h4VH9/LOJZH19pUc3EDJw/ERiXHjA/MuaJl0F1yNsyIX0F7ydmOFNWF 3OHPKgZ7k1WBgSIeLyyEz2mhdV5UMmwCSUaNPcVfR/ourDvHppD2wRT4xroW2r0Ld6NI LhDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=cHl2PUgm9VZrqHbeIwCfV/Fb2uBseeIxyXbkvN/1eMM=; b=npwRwrxoXBZUqivvgOJGuivEOyC3q5VPRw8XCjulRQDX2WEYjS5C6mNpTMy5uCLizZ ElrDLVeGlxd2ZIZCl1VHaEAuUoVafzgMTWbILW/RO+kyAJfNk+KHUVICbe0m83GoAktI +Y4byhuVgOA9oGSVD5N30RMb5JN99AhQLg9tD+yb0kiA9DI51/GL8tRPRtheefnp0dtx ypGsalyo8epYXcp+F7GH4yZy2RZWA3feWx7hzdhN/EHR6SWfyb9WlkDiVz2rhuN2ws8r EUf9cYJ/ooBhP2hcVR3iGHk/In748M4UtNIoZOVpFs7pz4KImg8oX7sF7MtzUaCq9Lr7 Sflg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=u7fOxF2e; spf=pass (google.com: domain of gcc-patches-return-490276-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490276-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g5-v6si29397117pgl.419.2018.11.16.07.52.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:52:53 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490276-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=u7fOxF2e; spf=pass (google.com: domain of gcc-patches-return-490276-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490276-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=vW6bC7GPQKrsXqqKN4R1F5EchneCT4pKztiqAkiKnYFBqouBghi7+ m1ygzSfnjsrbrBZNNIWAgcWcqij3QY3R/QjFvFyDuihEYRlkbH8wGEqCjfy1u+L/ yZjGoB41gFmtx8ZCMrm+OENKCfS2WvwwZsho1SzbvnJRQVnujSskRU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=ZJbCtrZZwervOlkyJTUg8ylnKDw=; b=u7fOxF2ejoDkvcl/2kfRQtCH2OwZ kGDAJ4R4EZ2s5JO2Vr127QS6pHBez7EOG5Ex0g4Vy49KhvMfR74CHqnpUiCjAwsf lcg3e12fF97tE0E+OofhjoHhYt6RHzK6sq+yUpwQ5G54gDSke1/u7bAl9HU2Uzkm yicJNhejcQpln/4= Received: (qmail 19557 invoked by alias); 16 Nov 2018 15:52:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 19546 invoked by uid 89); 16 Nov 2018 15:52:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:52:39 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFiNul030535; Fri, 16 Nov 2018 16:52:37 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2nsxqxrpnm-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:52:37 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5B6313A; Fri, 16 Nov 2018 15:52:36 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 466B02CFA; Fri, 16 Nov 2018 15:52:36 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:52:35 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 13/20] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture Date: Fri, 16 Nov 2018 16:47:41 +0100 Message-ID: <20181116154808.25154-14-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Without this, when we are unwinding across a signal frame we can jump to an even address which leads to an exception. This is needed in __gnu_persnality_sigframe_fdpic() when restoring the PC from the signal frame since the PC saved by the kernel has the LSB bit set to zero. 2018-XX-XX Christophe Lyon Mickaël Guêné libgcc/ * config/arm/unwind-arm.c (_Unwind_VRS_Set): Handle v7m architecture. Change-Id: Ie84de548226bcf1751e19a09e8f091fb3013ccea -- 2.6.3 diff --git a/libgcc/config/arm/unwind-arm.c b/libgcc/config/arm/unwind-arm.c index 564e4f13..6da6e3d 100644 --- a/libgcc/config/arm/unwind-arm.c +++ b/libgcc/config/arm/unwind-arm.c @@ -198,6 +198,11 @@ _Unwind_VRS_Result _Unwind_VRS_Set (_Unwind_Context *context, return _UVRSR_FAILED; vrs->core.r[regno] = *(_uw *) valuep; +#if defined(__ARM_ARCH_7M__) + /* Force LSB bit since we always run thumb code. */ + if (regno == 15) + vrs->core.r[regno] |= 1; +#endif return _UVRSR_OK; case _UVRSC_VFP: From patchwork Fri Nov 16 15:47:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151362 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp589992ljp; Fri, 16 Nov 2018 07:53:15 -0800 (PST) X-Google-Smtp-Source: AJdET5c9OjBD2cAsmEn6ry+QUdLFgrnm9DH44V/J5T4tHM6r7X8ybd3NI8CpVTzgfIaLEGhRY0sQ X-Received: by 2002:a63:af18:: with SMTP id w24mr10499059pge.385.1542383595790; Fri, 16 Nov 2018 07:53:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383595; cv=none; d=google.com; s=arc-20160816; b=Qwlg4Q8Hv5V0peUysXqVvGjQ15GH1CPDikLgEIT5nQlcEh79Wm5CWgfX957uF0Zuyw 6saXwOYAVrlsuESm9tdjm9I27+9ewXTSFzUMDKCaW2v293+kS08vehIRPVfNOr/o1wRR dURigdgOQArR0A2tCxvGVT2ONZjI20PtJdeVK0m0btUGPuGDC53AixEjJzYmNlgenQwo bxjOxhD2zLlw5G8GGCWEnxeyWzwf5uk13r3wRaWi+uqJHEl0aAvt9t+3zHXxsoIGdHKg WFM6vqT4O8eITkho2D7/D2xuroyBJBZfQ452NXwc3LTRyQmnOFYMnqtbx2RUa3y+7IS9 Kx2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=xOARhbFqVvjaiYoSvGl3pnjAhzbjANILBk6A/J1yAAo=; b=OZnaq08awYtfqu2JdDl7f8nhXEitGqWs6Mman1CZQPV8qRNn6TLYjdW5wOhp8ZLaRm PPOsJIuqDxfJxPSoaurqKWt6URXVVFqT51HXQ+Mqu6OrlhKaMBelmzcR1wiIP57QhMAu CNeIqlpMux9V5GQhyRvD2Wd7o++tCjXZ1+qWNotr95U4YYSffmuzzExq4aZFmYXjehZk PZsc9rVzSV1CWn/7m6w9EkRUINBG2zG6Xb2vzEeSXIhiFvBVonUAcQWXeEkco2c3CpMk vkxTcadkCD9WDsiWhIbZ0pQXfr87O0wP2VtBmHwSbNq3lex+lH8BEdYDWr2IOIXvzsRK MEjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=sT6upkGU; spf=pass (google.com: domain of gcc-patches-return-490277-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490277-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id x12si8114033pgf.454.2018.11.16.07.53.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:53:15 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490277-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=sT6upkGU; spf=pass (google.com: domain of gcc-patches-return-490277-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490277-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=gmOk+LRBwtRFI3agXT0gI4tk4s9n6Ui3/wJrFk+tefoCmRuQUeHZ8 XB9Xfn2933CLZbQvcTSMs3NEeU++/IBN08NXA5wmeAK/3eGtmyAto1VEqtaoK4Xs asxpyFUn/FGJzljCITc3AJT0AyjsYp2cetnC8EzVw0Zr24ti+HZY0w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=kV81HMmVCQhmuFwI9TERaFHGfRQ=; b=sT6upkGUpfrtgZESMO0YpKF4ZL/6 7tip4FKBsWkcHUpucYnkzYTKYwC3w/Spx+SvIYwNqOUyC9dTV4xat6R4wS/T07uG 00XFxbCPZmRpfcKwAhHZXODE1bUJxjUH/JP7nhP8yN55SroVEEOzWtZB/r2VL33w XvOp+NO/NkBi7rs= Received: (qmail 23727 invoked by alias); 16 Nov 2018 15:53:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 23713 invoked by uid 89); 16 Nov 2018 15:53:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:52:59 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFikSF002137; Fri, 16 Nov 2018 16:52:57 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nsx068wh6-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:52:57 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id ABF8631; Fri, 16 Nov 2018 15:52:56 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8AE165002; Fri, 16 Nov 2018 15:52:56 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:52:56 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 14/20] [ARM][testsuite] FDPIC: Skip unsupported tests Date: Fri, 16 Nov 2018 16:47:42 +0100 Message-ID: <20181116154808.25154-15-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Several tests cannot work on ARM-FDPIC for various reasons: skip them, or skip some directives. gcc.dg/20020312-2.c: Skip since it forces -fno-pic. gcc.target/arm/: * Skip since r9 is clobbered by assembly code: 20051215-1.c mmx-1.c pr61948.c pr77933-1.c pr77933-2.c * Skip since the test forces armv5te which is not supported by FDPIC: pr40887.c pr19599.c * Skip since FDPIC disables sibcall to external functions: sibcall-1.c tail-long-call vfp-longcall-apcs * Skip size check since it's different for FDPIC: ivopts-2.c ivopts-3.c ivopts-4.c ivopts-5.c pr43597.c pr43920-2.c * Disable assembler scanning invalid for FDPIC: pr45701-1.c pr45701-2.c stack-red-zone.c * gnu2 TLS dialect is not supported by FDPIC: tlscall.c * Test relies on symbols not generated in FDPIC: data-rel-2.c data-rel-3.c 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/testsuite/ * gcc.dg/20020312-2.c: Skip on arm*-*-uclinuxfdpiceabi. * gcc.target/arm/20051215-1.c: Likewise. * gcc.target/arm/mmx-1.c: Likewise. * gcc.target/arm/pr19599.c: Likewise. * gcc.target/arm/pr40887.c: Likewise. * gcc.target/arm/pr61948.c: Likewise. * gcc.target/arm/pr77933-1.c: Likewise. * gcc.target/arm/pr77933-2.c: Likewise. * gcc.target/arm/sibcall-1.c: Likewise. * gcc.target/arm/data-rel-2.c: Likewise. * gcc.target/arm/data-rel-3.c: Likewise. * gcc.target/arm/tail-long-call: Likewise. * gcc.target/arm/tlscall.c: Likewise. * gcc.target/arm/vfp-longcall-apcs: Likewise. * gcc.target/arm/ivopts-2.c: Skip object-size test on arm*-*-uclinuxfdpiceabi. * gcc.target/arm/ivopts-3.c: Likewise. * gcc.target/arm/ivopts-4.c: Likewise. * gcc.target/arm/ivopts-5.c: Likewise. * gcc.target/arm/pr43597.c: Likewise. * gcc.target/arm/pr43920-2.c: Likewise. * gcc.target/arm/pr45701-1.c: Skip scan-assembler on arm*-*-uclinuxfdpiceabi. * gcc.target/arm/pr45701-2.c: Likewise. * gcc.target/arm/stack-red-zone.c: Likewise. Change-Id: Icada7ce52537901fdac10403e7997571b7e2c509 -- 2.6.3 diff --git a/gcc/testsuite/gcc.dg/20020312-2.c b/gcc/testsuite/gcc.dg/20020312-2.c index e72a5b2..f1197ff 100644 --- a/gcc/testsuite/gcc.dg/20020312-2.c +++ b/gcc/testsuite/gcc.dg/20020312-2.c @@ -9,6 +9,7 @@ /* { dg-options "-O -fno-pic" } */ /* { dg-additional-options "-no-pie" { target pie_enabled } } */ /* { dg-require-effective-target nonlocal_goto } */ +/* { dg-skip-if "" { arm*-*-uclinuxfdpiceabi } "*" "" } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.target/arm/20051215-1.c b/gcc/testsuite/gcc.target/arm/20051215-1.c index 0519dc7..cc07693 100644 --- a/gcc/testsuite/gcc.target/arm/20051215-1.c +++ b/gcc/testsuite/gcc.target/arm/20051215-1.c @@ -3,6 +3,7 @@ the call would need an output reload. */ /* { dg-do run } */ /* { dg-options "-O2 -fno-omit-frame-pointer" } */ +/* { dg-skip-if "r9 is reserved in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ extern void abort (void); typedef void (*callback) (void); diff --git a/gcc/testsuite/gcc.target/arm/data-rel-2.c b/gcc/testsuite/gcc.target/arm/data-rel-2.c index 6ba47d6..7d37a8c 100644 --- a/gcc/testsuite/gcc.target/arm/data-rel-2.c +++ b/gcc/testsuite/gcc.target/arm/data-rel-2.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "Not supported in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-options "-fPIC -mno-pic-data-is-text-relative -mno-single-pic-base" } */ /* { dg-final { scan-assembler-not "j-\\(.LPIC" } } */ /* { dg-final { scan-assembler "_GLOBAL_OFFSET_TABLE_-\\(.LPIC" } } */ diff --git a/gcc/testsuite/gcc.target/arm/data-rel-3.c b/gcc/testsuite/gcc.target/arm/data-rel-3.c index 2ce1e66..534c6c4 100644 --- a/gcc/testsuite/gcc.target/arm/data-rel-3.c +++ b/gcc/testsuite/gcc.target/arm/data-rel-3.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "Not supported in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-options "-fPIC -mpic-data-is-text-relative" } */ /* { dg-final { scan-assembler "j-\\(.LPIC" } } */ /* { dg-final { scan-assembler-not "_GLOBAL_OFFSET_TABLE_-\\(.LPIC" } } */ diff --git a/gcc/testsuite/gcc.target/arm/ivopts-2.c b/gcc/testsuite/gcc.target/arm/ivopts-2.c index afe91aa..f1d5edb 100644 --- a/gcc/testsuite/gcc.target/arm/ivopts-2.c +++ b/gcc/testsuite/gcc.target/arm/ivopts-2.c @@ -14,4 +14,4 @@ tr4 (short array[], int n) /* { dg-final { scan-tree-dump-times "PHI X-Patchwork-Id: 151363 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp590272ljp; Fri, 16 Nov 2018 07:53:33 -0800 (PST) X-Google-Smtp-Source: AJdET5ccK+E1Uwx5TSFo8vnx71JRm4mskbsIzx+BeSWg2LGzVfAHfzgDFDOtP7MNDJ+yVjuDQCx1 X-Received: by 2002:a63:89c2:: with SMTP id v185mr9654743pgd.97.1542383613062; Fri, 16 Nov 2018 07:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383613; cv=none; d=google.com; s=arc-20160816; b=roy9/eQheb92YtuOeeuGl0cB/1kxMskUXkDNLQNQ1vTlM6g8kCPfs6nvDm9xlsWcmg 4utBoX9Qi8Xin955DDQVRTKcK1HftZbMUDAwsvPL4WktPZwxG6/B5Mvptiji+6TIz6h4 EhZjV1kkeC6c7a4k4hBTOuAlk5kkgsvMASf0yrgbRDQk7i79TXkVdDXYVgRmsFZBDqab jAZQF9FJX4elBurfjFW/f5X3tbSaZ3hxHwWGm7fsqKiGF8R9odPIDvbT7XOs5ma7f6i1 9M/hCXsuejd5scNJnAUB6G3KMvMKEiixBun4gLGW/+BGLHbEYYtUwpB9s/HQbgGbc7fJ BMHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=8iMdJnjf58b7q/d7VfZcKHwkniOm7sXcAAwu76X80fI=; b=z4RCucFN3vJlv/39lOZRFPDGfBixMTTx7PXndlOH9g+CFUxbi+9w6ep7JhLRaN0Y/l zW+F9+bb72mbOJT9/wK/x5JneojXaBUVCxYIL80Lvj/nY87l5I6VMxVLwEL/ZBRZdgFZ Z4+ikuZTO8KChiwb6RIU9AGL8ZfKnAjWpAcui8RUE4nzLBnnsUFBNcugzCuCdOfFh5kw EANn1H+hDnTeO2K3k17Gr6pvHxrZ5YQiL0ds1FYuaXukWxIDjlwGHz6pJOKXMlfVKo6u cbEleAFjJR+XJ3Y85Ta0wOD9/FTzNbkuNakOG6Cf7YruCF72b2St95GaDb8O0vCiMv6C /uqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=tq+e3N8y; spf=pass (google.com: domain of gcc-patches-return-490278-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490278-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u72si31537291pgc.360.2018.11.16.07.53.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:53:33 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490278-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=tq+e3N8y; spf=pass (google.com: domain of gcc-patches-return-490278-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490278-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=fF8mN1vQ3gjowxctCyazNt18cHmSUbrQ9gXweV+Rf5aiSvUJvQdgP otVWxFxAst0hE11dO7m2IoTGyLfK+mMXBMkZJP4GsaeV2sAj2Wo+nBVLOLwWkSkt dVd87zkAZd7NOYh3rBXLoA1SKk8qr5nS3dXj+bsOchjwBRoZLzqyp0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=mTYV4cWIv+IaHxyExOaE3FCucsE=; b=tq+e3N8y3l4inqDhCEH0tDYZdmwn R9gwtTXo8COxlRgNYSLdcN6MeNELJBBsV5emwwVO6B3cHANleZ/AtVAJhn97Ido6 QSZc8JYBDGmOfCUHQXEAnBihYrTT82YGPPu55kBf6VQbPbZEsYp/n7faWlL+IKhj Cf5IcRzhb39gRg0= Received: (qmail 25181 invoked by alias); 16 Nov 2018 15:53:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 25158 invoked by uid 89); 16 Nov 2018 15:53:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:3061 X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:53:19 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFiXUN030555; Fri, 16 Nov 2018 16:53:17 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2nsxqxrps1-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:53:17 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0186334; Fri, 16 Nov 2018 15:53:16 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BDDF75005; Fri, 16 Nov 2018 15:53:16 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:53:16 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 15/20] [ARM][testsuite] FDPIC: Adjust scan-assembler patterns. Date: Fri, 16 Nov 2018 16:47:43 +0100 Message-ID: <20181116154808.25154-16-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes In FDPIC mode, r9 is saved in addition to other registers, so update the expected patterns accordingly. 2018-XX-XX Christophe Lyon Mickaël Guêné * gcc/testsuite/ * gcc.target/arm/interrupt-1.c: Add scan-assembler pattern for arm*-*-uclinuxfdpiceabi. * gcc.target/arm/interrupt-2.c: Likewise. * gcc.target/arm/pr70830.c: Likewise. Change-Id: Id946b79bacc32be585c31e60a355191f104cc29e -- 2.6.3 diff --git a/gcc/testsuite/gcc.target/arm/interrupt-1.c b/gcc/testsuite/gcc.target/arm/interrupt-1.c index fe94877..493763d 100644 --- a/gcc/testsuite/gcc.target/arm/interrupt-1.c +++ b/gcc/testsuite/gcc.target/arm/interrupt-1.c @@ -13,5 +13,7 @@ void foo () bar (0); } -/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, fp, ip, lr}" } } */ -/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}\\^" } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, fp, ip, lr}" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, fp, ip, pc}\\^" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, r9, fp, ip, lr}" { target arm*-*-uclinuxfdpiceabi } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, r9, fp, ip, pc}\\^" { target arm*-*-uclinuxfdpiceabi } } } */ diff --git a/gcc/testsuite/gcc.target/arm/interrupt-2.c b/gcc/testsuite/gcc.target/arm/interrupt-2.c index 289eca0..5be1f16 100644 --- a/gcc/testsuite/gcc.target/arm/interrupt-2.c +++ b/gcc/testsuite/gcc.target/arm/interrupt-2.c @@ -15,5 +15,7 @@ void test() foo = 0; } -/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, ip, lr}" } } */ -/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}\\^" } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, ip, lr}" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, ip, pc}\\^" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "push\t{r0, r1, r2, r3, r4, r5, r6, r9, ip, lr}" { target arm*-*-uclinuxfdpiceabi } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r5, r6, r9, ip, pc}\\^" { target arm*-*-uclinuxfdpiceabi } } } */ diff --git a/gcc/testsuite/gcc.target/arm/pr70830.c b/gcc/testsuite/gcc.target/arm/pr70830.c index cad903b..cd84c42 100644 --- a/gcc/testsuite/gcc.target/arm/pr70830.c +++ b/gcc/testsuite/gcc.target/arm/pr70830.c @@ -11,4 +11,5 @@ void __attribute__ ((interrupt ("IRQ"))) dm3730_IRQHandler(void) { prints("IRQ" ); } -/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, ip, pc}\\^" } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, ip, pc}\\^" { target { ! arm*-*-uclinuxfdpiceabi } } } } */ +/* { dg-final { scan-assembler "ldmfd\tsp!, {r0, r1, r2, r3, r4, r9, ip, pc}\\^" { target arm*-*-uclinuxfdpiceabi } } } */ From patchwork Fri Nov 16 15:47:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151364 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp590585ljp; Fri, 16 Nov 2018 07:53:52 -0800 (PST) X-Google-Smtp-Source: AJdET5fBjFi9KnoMkqryBJHzhaVfNVwmxVzBPxIrbVbtSWZhMyN7wTpZWv7r31bcS/1BvnmRnBse X-Received: by 2002:a17:902:2702:: with SMTP id c2-v6mr11380864plb.314.1542383632765; Fri, 16 Nov 2018 07:53:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383632; cv=none; d=google.com; s=arc-20160816; b=NeRIEJZz/IQywDInSOcRn7qVwZJCDVQdHbgOgSgKPuJAc0OgbWCMsrL+XXlB3iwqMd 235m2Ddf/RX0/mD+yfBrc5lEUGdMdP4Wof8b5dZJh43Gpw8/0eZtssKdHj5Itv1sB/Dv HZLNCfP5uCZIR/HLGFzNTP2WXWOYVlAbdijeaDqYo1m6BAjudPktoWBe3CAEAqNXEQ5k S11GPQ932uEHUrLASOH6Huz9RXJDU47hwgHWWgWPsE7a7gob5Of1jV0VEvE4uIlsW3Un eZ4kltnhWQ2SQVNcCS+wTEkyNqZJEK+u062cckXEh3qBgQYu1lZL7YZYtxhUHNx3kE/k Za+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=sNOThwMyfazvN16cNXz1UAv0yECorcIRkHNVigkZnhg=; b=jhAvPsYSRCBpcnaWPMnp2Q1nq5zT4f2GSG3freRXTJMOw9mh47ybtP1RedwTsrz/pC icdXoHSDw8r52t3iWcYWl6Fczgg2mqnQZPMDA19Wugundq62uOpwbONqxu5PPlitBf6i Oltp+1jGdDw1rV/L/SC1VYL356R/K9BE8eBL9CMIUCMOs9MFQm51SQS8LzPU1VV1djbR F6PV+0/FMyk63FhKtqKZzndQTNUtXP/hnoDqBje1eaXFuCY9YpQquPwj9AF0gjgUHR41 6V6sZlMRKQ2q0XZrV4EEPRHCH+KvLJYgatxg03WBwdmsdFSomMjVaUlUPlXKReGVqX0S mOnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uZx1pot5; spf=pass (google.com: domain of gcc-patches-return-490279-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490279-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id j38-v6si30013962pgl.138.2018.11.16.07.53.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:53:52 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490279-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=uZx1pot5; spf=pass (google.com: domain of gcc-patches-return-490279-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490279-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=gGo/n0K0S2LFF0YZ 408VOJn2H1PPpdcK89nhiOLZihxujLkj1i7LVKyO2wMWw59cHPQ75fyzd2tefXYn i5JpkHJDWSJPESamSQoHBCqzspjHsDKChqoOCJ+aVJgTmKtY+0PHQZasrcnTo/Zo ebCsHEIkBMZ1C3dq1BY0li6ItXc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=2WQuaKp5EK5CXw+/wvj5/J QeMcQ=; b=uZx1pot5E7PVCbZNAp+3M7Zwog6tboafhaCoOR2mpzy5/5YcCYwpg3 VNKyysqAxm+wL2cOt7nLUkivRXYb5q8vQuyihWKMxKnzWw6oI8Sh0/Yucl6q1i4B Q40xzXMCdK/UDWnzOWNjl92/1UGZs4b2y8fukHIqpfGtwd5ZEcHXk= Received: (qmail 26638 invoked by alias); 16 Nov 2018 15:53:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 26622 invoked by uid 89); 16 Nov 2018 15:53:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Accept X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:53:39 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFiNcZ030536; Fri, 16 Nov 2018 16:53:37 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2nsxqxrpu3-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:53:37 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 20F183A; Fri, 16 Nov 2018 15:53:37 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0BF995005; Fri, 16 Nov 2018 15:53:37 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:53:36 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 16/20] [ARM][testsuite] FDPIC: Skip tests that don't work in PIC mode Date: Fri, 16 Nov 2018 16:47:44 +0100 Message-ID: <20181116154808.25154-17-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Some tests fail on arm*-*-uclinuxfdpiceabi because it generates PIC code and they don't support it: skip them. They also fail on arm*-linux* when forcing -fPIC. 2018-XX-XX Christophe Lyon gcc/testsuite/ * gcc.target/arm/eliminate.c: Accept only nonpic targets. * g++.dg/other/anon5.C: Likewise. Change-Id: I8efb8d356ce25b020c44a84b07f79a996dca0358 -- 2.6.3 diff --git a/gcc/testsuite/g++.dg/other/anon5.C b/gcc/testsuite/g++.dg/other/anon5.C index ee4601e..dadd92e 100644 --- a/gcc/testsuite/g++.dg/other/anon5.C +++ b/gcc/testsuite/g++.dg/other/anon5.C @@ -1,5 +1,6 @@ // PR c++/34094 // { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* } } } } +// { dg-require-effective-target nonpic } // { dg-options "-gdwarf-2" } // Ignore additional message on powerpc-ibm-aix // { dg-prune-output "obtain more information" } */ diff --git a/gcc/testsuite/gcc.target/arm/eliminate.c b/gcc/testsuite/gcc.target/arm/eliminate.c index f254dd8..299d4df 100644 --- a/gcc/testsuite/gcc.target/arm/eliminate.c +++ b/gcc/testsuite/gcc.target/arm/eliminate.c @@ -1,4 +1,4 @@ -/* { dg-do compile } */ +/* { dg-do compile { target { nonpic } } } */ /* { dg-options "-O2" } */ struct X From patchwork Fri Nov 16 15:47:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151365 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp591012ljp; Fri, 16 Nov 2018 07:54:17 -0800 (PST) X-Google-Smtp-Source: AJdET5fV4+6TgbHfnRu1D3FF+mcNBGdgbW645jmVeDojLvdaw2i5zaLWcTsp4sHHzC+2TWAlvUgD X-Received: by 2002:a63:2586:: with SMTP id l128mr10595241pgl.104.1542383657041; Fri, 16 Nov 2018 07:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383657; cv=none; d=google.com; s=arc-20160816; b=XkoMW/TSP5fCAH86IS+tBCi8vRPzGJ6/k8bsWkPN26++y7U/wrq+Qgo/Qj8IF/ValI aH7sdK0xAGiBE1ksdu9TDRu2i9NfJq+CgOCvvzaCJazLIvanny8Ddsr0Kko2sq6mI53Z oBwRbMZike0p5DlAl9snJthm0UB1Zy6Zn8AwyatmX6zQfVciNFUW7mvq2s/Awb14gX1Y LaJfBdU+MFJZQmNR53V/6Qk0booRn/0HhdtAFPmEYQnK1dsJ2NzrROh56jLEvMYk/q0w CDv0XtsNG1NcDfufKiV6eQKJ6KLDgbUvnQqJ5Mxh/qO2SdczhDXF3Oq8PU2ok1C4fI3M 6JBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=I3HnaGVOh1x+mXg7rhdvUHRK2vvrIJ10mMuSSpd86oE=; b=zkEzYt8cfg/xPRPe6W+RL2m3Bnt/Zz/pUHAUdmsnvxQtL8BT413/g39op0VLTrWNhW rBnM8sinns5BWKTpnup+qIvnlyDD3lZxObjcAsxZDCBGcrfmT2BGunf90RfBAYToeny3 P7LmrAwKc6qXLC3atAVJfOVPnTz19jobshdLhG0BKIxeCBnyj0HaHsvCBXxMfpNEtjv7 PD871IHNut5B5np470Uc4gcWJNgJhOfxc8A2Xblb8iieMdbD8Z1VE/vB1MSqkxsWf9sR OJbnK/hWLehoqQaSjMoStJYQrNe8sfCgqCk//Z5XYgzUW+mcIXLp+CpdJkX16lj6G7GX PzyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=HCbSeDGG; spf=pass (google.com: domain of gcc-patches-return-490280-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490280-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w7si10739892ply.421.2018.11.16.07.54.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:54:17 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490280-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=HCbSeDGG; spf=pass (google.com: domain of gcc-patches-return-490280-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490280-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=d8KlFqmmmrQbNq4g FEBh0Sj8mN0KxW79oMpLfQ1Cs6E0umfBpTNwCpdrcA+u+0mV31VVBlI3TxQNmFqd EwD33JgCOV99/BMG7UiukY05yVbqyYOTxUtkekcSdIvN1za13ATQyjv8ZyDlqQNC k8xS4mjaqend6ONfPzFnkTKZsAQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=S821OHNI++TEIoYIhoWsS+ 9JMYw=; b=HCbSeDGGQHFzhP4ALhV9r8CILZsHxhHdQBHsI94UDYhFGabFaQ/ZNK DxepZqiL4oYOzrpUe5wfCUWMiIaHP7ovFi8OXfutCTBGTBUAuUQ7oGKhPAN8xLkh 6+hKL4NJbpKmzbKP53o654F/3Jw7JBD7fuBD/Gvbs4c7rxTAdKQ44= Received: (qmail 28451 invoked by alias); 16 Nov 2018 15:54:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 28436 invoked by uid 89); 16 Nov 2018 15:54:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:fnonca, sk:fnon-ca, realtime, performing X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:54:00 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFilXS002140; Fri, 16 Nov 2018 16:53:58 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nsx068wnv-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:53:58 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 83D6334; Fri, 16 Nov 2018 15:53:57 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4E47B501D; Fri, 16 Nov 2018 15:53:57 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:53:56 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 17/20] [ARM][testsuite] FDPIC: Handle *-*-uclinux* Date: Fri, 16 Nov 2018 16:47:45 +0100 Message-ID: <20181116154808.25154-18-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Add *-*-uclinux* to tests that work on this target. 2018-XX-XX Christophe Lyon gcc/testsuite/ * g++.dg/abi/forced.C: Add *-*-uclinux*. * g++.dg/abi/guard2.C: Likewise. * g++.dg/ext/cleanup-10.C: Likewise. * g++.dg/ext/cleanup-11.C: Likewise. * g++.dg/ext/cleanup-8.C: Likewise. * g++.dg/ext/cleanup-9.C: Likewise. * g++.dg/ext/sync-4.C: Likewise. * g++.dg/ipa/comdat.C: Likewise. * gcc.dg/20041106-1.c: Likewise. * gcc.dg/cleanup-10.c: Likewise. * gcc.dg/cleanup-11.c: Likewise. * gcc.dg/cleanup-8.c: Likewise. * gcc.dg/cleanup-9.c: Likewise. * gcc.dg/fdata-sections-1.c: Likewise. * gcc.dg/fdata-sections-2.c: Likewise. * gcc.dg/pr39323-1.c: Likewise. * gcc.dg/pr39323-2.c: Likewise. * gcc.dg/pr39323-3.c: Likewise. * gcc.dg/pr65780-1.c: Likewise. * gcc.dg/pr65780-2.c: Likewise. * gcc.dg/pr67338.c: Likewise. * gcc.dg/pr78185.c: Likewise. * gcc.dg/pr83100-1.c: Likewise. * gcc.dg/pr83100-4.c: Likewise. * gcc.dg/strlenopt-12g.c: Likewise. * gcc.dg/strlenopt-14g.c: Likewise. * gcc.dg/strlenopt-14gf.c: Likewise. * gcc.dg/strlenopt-16g.c: Likewise. * gcc.dg/strlenopt-17g.c: Likewise. * gcc.dg/strlenopt-18g.c: Likewise. * gcc.dg/strlenopt-1f.c: Likewise. * gcc.dg/strlenopt-22g.c: Likewise. * gcc.dg/strlenopt-2f.c: Likewise. * gcc.dg/strlenopt-31g.c: Likewise. * gcc.dg/strlenopt-33g.c: Likewise. * gcc.dg/strlenopt-4g.c: Likewise. * gcc.dg/strlenopt-4gf.c: Likewise. * gcc.dg/strncmp-2.c: Likewise. * gcc.dg/struct-ret-3.c: Likewise. * gcc.dg/torture/pr69760.c: Likewise. * gcc.target/arm/div64-unwinding.c: Likewise. * gcc.target/arm/stack-checking.c: Likewise. * gcc.target/arm/synchronize.c: Likewise. * gcc.target/arm/pr66912.c: Add arm*-*-uclinuxfdpiceabi. * lib/target-supports.exp (check_effective_target_pie): Likewise. (check_effective_target_sync_long_long_runtime): Likewise. (check_effective_target_sync_int_long): Likewise. (check_effective_target_sync_char_short): Likewise. Change-Id: I89bfea79d4490c5df0b6470def5a31d7f31ac2cc -- 2.6.3 diff --git a/gcc/testsuite/g++.dg/abi/forced.C b/gcc/testsuite/g++.dg/abi/forced.C index 0e6be28..2d1ec53 100644 --- a/gcc/testsuite/g++.dg/abi/forced.C +++ b/gcc/testsuite/g++.dg/abi/forced.C @@ -1,4 +1,4 @@ -// { dg-do run { target *-*-linux* *-*-gnu* } } +// { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } // { dg-options "-pthread" } #include diff --git a/gcc/testsuite/g++.dg/abi/guard2.C b/gcc/testsuite/g++.dg/abi/guard2.C index c35fa7e..74139a8 100644 --- a/gcc/testsuite/g++.dg/abi/guard2.C +++ b/gcc/testsuite/g++.dg/abi/guard2.C @@ -1,6 +1,6 @@ // PR c++/41611 // Test that the guard gets its own COMDAT group. -// { dg-final { scan-assembler "_ZGVZN1A1fEvE1i,comdat" { target *-*-linux* *-*-gnu* } } } +// { dg-final { scan-assembler "_ZGVZN1A1fEvE1i,comdat" { target *-*-linux* *-*-gnu* *-*-uclinux* } } } struct A { static int f() diff --git a/gcc/testsuite/g++.dg/ext/cleanup-10.C b/gcc/testsuite/g++.dg/ext/cleanup-10.C index 66c7b76..56aeb66 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-10.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-10.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through signal frames on alternate stack. */ diff --git a/gcc/testsuite/g++.dg/ext/cleanup-11.C b/gcc/testsuite/g++.dg/ext/cleanup-11.C index 6e96521..c6d3560 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-11.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-11.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through realtime signal frames on alternate stack. */ diff --git a/gcc/testsuite/g++.dg/ext/cleanup-8.C b/gcc/testsuite/g++.dg/ext/cleanup-8.C index ccf9bef..e99508d 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-8.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-8.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through signal frames. */ diff --git a/gcc/testsuite/g++.dg/ext/cleanup-9.C b/gcc/testsuite/g++.dg/ext/cleanup-9.C index dcdfcae..45e5f90 100644 --- a/gcc/testsuite/g++.dg/ext/cleanup-9.C +++ b/gcc/testsuite/g++.dg/ext/cleanup-9.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through realtime signal frames. */ diff --git a/gcc/testsuite/g++.dg/ext/sync-4.C b/gcc/testsuite/g++.dg/ext/sync-4.C index 47aa1e3..409f526 100644 --- a/gcc/testsuite/g++.dg/ext/sync-4.C +++ b/gcc/testsuite/g++.dg/ext/sync-4.C @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-require-effective-target sync_long_long_runtime } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* { dg-additional-options "-march=pentium" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ diff --git a/gcc/testsuite/g++.dg/ipa/comdat.C b/gcc/testsuite/g++.dg/ipa/comdat.C index 1945e32..f3df99a 100644 --- a/gcc/testsuite/g++.dg/ipa/comdat.C +++ b/gcc/testsuite/g++.dg/ipa/comdat.C @@ -1,4 +1,4 @@ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-ipa-comdats" } */ #include __attribute__ ((noinline)) diff --git a/gcc/testsuite/gcc.dg/20041106-1.c b/gcc/testsuite/gcc.dg/20041106-1.c index cba4a06..95579ff 100644 --- a/gcc/testsuite/gcc.dg/20041106-1.c +++ b/gcc/testsuite/gcc.dg/20041106-1.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-solaris* *-*-uclinux* } } */ /* { dg-options -O2 } */ #include diff --git a/gcc/testsuite/gcc.dg/cleanup-10.c b/gcc/testsuite/gcc.dg/cleanup-10.c index 16035b1..a9c0461 100644 --- a/gcc/testsuite/gcc.dg/cleanup-10.c +++ b/gcc/testsuite/gcc.dg/cleanup-10.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through signal frames on alternate stack. */ diff --git a/gcc/testsuite/gcc.dg/cleanup-11.c b/gcc/testsuite/gcc.dg/cleanup-11.c index ccc61ed..53d09be 100644 --- a/gcc/testsuite/gcc.dg/cleanup-11.c +++ b/gcc/testsuite/gcc.dg/cleanup-11.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through realtime signal frames on alternate stack. */ diff --git a/gcc/testsuite/gcc.dg/cleanup-8.c b/gcc/testsuite/gcc.dg/cleanup-8.c index 553c038..53a6366 100644 --- a/gcc/testsuite/gcc.dg/cleanup-8.c +++ b/gcc/testsuite/gcc.dg/cleanup-8.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through signal frames. */ diff --git a/gcc/testsuite/gcc.dg/cleanup-9.c b/gcc/testsuite/gcc.dg/cleanup-9.c index fe28072..e0ab2d1 100644 --- a/gcc/testsuite/gcc.dg/cleanup-9.c +++ b/gcc/testsuite/gcc.dg/cleanup-9.c @@ -1,4 +1,4 @@ -/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* } } */ +/* { dg-do run { target hppa*-*-hpux* *-*-linux* *-*-gnu* powerpc*-*-darwin* *-*-darwin[912]* *-*-uclinux* } } */ /* { dg-options "-fexceptions -fnon-call-exceptions -O2" } */ /* Verify that cleanups work with exception handling through realtime signal frames. */ diff --git a/gcc/testsuite/gcc.dg/fdata-sections-1.c b/gcc/testsuite/gcc.dg/fdata-sections-1.c index 51686b9..e8a6639 100644 --- a/gcc/testsuite/gcc.dg/fdata-sections-1.c +++ b/gcc/testsuite/gcc.dg/fdata-sections-1.c @@ -1,7 +1,7 @@ /* PR middle-end/15486 */ /* Origin: Jonathan Larmour */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-fdata-sections" } */ int x; diff --git a/gcc/testsuite/gcc.dg/fdata-sections-2.c b/gcc/testsuite/gcc.dg/fdata-sections-2.c index dda90ba7..48d44a2 100644 --- a/gcc/testsuite/gcc.dg/fdata-sections-2.c +++ b/gcc/testsuite/gcc.dg/fdata-sections-2.c @@ -4,7 +4,7 @@ /* This checks that string constants are put in per-function rodata sections, so that they can be garbage collected. */ -/* { dg-do compile { target *-*-linux* } } */ +/* { dg-do compile { target *-*-linux* *-*-uclinux* } } */ /* { dg-options "-O -ffunction-sections -fdata-sections" } */ const char *f1(void) { return "falderalde"; } diff --git a/gcc/testsuite/gcc.dg/pr39323-1.c b/gcc/testsuite/gcc.dg/pr39323-1.c index 7a7fd63..d84009c 100644 --- a/gcc/testsuite/gcc.dg/pr39323-1.c +++ b/gcc/testsuite/gcc.dg/pr39323-1.c @@ -1,5 +1,5 @@ /* PR c/39323 - MAX_OFILE_ALIGNMENT in elfos.h is too big */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ int foo __attribute__ ((aligned(1 << 29))) = 20; /* { dg-error "requested alignment" } */ typedef int __attribute__ ((aligned(1 << 29))) int29; /* { dg-error "requested alignment" } */ diff --git a/gcc/testsuite/gcc.dg/pr39323-2.c b/gcc/testsuite/gcc.dg/pr39323-2.c index a870729..6b6cb2e 100644 --- a/gcc/testsuite/gcc.dg/pr39323-2.c +++ b/gcc/testsuite/gcc.dg/pr39323-2.c @@ -1,5 +1,5 @@ /* PR c/39323 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ int bar __attribute__ ((aligned(1 << 28))) = 20; diff --git a/gcc/testsuite/gcc.dg/pr39323-3.c b/gcc/testsuite/gcc.dg/pr39323-3.c index b452d3c..2e2c1a2 100644 --- a/gcc/testsuite/gcc.dg/pr39323-3.c +++ b/gcc/testsuite/gcc.dg/pr39323-3.c @@ -1,5 +1,5 @@ /* PR c/39323 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ typedef int __attribute__ ((aligned(1 << 28))) int28; int28 foo = 20; diff --git a/gcc/testsuite/gcc.dg/pr65780-1.c b/gcc/testsuite/gcc.dg/pr65780-1.c index b586211..5e3226e 100644 --- a/gcc/testsuite/gcc.dg/pr65780-1.c +++ b/gcc/testsuite/gcc.dg/pr65780-1.c @@ -1,5 +1,5 @@ /* PR target/65780 */ -/* { dg-do link { target *-*-linux* *-*-gnu* } } */ +/* { dg-do link { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ int optopt; diff --git a/gcc/testsuite/gcc.dg/pr65780-2.c b/gcc/testsuite/gcc.dg/pr65780-2.c index bff3323..932cbe1 100644 --- a/gcc/testsuite/gcc.dg/pr65780-2.c +++ b/gcc/testsuite/gcc.dg/pr65780-2.c @@ -1,5 +1,5 @@ /* PR target/65780 */ -/* { dg-do link { target *-*-linux* *-*-gnu* } } */ +/* { dg-do link { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-require-effective-target pie } */ /* { dg-options "-O2 -fpie" } */ diff --git a/gcc/testsuite/gcc.dg/pr67338.c b/gcc/testsuite/gcc.dg/pr67338.c index 0fdc302..7bfbef2 100644 --- a/gcc/testsuite/gcc.dg/pr67338.c +++ b/gcc/testsuite/gcc.dg/pr67338.c @@ -1,4 +1,4 @@ /* PR c/67338 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ struct S { __attribute__((aligned (1 << 28))) double a; }; diff --git a/gcc/testsuite/gcc.dg/pr78185.c b/gcc/testsuite/gcc.dg/pr78185.c index 405f748..d7781b2 100644 --- a/gcc/testsuite/gcc.dg/pr78185.c +++ b/gcc/testsuite/gcc.dg/pr78185.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O" } */ #include diff --git a/gcc/testsuite/gcc.dg/pr83100-1.c b/gcc/testsuite/gcc.dg/pr83100-1.c index 233c1f6..ccfb8c6 100644 --- a/gcc/testsuite/gcc.dg/pr83100-1.c +++ b/gcc/testsuite/gcc.dg/pr83100-1.c @@ -1,5 +1,5 @@ /* PR target/83100 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fcommon -fdata-sections" } */ const int a; diff --git a/gcc/testsuite/gcc.dg/pr83100-4.c b/gcc/testsuite/gcc.dg/pr83100-4.c index bb26735..2f83247 100644 --- a/gcc/testsuite/gcc.dg/pr83100-4.c +++ b/gcc/testsuite/gcc.dg/pr83100-4.c @@ -1,5 +1,5 @@ /* PR target/83100 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fno-common -fdata-sections" } */ const int a; diff --git a/gcc/testsuite/gcc.dg/strlenopt-12g.c b/gcc/testsuite/gcc.dg/strlenopt-12g.c index f1dec1f..fb0eeb2 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-12g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-12g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-14g.c b/gcc/testsuite/gcc.dg/strlenopt-14g.c index 62a83bf..8bce645 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-14g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-14g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy and mempcpy functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ /* Bionic targets don't have mempcpy */ /* { dg-require-effective-target non_bionic } */ diff --git a/gcc/testsuite/gcc.dg/strlenopt-14gf.c b/gcc/testsuite/gcc.dg/strlenopt-14gf.c index 8b126fc..cc9092b 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-14gf.c +++ b/gcc/testsuite/gcc.dg/strlenopt-14gf.c @@ -1,6 +1,6 @@ /* This test needs runtime that provides stpcpy, mempcpy and __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ /* Bionic targets don't have mempcpy */ /* { dg-require-effective-target non_bionic } */ diff --git a/gcc/testsuite/gcc.dg/strlenopt-16g.c b/gcc/testsuite/gcc.dg/strlenopt-16g.c index 0cf8410..8b8f0d6 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-16g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-16g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-17g.c b/gcc/testsuite/gcc.dg/strlenopt-17g.c index 184e530..0d5f559 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-17g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-17g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-18g.c b/gcc/testsuite/gcc.dg/strlenopt-18g.c index f734675..e3706d2 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-18g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-18g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-1f.c b/gcc/testsuite/gcc.dg/strlenopt-1f.c index 856774d..bb320ab 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-1f.c +++ b/gcc/testsuite/gcc.dg/strlenopt-1f.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinu* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define FORTIFY_SOURCE 2 diff --git a/gcc/testsuite/gcc.dg/strlenopt-22g.c b/gcc/testsuite/gcc.dg/strlenopt-22g.c index 9c5d020..348903f 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-22g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-22g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-2f.c b/gcc/testsuite/gcc.dg/strlenopt-2f.c index 1e915da..f61a8ba 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-2f.c +++ b/gcc/testsuite/gcc.dg/strlenopt-2f.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define FORTIFY_SOURCE 2 diff --git a/gcc/testsuite/gcc.dg/strlenopt-31g.c b/gcc/testsuite/gcc.dg/strlenopt-31g.c index 45cc29c..3588b06 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-31g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-31g.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-33g.c b/gcc/testsuite/gcc.dg/strlenopt-33g.c index 7d24d2b..8566782 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-33g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-33g.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-4g.c b/gcc/testsuite/gcc.dg/strlenopt-4g.c index 879d566..c6a2d6f 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-4g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-4g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-4gf.c b/gcc/testsuite/gcc.dg/strlenopt-4gf.c index 7f261b7..2783c3b 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-4gf.c +++ b/gcc/testsuite/gcc.dg/strlenopt-4gf.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy and __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strncmp-2.c b/gcc/testsuite/gcc.dg/strncmp-2.c index f5555ba..6818b30 100644 --- a/gcc/testsuite/gcc.dg/strncmp-2.c +++ b/gcc/testsuite/gcc.dg/strncmp-2.c @@ -1,5 +1,5 @@ /* Test strncmp builtin expansion for compilation and proper execution. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ /* { dg-require-effective-target ptr32plus } */ diff --git a/gcc/testsuite/gcc.dg/struct-ret-3.c b/gcc/testsuite/gcc.dg/struct-ret-3.c index 4083bb4..4c0a0e6 100644 --- a/gcc/testsuite/gcc.dg/struct-ret-3.c +++ b/gcc/testsuite/gcc.dg/struct-ret-3.c @@ -1,7 +1,7 @@ /* PR middle-end/31309 */ /* Origin: Peeter Joot */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-add-options stack_size } */ #include diff --git a/gcc/testsuite/gcc.dg/torture/pr69760.c b/gcc/testsuite/gcc.dg/torture/pr69760.c index 8f24608..53733c7 100644 --- a/gcc/testsuite/gcc.dg/torture/pr69760.c +++ b/gcc/testsuite/gcc.dg/torture/pr69760.c @@ -1,5 +1,5 @@ /* PR tree-optimization/69760 */ -/* { dg-do run { target { { *-*-linux* *-*-gnu* } && mmap } } } */ +/* { dg-do run { target { { *-*-linux* *-*-gnu* *-*-uclinux* } && mmap } } } */ /* { dg-options "-O2" } */ #include diff --git a/gcc/testsuite/gcc.target/arm/div64-unwinding.c b/gcc/testsuite/gcc.target/arm/div64-unwinding.c index 7f112ee..0944281 100644 --- a/gcc/testsuite/gcc.target/arm/div64-unwinding.c +++ b/gcc/testsuite/gcc.target/arm/div64-unwinding.c @@ -1,6 +1,6 @@ /* Performing a 64-bit division should not pull in the unwinder. */ -/* { dg-do run { target { ! *-*-linux* } } } */ +/* { dg-do run { target { { ! *-*-linux* } && { ! *-*-uclinux* } } } } */ /* { dg-options "-O0" } */ #include diff --git a/gcc/testsuite/gcc.target/arm/pr66912.c b/gcc/testsuite/gcc.target/arm/pr66912.c index 27e4c45..7e6294c 100644 --- a/gcc/testsuite/gcc.target/arm/pr66912.c +++ b/gcc/testsuite/gcc.target/arm/pr66912.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target *-*-linux* } } */ +/* { dg-do compile { target *-*-linux* arm*-*-uclinuxfdpiceabi } } */ /* { dg-options "-O2 -fpic" } */ __attribute__((visibility("protected"))) diff --git a/gcc/testsuite/gcc.target/arm/stack-checking.c b/gcc/testsuite/gcc.target/arm/stack-checking.c index 4b53bed..9d1d2b0 100644 --- a/gcc/testsuite/gcc.target/arm/stack-checking.c +++ b/gcc/testsuite/gcc.target/arm/stack-checking.c @@ -1,4 +1,4 @@ -/* { dg-do run { target { *-*-linux* } } } */ +/* { dg-do run { target { *-*-linux* *-*-uclinux* } } } */ /* { dg-require-stack-check "" } */ /* { dg-options "-fstack-check" } */ diff --git a/gcc/testsuite/gcc.target/arm/synchronize.c b/gcc/testsuite/gcc.target/arm/synchronize.c index 7ef10e2..912f407 100644 --- a/gcc/testsuite/gcc.target/arm/synchronize.c +++ b/gcc/testsuite/gcc.target/arm/synchronize.c @@ -1,4 +1,4 @@ -/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-* } } } */ +/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-* arm*-*-uclinux* } } } */ void *foo (void) { diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 8e16efc..623bfd5 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1168,6 +1168,7 @@ proc check_effective_target_pie { } { || [istarget *-*-dragonfly*] || [istarget *-*-freebsd*] || [istarget *-*-linux*] + || [istarget arm*-*-uclinuxfdpiceabi] || [istarget *-*-gnu*] } { return 1; } @@ -6553,6 +6554,7 @@ proc check_effective_target_sync_long_long_runtime { } { } "" }]) || [istarget aarch64*-*-*] + || [istarget arm*-*-uclinuxfdpiceabi] || ([istarget arm*-*-linux-*] && [check_runtime sync_longlong_runtime { #include @@ -6613,6 +6615,7 @@ proc check_effective_target_sync_int_long { } { || [istarget aarch64*-*-*] || [istarget alpha*-*-*] || [istarget arm*-*-linux-*] + || [istarget arm*-*-uclinuxfdpiceabi] || ([istarget arm*-*-*] && [check_effective_target_arm_acq_rel]) || [istarget bfin*-*linux*] @@ -6637,6 +6640,7 @@ proc check_effective_target_sync_char_short { } { || [istarget i?86-*-*] || [istarget x86_64-*-*] || [istarget alpha*-*-*] || [istarget arm*-*-linux-*] + || [istarget arm*-*-uclinuxfdpiceabi] || ([istarget arm*-*-*] && [check_effective_target_arm_acq_rel]) || [istarget hppa*-*linux*] From patchwork Fri Nov 16 15:47:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151366 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp591311ljp; Fri, 16 Nov 2018 07:54:34 -0800 (PST) X-Google-Smtp-Source: AJdET5eEPYbyTCtQvzqU/hXSyhyYdzOYhbkxUWrH3IWIW9qkQ/fZxgIJAt043wZXedBo3OPN3BlP X-Received: by 2002:aa7:80ce:: with SMTP id a14-v6mr11472640pfn.86.1542383674823; Fri, 16 Nov 2018 07:54:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383674; cv=none; d=google.com; s=arc-20160816; b=QNcP87xnUwk7kEFGiTWJTAFPud5jCKLQ0ri7I7H3ACZ30UE+JPY34E5qHHv8MPLs+R TosveSSWrE/CpQD1E3XMMgUUA7Ea33A2wXlQHo01mM4S0EZ2AJoe6Cxfu3GExVCpxIBv ayC81mVrJjijQlwdZzb5vkL/z4C8hDAVMf/TjyTD1HsNgWqAZhWoMUDnbaKEYmMRP4CY oPZRf+Bf2Q6diATwDZBpmWP7WUVB7bp6TT7Xg4H90UsbgfFcBAzg+JBm2GvdS+6eiqEy ofOA6jg4rTYqXnuEMuf50aEFjWXsn5xwbZL41ABxmvAQR0Ued/iD9Jvs6NPzvZw0XmXn 4Ntw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=mT10dQ5B3B1Zwvd7cpxM0G23XIS8SgVKNnkFI4vuMZ8=; b=r9T4L/l1XCSsxZxjVyBVqP7kQ8HRBtptAJUQXtfeJ0FDrgvaMSmC8aOr4Q52fbAj9G kx78RR0owOctrY4gMo46sRWTCVpV+Y1I49jgGvy0w4x2pomVyOWnPwoBvcY8G3D6HLcL QRuW5jXWAgDoxhL4g0WULmMgEBxapYDRpZnqwdO2wo/QFgLPvdKwu/oAY+9kNLKj9FKQ j1ha4eqFcCYJdx789ZzGdkgAZNXNYjAeJfVIikhdHw/qPdMJoiED6mkC5LLxEiAtVToN 7p/grAFuhTGKsEPv9HtBDkjjR5qx0GAQgloz7UgBZplhxrZhQoTM/pUVpRBUDgQvRDGd dk+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jNJz453F; spf=pass (google.com: domain of gcc-patches-return-490281-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490281-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y10-v6si31142242plt.145.2018.11.16.07.54.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:54:34 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490281-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jNJz453F; spf=pass (google.com: domain of gcc-patches-return-490281-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490281-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=RSfI+BuDLkVMSzau KOMAz0dzm7Y50A2a2FZ/viBqaxQEStGVVFyBEjopLWx8jhIwWlwJuiJv4CwNCCD2 lrx00KN4szBzXz9bmKCZWRlmF2JxrkJX9pakXDySRRj4KZ26wfjuEv9+RYO8ja6N SHanp5rhkGpmCqSxI8Abv3inxZU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=t5XxNMSA8ILLgkaY3Qspzt seQuA=; b=jNJz453FMs9rFZLWwgGkUp3iBuA786CgqO6fG4BHaNKZcShQO6jNbh kEQSyqj/ZjsYhH6qZb5YVezHNyf8i+dMA9NQQaUEQqHrvgKkDqwITqxctSGlrkc3 PSFf9saQDNSWaXhqpu0WEMVn8q+2NfKn38fM5qiBw9z3Y1h8kHGic= Received: (qmail 29925 invoked by alias); 16 Nov 2018 15:54:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 29909 invoked by uid 89); 16 Nov 2018 15:54:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:noexcep X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:54:20 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFi9Gb008767; Fri, 16 Nov 2018 16:54:18 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nr7cyrgpq-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:54:18 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9FD8931; Fri, 16 Nov 2018 15:54:17 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 85F65501D; Fri, 16 Nov 2018 15:54:17 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:54:16 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 18/20] [ARM][testsuite] FDPIC: Enable tests on pie_enabled targets Date: Fri, 16 Nov 2018 16:47:46 +0100 Message-ID: <20181116154808.25154-19-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Some tests have the "nonpic" guard, but pass on arm*-*-uclinuxfdpiceabi because it is in PIE mode by default. Rather than adding this target to all these tests, add the "pie_enabled" effective target. 2018-XX-XX Christophe Lyon gcc/testsuite/ * g++.dg/cpp0x/noexcept03.C: Add pie_enabled. * g++.dg/ipa/devirt-c-7.C: Likewise. * g++.dg/ipa/ivinline-1.C: Likewise. * g++.dg/ipa/ivinline-2.C: Likewise. * g++.dg/ipa/ivinline-3.C: Likewise. * g++.dg/ipa/ivinline-4.C: Likewise. * g++.dg/ipa/ivinline-5.C: Likewise. * g++.dg/ipa/ivinline-7.C: Likewise. * g++.dg/ipa/ivinline-8.C: Likewise. * g++.dg/ipa/ivinline-9.C: Likewise. * g++.dg/tls/pr79288.C: Likewise. * gcc.dg/addr_equal-1.c: Likewise. * gcc.dg/const-1.c: Likewise. * gcc.dg/ipa/pure-const-1.c: Likewise. * gcc.dg/noreturn-8.c: Likewise. * gcc.dg/pr33826.c: Likewise. * gcc.dg/torture/ipa-pta-1.c: Likewise. * gcc.dg/tree-ssa/alias-2.c: Likewise. * gcc.dg/tree-ssa/ipa-split-5.c: Likewise. * gcc.dg/tree-ssa/loadpre6.c: Likewise. * gcc.dg/uninit-19.c: Likewise. Change-Id: I1a0d836b892c23891f739fccdc467d0f354ab82c -- 2.6.3 diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C index 2d37867..906a44d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C @@ -1,6 +1,6 @@ // Runtime test for noexcept-specification. // { dg-options "-Wnoexcept" } -// { dg-do run { target nonpic } } +// { dg-do run { target { nonpic || pie_enabled } } } // { dg-require-effective-target c++11 } #include diff --git a/gcc/testsuite/g++.dg/ipa/devirt-c-7.C b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C index 2e76cbe..efb65c2 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-c-7.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C @@ -1,7 +1,6 @@ /* Verify that ipa-cp will not get confused by placement new constructing an object within another one when looking for dynamic type change . */ -/* { dg-do run } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -Wno-attributes" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-1.C b/gcc/testsuite/g++.dg/ipa/ivinline-1.C index 9b10d20..2d988bc 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-1.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-1.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls are inlined even without early inlining. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-2.C b/gcc/testsuite/g++.dg/ipa/ivinline-2.C index 21cd46f..d978638 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-2.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-2.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls using this pointer are inlined even without early inlining.. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-3.C b/gcc/testsuite/g++.dg/ipa/ivinline-3.C index 1e24644..f756a16 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-3.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-3.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls on an object refrence are inlined even without early inlining. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-4.C b/gcc/testsuite/g++.dg/ipa/ivinline-4.C index cf0d980..5fbd3ef 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-4.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-4.C @@ -1,7 +1,7 @@ /* Verify that simple virtual calls are inlined even without early inlining, even when a typecast to an ancestor is involved along the way. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-5.C b/gcc/testsuite/g++.dg/ipa/ivinline-5.C index f15ebf2..6c19907 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-5.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-5.C @@ -1,6 +1,6 @@ /* Verify that virtual call inlining does not pick a wrong method when there is a user defined ancestor in an object. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-7.C b/gcc/testsuite/g++.dg/ipa/ivinline-7.C index a7b41e7..fd6aba6 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-7.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-7.C @@ -1,7 +1,7 @@ /* Verify that simple virtual calls are inlined even without early inlining, even when a typecast to an ancestor is involved along the way and that ancestor is not the first one with virtual functions. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-8.C b/gcc/testsuite/g++.dg/ipa/ivinline-8.C index 5c3299f..bc81abf 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-8.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-8.C @@ -1,6 +1,6 @@ /* Verify that virtual calls are inlined (ithout early inlining) even when their caller is itself indirectly inlined. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-9.C b/gcc/testsuite/g++.dg/ipa/ivinline-9.C index 41b2381..0917f15 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-9.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-9.C @@ -2,7 +2,7 @@ inlining, even when a typecast to an ancestor is involved along the way and that ancestor itself has an ancestor wich is not the primary base class. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/tls/pr79288.C b/gcc/testsuite/g++.dg/tls/pr79288.C index 9f488df..da6751f 100644 --- a/gcc/testsuite/g++.dg/tls/pr79288.C +++ b/gcc/testsuite/g++.dg/tls/pr79288.C @@ -1,5 +1,5 @@ // PR c++/79288 -// { dg-do compile { target nonpic } } +// { dg-do compile { target { nonpic || pie_enabled } } } // { dg-require-effective-target tls } // { dg-options "-O2" } // { dg-final { scan-assembler-not "@tpoff" { target i?86-*-* x86_64-*-* } } } diff --git a/gcc/testsuite/gcc.dg/addr_equal-1.c b/gcc/testsuite/gcc.dg/addr_equal-1.c index 18b0dc9..35fa010 100644 --- a/gcc/testsuite/gcc.dg/addr_equal-1.c +++ b/gcc/testsuite/gcc.dg/addr_equal-1.c @@ -1,5 +1,4 @@ -/* { dg-do run } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-require-weak "" } */ /* { dg-require-alias "" } */ /* { dg-options "-O2 -fdelete-null-pointer-checks" } */ diff --git a/gcc/testsuite/gcc.dg/const-1.c b/gcc/testsuite/gcc.dg/const-1.c index a5b2b16..aa20aad 100644 --- a/gcc/testsuite/gcc.dg/const-1.c +++ b/gcc/testsuite/gcc.dg/const-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -Wsuggest-attribute=const" } */ extern int extern_const(int a) __attribute__ ((const)); diff --git a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c index 06b415e..dd58457 100644 --- a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c +++ b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining -fgnu89-inline" } */ void abort (void); int error_code; diff --git a/gcc/testsuite/gcc.dg/noreturn-8.c b/gcc/testsuite/gcc.dg/noreturn-8.c index 294800b..ce41cab 100644 --- a/gcc/testsuite/gcc.dg/noreturn-8.c +++ b/gcc/testsuite/gcc.dg/noreturn-8.c @@ -1,4 +1,4 @@ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2" } */ void exit (int); void noreturn_autodetection_failed (); diff --git a/gcc/testsuite/gcc.dg/pr33826.c b/gcc/testsuite/gcc.dg/pr33826.c index df83915..d222774 100644 --- a/gcc/testsuite/gcc.dg/pr33826.c +++ b/gcc/testsuite/gcc.dg/pr33826.c @@ -1,8 +1,7 @@ /* Regression test for PR middle-end/33826 */ /* Verify that recursive functions cannot be pure or const. */ -/* { dg-do compile } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O1 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const" } */ int recurse1 (int); diff --git a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c index 1bf4997..30156a3 100644 --- a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c +++ b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { nonpic } } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-fipa-pta -fdump-ipa-pta2 -fno-ipa-icf" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c index e10a25d..f9d2dd4 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { nonpic } } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ static int a; int f; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c index 2d713d6..3b5a94f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-tree-fnsplit -fdump-tree-optimized --param=builtin-expect-probability=100" } */ struct a {int a,b;}; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c index 028becd..b4e9296 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -fdump-tree-pre-stats -fdump-tree-fre1" } */ #include From patchwork Fri Nov 16 15:47:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151367 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp591627ljp; Fri, 16 Nov 2018 07:54:53 -0800 (PST) X-Google-Smtp-Source: AJdET5fegdadn2CjgQEYdNWlHgkWRPIRMwAq33fSDpXqq3lVMHSmDajpxAPHCf1ySEqGOywNJPsA X-Received: by 2002:a17:902:b584:: with SMTP id a4mr11284157pls.246.1542383693624; Fri, 16 Nov 2018 07:54:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383693; cv=none; d=google.com; s=arc-20160816; b=X5H0aylL993OZM06eB+vCTkvG1bVOl/RtNF/g0wR9qcW/kFERHGmaRLPwVbW/jX4DZ M70nuhnLM6bX1CFdPlbLAv8tuRKsF8xjAcgynWErGn1XbJnpAvMEYKve8gwltwcCT7ki eMCuptEArejN9HfoLv+RIYGOrl0cL4QdVcJW8S/iI5e0OJX+EWD0GUo+fh8LH685AlOY tBBGnV27K5l9oxLhVMz6eGpbgXZ6v7eoSwsh8y+lQbm9Nzm6/SqX/Pp1fbYt4HNIhd8i z36wTo0RQG4gkPHkEp1jEWWjTDcCYHkjsCn8q/KrFc1UW+YEOc8kIAWshlv9gql6qUZX jakQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=5pGNw++6w4XkIYmngqlzQM683+H564py9s4c8+L1b6Y=; b=qAlHd923xNTAuKgHKRHk1ohGB9faC46yHkHDwYxMLjM55XX33OyGKCHWDmqlN1s7pU gZ4rDiLdmvjzOQ2rNDittlLap0cBq4AqOH4v1poB1UXJj1tlYp9hPqJCEq1/d+kSFSxd pI5UAadgVQgjDc/GWtIIXv6KJTNWWHusVzGflII9fHr/SLTn6b2HW2LIl47N7FxfyMDW SubYtyjfoNpwIKm2wc8KH/noUuBC04MnkDSyEBBOA87xkxxNZTJgy1HFPeEbGenUCdPP 9Afg32GkJJtEvBaN37z0Wtjn6vTcKWeG/70765gGBB6LFKaRQphtiQProYYQoInjdv80 EpdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Dhk5CCDJ; spf=pass (google.com: domain of gcc-patches-return-490282-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490282-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id l24si33463916pgj.171.2018.11.16.07.54.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:54:53 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490282-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Dhk5CCDJ; spf=pass (google.com: domain of gcc-patches-return-490282-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490282-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=w4S8pL4Hu3Uqv444 DPmSacGQu+vG27mV8yg5H1uE/XvTPq2Nwil/r7pFOVbZrG0puDrDr9EgrKEKpc9p R7TPVew7G7rWteyVfMYxdB2j/sGo22lE65Qvstsb3W3v20jvie3WH7D6ooxDz/sg ZgpE2awZFv1DUYizNqRi40U6cpk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=nl2T//wwiQkZjVdNuCttcq 3KkLY=; b=Dhk5CCDJqB9FB7p1bMijY3XV5c/n3t8SqQVDp6hAQiuOXg4cPoZUJe +PcTTbJCK9lb/rg8RcM1PndNqaZKOZ7MRQCtzggyw7Enm2Nec+tIcvEe4bc5bBk5 6z8Y6H2YeJ1EN7OE426FwB0kl9ItNnT7F/5xoF7KMOBY5TMEcs3UM= Received: (qmail 31359 invoked by alias); 16 Nov 2018 15:54:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 31348 invoked by uid 89); 16 Nov 2018 15:54:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1010 X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:54:40 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFiO41030543; Fri, 16 Nov 2018 16:54:38 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2nsxqxrpxm-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:54:38 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D610134; Fri, 16 Nov 2018 15:54:37 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C10435020; Fri, 16 Nov 2018 15:54:37 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:54:37 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 19/20] [ARM][testsuite] FDPIC: Adjust pr43698.c to avoid clash with uclibc. Date: Fri, 16 Nov 2018 16:47:47 +0100 Message-ID: <20181116154808.25154-20-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes uclibc defines bswap_32, so use a different name in this test. 2018-XX-XX Christophe Lyon gcc/testsuite/ * gcc.target/arm/pr43698.c (bswap_32): Rename as my_bswap_32. Change-Id: I2591bd911030814331cabf97ee5cf6cf8124b4f3 -- 2.6.3 diff --git a/gcc/testsuite/gcc.target/arm/pr43698.c b/gcc/testsuite/gcc.target/arm/pr43698.c index 1fc497c..3b5dad0 100644 --- a/gcc/testsuite/gcc.target/arm/pr43698.c +++ b/gcc/testsuite/gcc.target/arm/pr43698.c @@ -6,7 +6,7 @@ char do_reverse_endian = 0; -# define bswap_32(x) \ +# define my_bswap_32(x) \ ((((x) & 0xff000000) >> 24) | \ (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | \ @@ -16,7 +16,7 @@ char do_reverse_endian = 0; (__extension__ ({ \ uint64_t __res; \ if (!do_reverse_endian) { __res = (X); \ - } else if (sizeof(X) == 4) { __res = bswap_32((X)); \ + } else if (sizeof(X) == 4) { __res = my_bswap_32((X)); \ } \ __res; \ })) From patchwork Fri Nov 16 15:47:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151368 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp592052ljp; Fri, 16 Nov 2018 07:55:18 -0800 (PST) X-Google-Smtp-Source: AJdET5cCqClfCxJ9pcxHSWcWu1QI54CKh7cnehYKYPMEKTSDgNwOEW+nxYztZerp2+SXLmEHHR8e X-Received: by 2002:a17:902:1124:: with SMTP id d33-v6mr11825193pla.125.1542383718021; Fri, 16 Nov 2018 07:55:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383718; cv=none; d=google.com; s=arc-20160816; b=AP12KFOkZT1bk7NCFKBL7am/YpXeYqTIeJ8V+1OShEEoGNuLM8uqev+nkDSNTR7ELO 7Kb0FyC9S4eIWXk/vDrRwKP/pwYDiL+SklQPA4OaNaY7arnZP7P/ZqaFLauD7hqbwcS4 q21lubRvaSDiMay0a3dCbvUPnasFD7lcKWBKLj8VnrIxjoqPpzsHPMXvRXLtrlQ3+cAt 0Nql0P0K5GmTBmOmcafwtk4YJ5PLPUDZusw+k4ImEQXx8ydCmEh7jg/ZkPYbjTBiFshX Azo1uxGwG/j9CtvIk5/l6cdSufeUHkNPaaTJwyXLiHjy758s0GbhZztBK6yIjnlaX+YY r0Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=6qcxW9yoMFyKE9ieflTNRmPI3M+NfAvowRpAjfXJ4ck=; b=F7ykZXFHWga4YCNzo5d7xsGnIsC5mH5FQcrmb0PqGMN2DOqS7binounzXxd4TmdWGe gMQxJRnv6UeBz4r44uxlae7ijq0X+aJyWttL0RK5w28tHHQB02H7vp8zrvoMZqVTQjjm oG7bqI4ms+gOP1jUpLSl7L4trnAdAhbwkH4N6tgbgK0I3ht1ydr+Yg+uRUAOFlGmylyj 2RBjihgqCXvg5osabyQ0IdLtb275FW58ha87iYSqx4mlcqvoB2Q4Rj4i0OPZmKESv2E1 clG0BqbfnxLZAPex/EDCB/e6DtZfKZd/NQnwcKpYxmxDuSSgB7GeaiF/SXmP2aR+N0Hx OXXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=YBALkm6I; spf=pass (google.com: domain of gcc-patches-return-490283-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490283-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id x1si9774669pfn.111.2018.11.16.07.55.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:55:18 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490283-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=YBALkm6I; spf=pass (google.com: domain of gcc-patches-return-490283-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490283-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=i9pZbMrpqnPBpYCW YytTYGHElxztKfeCnD5ZkY2DAP/9abneOhCKBwdUEfCz6F3etIPCZGHOzwPoY03Z 9ND7++oemPeScNNCk5UfuDWwgKq4QUVE/v5nrCw8bEADyBbf5XOOZ/buTe3bEeTj j8aTaur+7NdDkwHDgETibr2i8Jw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=dBav5QPE5jskRCDgiUOv2V PwlPs=; b=YBALkm6IfWa9AFC1EwlUapu6M1euG39rhU7tL8B9QVQfa/vNK5TDD8 z3GMujcfqagk3MEetAZ/rMEv4qEdsdAeE117HfHo4SrKDJr9pjMzmGG3Ys/F67j4 Jte6uQUDzs/WS9P9lDVoSxXWklKahJiNTt7UU9DMqsamQEY2Ok3I8= Received: (qmail 32888 invoked by alias); 16 Nov 2018 15:55:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 32873 invoked by uid 89); 16 Nov 2018 15:55:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SEM_URI, SEM_URIRED, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:effecti X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:55:01 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFiIct016761; Fri, 16 Nov 2018 16:54:59 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2nr7cx0tkv-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:54:59 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 77DCC34; Fri, 16 Nov 2018 15:54:58 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0FB895025; Fri, 16 Nov 2018 15:54:58 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:54:57 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 20/20] [ARM][testsuite] FDPIC: Skip tests using architectures unsupported by FDPIC Date: Fri, 16 Nov 2018 16:47:48 +0100 Message-ID: <20181116154808.25154-21-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Since FDPIC currently supports arm and thumb-2 modes only, these tests fail because they enforce an architecture version that doesn't match these restrictions. This patch introduces new values for the arm_arch effective-target (v4t_thumb, v5t_thumb, v5te_thumb, v6_thumb, v6k_thumb, v6z_thumb) as needed, and adds them to the relevant tests. It also adds the corresponding non-thumb effective-target to the tests that were missing it. 2018-07-13 Christophe Lyon * lib/target-supports.exp (check_effective_target_arm_arch_FUNC_ok): Add v4t_thumb, v5t_thumb, v5te_thumb, v6_thumb, v6k_thumb, v6z_thumb. * gcc.target/arm/armv6-unaligned-load-ice.c: Add arm_arch effective-target. * gcc.target/arm/attr-unaligned-load-ice.c: Likewise. * gcc.target/arm/attr_arm-err.c: Likewise. * gcc.target/arm/ftest-armv4-arm.c: Likewise. * gcc.target/arm/ftest-armv4t-arm.c: Likewise. * gcc.target/arm/ftest-armv4t-thumb.c: Likewise. * gcc.target/arm/ftest-armv5t-arm.c: Likewise. * gcc.target/arm/ftest-armv5t-thumb.c: Likewise. * gcc.target/arm/ftest-armv5te-arm.c: Likewise. * gcc.target/arm/ftest-armv5te-thumb.c: Likewise. * gcc.target/arm/ftest-armv6-arm.c: Likewise. * gcc.target/arm/ftest-armv6-thumb.c: Likewise. * gcc.target/arm/ftest-armv6k-arm.c: Likewise. * gcc.target/arm/ftest-armv6k-thumb.c: Likewise. * gcc.target/arm/ftest-armv6m-thumb.c: Likewise. * gcc.target/arm/ftest-armv6t2-arm.c: Likewise. * gcc.target/arm/ftest-armv6t2-thumb.c: Likewise. * gcc.target/arm/ftest-armv6z-arm.c: Likewise. * gcc.target/arm/ftest-armv6z-thumb.c: Likewise. * gcc.target/arm/g2.c: Likewise. * gcc.target/arm/macro_defs1.c: Likewise. * gcc.target/arm/pr59858.c: Likewise. * gcc.target/arm/pr65647-2.c: Likewise. * gcc.target/arm/pr79058.c: Likewise. * gcc.target/arm/pr83712.c: Likewise. * gcc.target/arm/pragma_arch_switch_2.c: Likewise. * gcc.target/arm/scd42-1.c: Likewise. * gcc.target/arm/scd42-2.c: Likewise. * gcc.target/arm/scd42-3.c: Likewise. * gcc.c-torture/compile/pr82096.c: Fix arm_arch effective-target. Change-Id: I0845b262b241026561cc52a19ff8bb1659675e49 -- 2.6.3 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr82096.c b/gcc/testsuite/gcc.c-torture/compile/pr82096.c index d144b70..4e695cd 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr82096.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr82096.c @@ -1,4 +1,4 @@ -/* { dg-require-effective-target arm_arch_v5t_ok { target arm*-*-* } } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok { target arm*-*-* } } */ /* { dg-skip-if "Do not combine float-abi values" { arm*-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ /* { dg-additional-options "-march=armv5t -mthumb -mfloat-abi=soft" { target arm*-*-* } } */ diff --git a/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c b/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c index 88528f1..886a012 100644 --- a/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c +++ b/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_thumb_ok } */ /* { dg-options "-mthumb -Os -mfloat-abi=softfp" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c b/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c index e1ed1c1..2eeb522 100644 --- a/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c +++ b/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c @@ -2,6 +2,7 @@ Verify that unaligned_access is correctly with attribute target. */ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ +/* { dg-require-effective-target arm_arch_v6_ok } */ /* { dg-options "-Os -mfloat-abi=softfp -mtp=soft" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/attr_arm-err.c b/gcc/testsuite/gcc.target/arm/attr_arm-err.c index 630c06a..d410056 100644 --- a/gcc/testsuite/gcc.target/arm/attr_arm-err.c +++ b/gcc/testsuite/gcc.target/arm/attr_arm-err.c @@ -2,6 +2,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_arm_ok } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-add-options arm_arch_v6m } */ int __attribute__((target("arm"))) diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c index 4b48ef8..447a8ec 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v4 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c index 016506f..05db533 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4t_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v4t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c index 9ef944e..78878f7 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4t_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v4t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c index a9403e9..bea25d09 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5t_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v5t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c index f3ad07e..b25d17d 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v5t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c index f98c01a..7b37c7f 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5te" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v5te } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c index 5d71787..27a64a2 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5te" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v5te } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c index 88a5089..bfab765 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c index 90ef9d2..15a6d75 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c index 8de021a..721c9f9 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c index c2fc270..b3b6ecf 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c index ee075e2..27f71be 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6m } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c index 83b4bc4..259d2b5 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6t2" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6t2_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6t2 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c index 1a1cbc5..e624ec5 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6t2" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6t2_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6t2 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c index e2df0d4..66380bf 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6z" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6z_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6z } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c index e4b94ef..23a4fcd 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6z" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6z_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6z } */ diff --git a/gcc/testsuite/gcc.target/arm/g2.c b/gcc/testsuite/gcc.target/arm/g2.c index e368017..da68c8b 100644 --- a/gcc/testsuite/gcc.target/arm/g2.c +++ b/gcc/testsuite/gcc.target/arm/g2.c @@ -4,6 +4,7 @@ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-require-effective-target arm32 } */ /* Brett Gaines' test case. */ diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c index 4cc9ae6..655ba93 100644 --- a/gcc/testsuite/gcc.target/arm/macro_defs1.c +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-options "-march=armv6-m -mthumb" } */ #ifdef __ARM_NEON_FP diff --git a/gcc/testsuite/gcc.target/arm/pr59858.c b/gcc/testsuite/gcc.target/arm/pr59858.c index a944b9a..bcfd5d5 100644 --- a/gcc/testsuite/gcc.target/arm/pr59858.c +++ b/gcc/testsuite/gcc.target/arm/pr59858.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-march=armv5te -fno-builtin -mfloat-abi=soft -mthumb -fno-stack-protector -Os -fno-tree-loop-optimize -fno-tree-dominator-opts -fPIC -w" } */ /* { dg-skip-if "Incompatible command line options: -mfloat-abi=soft -mfloat-abi=hard" { *-*-* } { "-mfloat-abi=hard" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_thumb_ok } */ typedef enum { REG_ENOSYS = -1, diff --git a/gcc/testsuite/gcc.target/arm/pr65647-2.c b/gcc/testsuite/gcc.target/arm/pr65647-2.c index f2985f8..3d9e75f 100644 --- a/gcc/testsuite/gcc.target/arm/pr65647-2.c +++ b/gcc/testsuite/gcc.target/arm/pr65647-2.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target arm_arch_v6_ok } */ /* { dg-options "-O3 -marm -march=armv6 -std=c99" } */ typedef struct { diff --git a/gcc/testsuite/gcc.target/arm/pr79058.c b/gcc/testsuite/gcc.target/arm/pr79058.c index 54a1d8a..7d078ac 100644 --- a/gcc/testsuite/gcc.target/arm/pr79058.c +++ b/gcc/testsuite/gcc.target/arm/pr79058.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_arm_ok } */ +/* { dg-require-effective-target arm_arch_v4_ok } */ /* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" } { "-mcpu=arm7tdmi" } } */ /* { dg-options "-Os -mbig-endian -marm -mcpu=arm7tdmi" } */ diff --git a/gcc/testsuite/gcc.target/arm/pr83712.c b/gcc/testsuite/gcc.target/arm/pr83712.c index 8ed8cdf..4902ec9 100644 --- a/gcc/testsuite/gcc.target/arm/pr83712.c +++ b/gcc/testsuite/gcc.target/arm/pr83712.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok } */ /* { dg-options "-mfloat-abi=softfp -mthumb -march=armv5t -O2" } */ #pragma GCC optimize ("-O2") diff --git a/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c b/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c index b6211f9..c3361e7 100644 --- a/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c +++ b/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c @@ -2,6 +2,7 @@ /* { dg-skip-if "instruction not valid on thumb" { *-*-* } { "-mthumb" } { "" } } */ /* { dg-do assemble } */ /* { dg-require-effective-target arm_arm_ok } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-additional-options "-Wall -O2 -march=armv5te -std=gnu99 -marm" } */ #pragma GCC target ("arch=armv6") diff --git a/gcc/testsuite/gcc.target/arm/scd42-1.c b/gcc/testsuite/gcc.target/arm/scd42-1.c index be60e64..2b8fc0b 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-1.c +++ b/gcc/testsuite/gcc.target/arm/scd42-1.c @@ -3,6 +3,7 @@ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-mcpu=xscale -O -mfloat-abi=softfp" } */ unsigned load1(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/gcc.target/arm/scd42-2.c b/gcc/testsuite/gcc.target/arm/scd42-2.c index 6d9e5e1..4181a75 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-2.c +++ b/gcc/testsuite/gcc.target/arm/scd42-2.c @@ -4,6 +4,7 @@ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */ /* { dg-require-effective-target arm32 } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-mcpu=xscale -O -marm" } */ unsigned load2(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/gcc.target/arm/scd42-3.c b/gcc/testsuite/gcc.target/arm/scd42-3.c index e566cb2..0afd121 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-3.c +++ b/gcc/testsuite/gcc.target/arm/scd42-3.c @@ -3,6 +3,7 @@ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-mcpu=xscale -O -mfloat-abi=softfp" } */ unsigned load4(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 623bfd5..e59c6b7 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3996,12 +3996,18 @@ proc check_effective_target_arm_fp16_hw { } { foreach { armfunc armflag armdefs } { v4 "-march=armv4 -marm" __ARM_ARCH_4__ v4t "-march=armv4t" __ARM_ARCH_4T__ + v4t_thumb "-march=armv4t -mthumb" __ARM_ARCH_4T__ v5t "-march=armv5t" __ARM_ARCH_5T__ + v5t_thumb "-march=armv5t -mthumb" __ARM_ARCH_5T__ v5te "-march=armv5te" __ARM_ARCH_5TE__ + v5te_thumb "-march=armv5te -mthumb" __ARM_ARCH_5TE__ v6 "-march=armv6" __ARM_ARCH_6__ + v6_thumb "-march=armv6 -mthumb" __ARM_ARCH_6__ v6k "-march=armv6k" __ARM_ARCH_6K__ + v6k_thumb "-march=armv6k -mthumb" __ARM_ARCH_6K__ v6t2 "-march=armv6t2" __ARM_ARCH_6T2__ v6z "-march=armv6z" __ARM_ARCH_6Z__ + v6z_thumb "-march=armv6z -mthumb" __ARM_ARCH_6Z__ v6m "-march=armv6-m -mthumb -mfloat-abi=soft" __ARM_ARCH_6M__ v7a "-march=armv7-a" __ARM_ARCH_7A__ v7r "-march=armv7-r" __ARM_ARCH_7R__