From patchwork Fri May 25 08:03:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136803 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3286840lji; Fri, 25 May 2018 01:28:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZofl5w+GPb0/awvmRP9fLs9KckMnAJKnIEisXw0zAdZgF/Gs5KOg7+VbeCcgKw4v1T52/q0 X-Received: by 2002:a62:9515:: with SMTP id p21-v6mr1590195pfd.62.1527236925503; Fri, 25 May 2018 01:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527236925; cv=none; d=google.com; s=arc-20160816; b=MJKVC3pxyBQJu+EoOHra1W5i4op5CYpUKIq323oveOSrDbMsldyQMoT7085CFug3l0 5Sb91K2ZdaDZfSQHv7hhy0t48jcSTE2/gaoEJNALO+rTDv6T11ON39zOMLZwz/RTYKyG 9GqibEOp3pwMmF0q92/cZtCiXpGjzrHCsfHDoKSl+8rCeSqXRLRftAj08fQD7BIcWqqj dq7hAA7xO8dhkv0cOG1Wg3zVbnr5ixxeN2NQqXUaijZh4SaK4+U779CSFQoZn8rmfHcv mmE/xSHuHdVLOicxoJUZ7p2TLvLmfIsivEFz39CCEvGar8cMz0CPVoen1UsMJPjjIkMU DpLQ== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=zNJs1m7/SRHzePdoovHLLPBZQVfOZbfPuomA0JhgvUE=; b=AELDLULhJjnHP21VqCwOybWo4b4/Ik1Zd/7y/GPTXtEq6q+54/95h6HkZ0Z6m89W1F /S87aZYyiQb2rmpwUiBnCPG10BsPty7S5C7cQ+4LMQj1XGyROn7pJ6RXsnYL5FbNOajk Dc+6YfhwBRRfc4rVYeXO32gKE8yQ34OoYwNB+moFYRRMxKt8TGLUHnqZIeqKiUsucknv xTmeYaadYa4kWvx0cLdqRbQsR32PxHsAjJr9OiHBpIb6jtS1hFqAfp0b/blsOC5/uhKa p3pQ+MZyiJeEJrMZH/xCG/BZxICSHyo/ZPOtBNvoYQBds9sa8U6YK6YmuQsp8yhXQ4Ja sN7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=w0of85yb; spf=pass (google.com: domain of gcc-patches-return-478470-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478470-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 b1-v6si22907186plc.403.2018.05.25.01.28.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:28:45 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478470-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=w0of85yb; spf=pass (google.com: domain of gcc-patches-return-478470-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478470-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=cfD t7bGOKR3Qm1UKukzSS6IcRsFIvcQkr4LbvRKsvNkDzWSpYmagOjRYrAdQyAZpplD Xjzxy1OD3ZpwRmRfDaAh8slFnvWY8aEY800O64HMwGDw/iQD4i5l2hCPVRv3svLs Q0q2ZOb+Lt0ORFBt8sQQuYZ00RAZ3Ki+rhYWxldA= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=WybLN5Cas 1/c0QX8MYUvTkfd39k=; b=w0of85ybPNzZJTgR02b00ROM3Zh2pMVzTVZI3ytxD 2mMkZ1W+uObXFv93IDHE9K8iuLOI4Ja2puHbCLfHBA1Kh4ToWVt38bW2h5cZsptU y17dSVpg1OG4hUqS3KwGc/iN8pgOq8a1EhpqeIxe1m4Knuq7pjlZf2WMEcAklfM2 cw= Received: (qmail 44798 invoked by alias); 25 May 2018 08:08:26 -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 42564 invoked by uid 89); 25 May 2018 08:04:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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=gun, HContent-Transfer-Encoding:8bit 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, 25 May 2018 08:04:32 +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 w4P7xOwR010123; Fri, 25 May 2018 10:04:29 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59j8k5sp-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:04:29 +0200 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 6192834; Fri, 25 May 2018 08:04:29 +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 501FA15AB; Fri, 25 May 2018 08:04:29 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:04:28 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 01/21] [ARM] FDPIC: Add -mfdpic option support Date: Fri, 25 May 2018 10:03:14 +0200 Message-ID: <20180525080354.13295-2-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=0 X-IsSubscribed: yes 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.opt: Add -mfdpic option. Change-Id: Ie5c4ed7434488933de6133186da09cd3ea1291a7 -- 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. From patchwork Fri May 25 08:03:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136800 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3286366lji; Fri, 25 May 2018 01:28:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpDfCWfheDQ9ZaXt2VS28U7FaYXh0HUM6YQG8WRmtAsS7R+s6N+KaFKvdIITWmpUkYl029Y X-Received: by 2002:a65:5b8a:: with SMTP id i10-v6mr1250581pgr.352.1527236891054; Fri, 25 May 2018 01:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527236891; cv=none; d=google.com; s=arc-20160816; b=f/go1PLDUHzH8zStXjYSQF2zWix9gOX1+r/uJjSOsmp0vS9UjTjbrCHCVsIyO0dm5d SnUJL+fCcPYB+8oquWFroEU0N9S6XnRr+zJizzxbxI33FIlKrXYbdGYMx090S5yrOhT8 B0XyILmaBp0qSB0vXQJFTSpn6aN8tuvA6owxMq8IBE/VIGFouWefGTAM0vPYHHytql11 47yzrD1Dwsc6QJk6+bT8OhiR/vv3xllyywZGf2ooYdG+bbG0G7ADhKujC+ARtcPg56O4 +wiaFis9budU6TfxnuIygS9fLz0Igs0nf52sVnqrdZierVZa6BTs0eODL3/ceP0g9ovC WBug== 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:to:from :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=DA4sA0cW2KNO0bmNxUmteYETJXN2QyKUfErcq/N0bAU=; b=JxE2pzsDrFiFpWnCP+2/PBWXjtdIVjkFcw19Iw5A1BsEwz3Vr4eftK7lJiRvxC/pqb XCRt+uvzuOcSG9qaAJAuMvyNkl0yo0LBXBjwVOZ+ThnPsmGtgnMdkXbouHPs1cQ7aUb6 2ggwdw2XY/gKlV1/GZJKRRFrtxm/ydF76neeWr3zGmNP1bdmP5kjMzBavCD8+g6qWdQp ARWzJmHSwDIzdbiVxlRbX5sbgY8ugqZLTLzd+9DfgsYx8KYKsWNHKb2DMFsGjMjVpOdn fFxHB4oQIw/8Z/MhCPjdfpLoSli7leu9hgSYJcNGiKEVrYBj0lYNTuj5ww+iVGZbU9cq QsaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XKdmHYYN; spf=pass (google.com: domain of gcc-patches-return-478467-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478467-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 f95-v6si23544721plb.401.2018.05.25.01.28.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:28:11 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478467-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=XKdmHYYN; spf=pass (google.com: domain of gcc-patches-return-478467-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478467-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:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=n1zGEl4B4stf4bSsPy5D/fCUqbZMw i5m6YlonmKXLt5GxD37xlrUUJoeGpTX0dG8rXf+LrSfZ5c9/rl4OG+nM0l5JP0ML kNXWARVQg0nfq2QbANuRLPCqW+Gb30E3/THnE+ZbaW368crxMZoX9n/dn1QoGJjH ADgzL0pehxjg68= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=ydBvRoxWepwe7iM6ioYMxXE4I3U=; b=XKd mHYYN9PjLVPEykmkTLSso04SHjZXdcxR1Swgf1bBG4+x6zeKcCiI0JO6dMfH/iSP DP6yq06PCsRRQAKc5CDbJwYOXEmGEzoYnH6SqfIKF6RG1+ELEWC7STPXxlrLhHbM nP1xDIja4ax4CNHYyDJ/QSt9F2ES8JQ6gC+b6glE= Received: (qmail 44653 invoked by alias); 25 May 2018 08:08:25 -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 42736 invoked by uid 89); 25 May 2018 08:04:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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, TABLE, 2.17, WAY 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, 25 May 2018 08:04:52 +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 w4P7xTHI028805; Fri, 25 May 2018 10:04:50 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2j5tt2nvx8-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:04:50 +0200 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 DFCEA3D; Fri, 25 May 2018 08:04:49 +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 AFCC61B22; Fri, 25 May 2018 08:04:49 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:04:48 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 02/21] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts Date: Fri, 25 May 2018 10:03:15 +0200 Message-ID: <20180525080354.13295-3-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=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*. * config/tls.m4 (GCC_CHECK_TLS): Likewise. * gcc/config.gcc: Handle *-*-uclinuxfdpiceabi. * libatomic/configure.tgt: Handle arm*-*-uclinux*. * libgcc/config.host: Handle *-*-uclinuxfdpiceabi. * libitm/configure.tgt: Handle *-*-uclinux*. * libatomic/configure: Regenerate. * libitm/configure: Regenerate. * libstdc++-v3/acinclude.m4: Handle uclinux*. * libstdc++-v3/configure: Regenerate. * libstdc++-v3/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 4e170c8..5a8676e 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 d73e2cb..f3fdbf8 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -749,7 +749,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 @@ -758,7 +758,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 @@ -778,7 +778,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*) @@ -1130,7 +1130,7 @@ arm*-*-netbsdelf*) tmake_file="${tmake_file} arm/t-arm" target_cpu_cname="arm6" ;; -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 b902e2c..5b3ef8e 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -5819,7 +5819,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 ;; @@ -8305,7 +8305,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*) @@ -8900,7 +8900,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 @@ -10431,7 +10431,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 f8fd782..479d7c3 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -235,7 +235,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 @@ -421,7 +421,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 dbf386d..fd82500 100644 --- a/libitm/configure +++ b/libitm/configure @@ -6494,7 +6494,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 ;; @@ -8981,7 +8981,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*) @@ -9576,7 +9576,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 @@ -11107,7 +11107,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 @@ -13008,7 +13008,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 @@ -13595,7 +13595,7 @@ interix[3-9]*) postdeps_CXX= ;; -linux*) +linux* | uclinux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 @@ -13846,7 +13846,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 @@ -14767,7 +14767,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 @@ -16239,7 +16239,7 @@ fi case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then @@ -16362,7 +16362,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 4f37b6a..ff2b59c 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1403,7 +1403,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 ], @@ -1525,7 +1525,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 @@ -2410,7 +2410,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*) @@ -2656,7 +2656,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 ;; *) @@ -4290,7 +4290,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*) @@ -4427,7 +4427,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 f3522ee..3993dd2 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -6414,7 +6414,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 ;; @@ -8766,7 +8766,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*) @@ -9361,7 +9361,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 @@ -10901,7 +10901,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 @@ -12826,7 +12826,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 @@ -13413,7 +13413,7 @@ interix[3-9]*) postdeps_CXX= ;; -linux*) +linux* | uclinux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 @@ -13664,7 +13664,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 @@ -14585,7 +14585,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 @@ -15842,7 +15842,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*) @@ -16259,7 +16259,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 ;; *) @@ -20535,7 +20535,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 @@ -21035,7 +21035,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 @@ -27927,7 +27927,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 @@ -53603,7 +53603,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 @@ -59804,7 +59804,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 @@ -78425,7 +78425,7 @@ fi case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then @@ -80061,7 +80061,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*) @@ -80484,7 +80484,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 caea9de..067d6e1 100644 --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -261,7 +261,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 @@ -324,7 +324,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 @@ -355,7 +355,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 24d13f3..048931b 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 May 25 08:03:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136807 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3291134lji; Fri, 25 May 2018 01:33:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqHgGeLsDfuhzrayUJ6sGyIT8JM5xMSGr2CoXOJHyQRmiNXGZZuuYz5z/+bj3Qzqqkn3BFd X-Received: by 2002:a17:902:8a95:: with SMTP id p21-v6mr1625660plo.325.1527237229706; Fri, 25 May 2018 01:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237229; cv=none; d=google.com; s=arc-20160816; b=MVYoK9SlnIjRr+5rJSrQclDTWuNe23vXraOO9vkZjhI1kHR0zp4eDg/EPoeT4pmEdC KS0FcLu2l1BvUXhEP99coF0hVF5cyCvKORlLFuCOrs1poldCRXQhRqH7cIyk53MSYLKC vO/Y9ubK//pA6Ev+KL+9HW0jedx3eQmNLmKSlk1HTVKqV92sINikITEn+bM4HPiNGslb rmv9yACpseDQNcEH3htZTkxLzypeacbgNfHCKEYBDXdtSpyKA0ZruASeIBcBnod3KkI3 FqBXLyfYTPllOEl4k2hhY4hNM1Nm9a8hhTGZREbgdtTdO1Cv9QD45af/gx53AT9C3v5O gWCA== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=ehMP2h7Y79FY8PG+z5p6HrVwzD3c16nFMbHF3kRxABY=; b=lDqnmt9dB7GAsNUttuGrd7Y1sSXv5BQiWntOhae5WDlalN9CEhYf0MWbbbcyiTU0bx VstpzshR0/4uJvmAMi6+w+vAivFWvGzZ1IjXC6ic0JLuBZC+piubEYCD+Li6Q1edtMNO JpcW1faA383xR/T23alKmxRvXwzK9pZYNj5xXAXwgAjkenvDwguT7hNWaIZE1hZ0vkzj BtTjWCBssWX4LSLmnDxRxb5+YW4BF3fMKqM5EguMEGmNfYd37Y8MxuhSJd7PG5k9IUr8 kPxAG4ozBTqq5TH5lH7Lx6yjHUfT0kOJgeKtzqDqL14k/EPxDiwp5WIVx6KZ+MtMl7Gy qsgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ntHcgVeV; spf=pass (google.com: domain of gcc-patches-return-478474-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478474-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 f26-v6si3113448pgn.247.2018.05.25.01.33.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:33:49 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478474-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=ntHcgVeV; spf=pass (google.com: domain of gcc-patches-return-478474-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478474-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=MN3 aoxhoo93LW/ZnzplnU+f90hXdW8v9bfnI2qkkdVvlAo10O6hfd7OO/zMtLMCgBaz 38DWLXW/P29LRcLmQ2ZauXFd+L4qHRZYPCDeTeB//ZA2d7g5lSxa6WRKigJsM8mS g5SKxuwMxdo+CfCts8xzegYAveSkEyPuvPtbVySg= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=XZF3EN8Z3 1GQcax47Ye8HwGs4+I=; b=ntHcgVeVTFQXMBcgjdSTLfwUBCogF6ZCMIQu/lxBJ TMAw2NdYOUy/eVYFTw+JFIDkA68ywqDflqjXkM/HU0qxD2PTVqzZgDmEyAofVnCI a7boJkbxHOlfvEPfysXlbwDl30Kuwuhl6ulkrvotFHiKeX4VM5JlcXP3xrOVXTc9 20= Received: (qmail 74245 invoked by alias); 25 May 2018 08:09:38 -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 42841 invoked by uid 89); 25 May 2018 08:05:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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=fnopie, fno-pie, fnoPIE, fno-PIE 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, 25 May 2018 08:05:13 +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 w4P7xBwI003910; Fri, 25 May 2018 10:05:10 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2j59prjvm2-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:05:10 +0200 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 2807B38; Fri, 25 May 2018 08:05:10 +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 E9F491B22; Fri, 25 May 2018 08:05:09 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:05:09 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 03/21] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided Date: Fri, 25 May 2018 10:03:16 +0200 Message-ID: <20180525080354.13295-4-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=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 f3fdbf8..01b81c6 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1140,6 +1140,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 vxworks-dummy.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 8585fde..4cee958 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -98,11 +98,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 1dce1e6..dff34cd 100644 --- a/libsanitizer/configure.tgt +++ b/libsanitizer/configure.tgt @@ -43,6 +43,9 @@ case "${target}" in ;; s390*-*-linux*) ;; + arm*-*-uclinuxfdpiceabi) + UNSUPPORTED=1 + ;; arm*-*-linux*) ;; mips*64*-*-linux*) From patchwork Fri May 25 08:03:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136798 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3286056lji; Fri, 25 May 2018 01:27:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrxbU10frVcYS6u7lcsozKRgebx9mjLjw6MnmDQzWkYWUV3ZXxTTn+UX6Ckfp11bSiR0qba X-Received: by 2002:a17:902:22a:: with SMTP id 39-v6mr1624612plc.146.1527236867740; Fri, 25 May 2018 01:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527236867; cv=none; d=google.com; s=arc-20160816; b=rq6nmR5qNrLQdFYd3dQApwLqojhn3DCEuoxJ7O2di/3UcoX9GUXuUbggOKy6cK3HcI 6EZPKK/TiJwMtTaWkSX7KQuROCctvdeI8UeWucxrRJ/LqBX7K/+BoZxMgogES3RrZ8PL RVuoemfdkBb2Nt6dxGlfZE5Mj2quzBhqdXLE2vW3Xlk4/55EATWCMx5dl3m1CasA9M7N RUtbPGXIWT3AuHOCPyOPpqqy+tB1+zDyFLDZ2dh2ce/6iIGf6rnEnzAZn7T2tbu0PDtM hCiDHP/r7QL8m5C+swcp+W7dualQsXDunxY7jY0E3G/bofSWPdgH+tJ+j7fgQ8BK/hPM Q39g== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=VJ/H1MGbw3ZBtkELP4bPL2OTb/4BjBKWGxn/wZ6cdm0=; b=lhtqqDc8Y7T7nRy8VWbbDKRQP0KoPN5ONfSgGn7Nk3nJeQVNJdVVnkT2Fs2kmHH/hn AINJkPSqFO6bbaXh91cyjYLxkyQWw+pEIVmlKOf1aWngmac2dwnm3/ePyJ7/TCsB05Au row7KYzs+G2ssv9ltR1SUyZr+jqoKdbNlUIEuXHxY0weT7rExtIQxrNBh1HnLJLpXHYm NraXUUmNOJfcoKHHIjbAUIfEogQSXihanScR9LPNSjjpDib5V1DvggghPNHqxOr0E76J WEncxMx0/fetdFUiI9enhJLTZV05+odcQKy1GTUMjI9jq7xZlATYZa5/heFNsYh1zXGF sWfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=YTjVz6lK; spf=pass (google.com: domain of gcc-patches-return-478463-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478463-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 r2-v6si18290237pgd.517.2018.05.25.01.27.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:27:47 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478463-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=YTjVz6lK; spf=pass (google.com: domain of gcc-patches-return-478463-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478463-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=EWJ 5iu7BtUV6U5T0xycG0dgFq8wpzQUUxzSew+Vrdv2imM0xRYXMm5GVEZzvA6DQfdl KxUh3tmhwjgg6UbwRgKzNBT8t7OK3/Lc39X/Sp0Xa9RAICgivhtOLkMBO3wr/poV PS3ttyTuKxNrCZHFyEgOorlXlZK7k1vTbOJylG98= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=QzbnIgfGR 0QppMe8lZ08E4M5Qlc=; b=YTjVz6lKfWtaYJXFuLNJg1fu5hWj7IiDqhs4a86iX 0M8HsMdOqNoIw5zK+lojq0rj688W7LJE5hQ+egxXgpGLHWF9prfafbFgZTrRq8HI Cah98BcRFE7mJBuubX4mtb187K7bRbktMdBbP0xI0SiDQN/FgQwqZ053jVY/th2u XI= Received: (qmail 44509 invoked by alias); 25 May 2018 08:08:23 -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 42939 invoked by uid 89); 25 May 2018 08:05:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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=cfun, Probe, crtl, addressing 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, 25 May 2018 08:05:35 +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 w4P7wZMS011595; Fri, 25 May 2018 10:05:32 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59qwu3t5-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:05:32 +0200 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 1E09338; Fri, 25 May 2018 08:05:31 +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 8410115AB; Fri, 25 May 2018 08:05:30 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:05:29 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 04/21] [ARM] FDPIC: Add support for FDPIC for arm architecture Date: Fri, 25 May 2018 10:03:17 +0200 Message-ID: <20180525080354.13295-5-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=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 r9. (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. * 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. Change-Id: Icee8484772f97ac6f3a9574df4aa4f25a8196786 -- 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 8537262..edebeb7 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -134,6 +134,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 4a5da7e..56670e3 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3475,6 +3475,12 @@ 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 = 9; + } + if (arm_pic_register_string != NULL) { int pic_register = decode_reg_name (arm_pic_register_string); @@ -7256,6 +7262,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 r9 value. */ + if (decl == NULL) + return false; + + /* Don't tailcall if we go through the PLT since r9 is then + corrupted and we don't restore it for static function + call. */ + if (!targetm.binds_local_p (decl)) + return false; + } + /* Never tailcall something if we are generating code for Thumb-1. */ if (TARGET_THUMB1) return false; @@ -7634,7 +7655,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); @@ -7702,28 +7725,167 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED) emit_use (pic_reg); } +/* Try to know if the object will go in text or data segment. */ +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 (GET_CODE (orig) == SYMBOL_REF) + { + 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); + + if (named_section) + { + /* We don't know where the link script will put this section. */ + res = false; + } + else if (!readonly) + { + res = true; + *is_readonly = false; + } + else + { + res = true; + *is_readonly = true; + } + } + 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); + if (TARGET_FDPIC + && GET_CODE (orig) == SYMBOL_REF + && !SYMBOL_REF_FUNCTION_P (orig)) + { + bool is_readonly; + + if (!arm_is_segment_info_known (orig, &is_readonly)) + { + /* Use GOT relocation. */ + rtx pat; + rtx mem; + rtx pic_reg = gen_rtx_REG (Pmode, 9); - /* 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); + pat = gen_calculate_pic_address (reg, pic_reg, orig); - return emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, labelno)); + /* 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 (is_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)); + } + else + { + /* We use the GOTOFF relocation. */ + rtx pic_reg = gen_rtx_REG (Pmode, 9); + + 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 + { + if (TARGET_FDPIC + && GET_CODE (orig) == SYMBOL_REF + && SYMBOL_REF_FUNCTION_P (orig)) + { + rtx pic_reg = gen_rtx_REG (Pmode, 9); + + 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 + { + /* 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. */ @@ -15938,9 +16100,35 @@ 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 r8 and the GOT address into r9, + returning an rtx for r8. */ + +rtx +arm_load_function_descriptor (rtx funcdesc) +{ + rtx fnaddrReg = gen_reg_rtx (Pmode); + rtx pic_reg = gen_rtx_REG (Pmode, 9); + 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 (fnaddrReg, 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, gen_rtx_REG (Pmode, 9)); + XVECEXP (par, 0, 2) = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 9)); + emit_insn (par); + + return fnaddrReg; +} + /* Return the maximum amount of padding that will be inserted before label LABEL. */ - static HOST_WIDE_INT get_label_padding (rtx label) { @@ -22885,9 +23073,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 + && GET_CODE (x) == SYMBOL_REF) + { + 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 34894c0..e8ef439 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1927,6 +1927,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 361a026..78c236c 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -8031,6 +8031,22 @@ rtx callee, pat; tree addr = MEM_EXPR (operands[0]); + /* Force r9 before call. */ + if (TARGET_FDPIC) + { + /* No need to update r9 if calling a static function. */ + callee = XEXP (operands[0], 0); + if (GET_CODE (callee) != SYMBOL_REF + || !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, 9); + emit_move_insn (pic_reg, get_hard_reg_initial_val (Pmode, 9)); + 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 +8060,13 @@ : !REG_P (callee)) XEXP (operands[0], 0) = force_reg (Pmode, callee); + if (TARGET_FDPIC && GET_CODE (XEXP (operands[0], 0)) != SYMBOL_REF) + { + /* Indirect call. */ + 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 +8078,38 @@ pat = gen_call_internal (operands[0], operands[1], operands[2]); arm_emit_call_insn (pat, XEXP (operands[0], 0), false); } + + /* Restore r9 after call. */ + if (TARGET_FDPIC) + { + /* No need to update r9 if calling a static function. */ + if (GET_CODE (callee) != SYMBOL_REF + || !SYMBOL_REF_LOCAL_P (callee) + || arm_is_long_call_p (SYMBOL_REF_DECL (callee))) + { + rtx pic_reg = gen_rtx_REG (Pmode, 9); + emit_move_insn (pic_reg, get_hard_reg_initial_val (Pmode, 9)); + 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 "general_operand" "r,m")] + UNSPEC_PIC_RESTORE) + (use (match_dup 0)) + (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 +8170,28 @@ rtx pat, callee; tree addr = MEM_EXPR (operands[1]); + if (TARGET_FDPIC) + { + /* No need to update r9 if calling a static function. */ + callee = XEXP (operands[1], 0); + if (GET_CODE (callee) != SYMBOL_REF + || !SYMBOL_REF_LOCAL_P (callee) + || arm_is_long_call_p (SYMBOL_REF_DECL (callee))) + { + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (3)); + + XVECEXP (par, 0, 0) = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (2, gen_rtx_REG (Pmode, 9), + get_hard_reg_initial_val (Pmode, 9)), + UNSPEC_PIC_RESTORE); + XVECEXP (par, 0, 1) + = gen_rtx_USE (VOIDmode, gen_rtx_REG (Pmode, 9)); + XVECEXP (par, 0, 2) + = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 9)); + emit_insn (par); + } + } + /* In an untyped call, we can get NULL for operand 2. */ if (operands[3] == 0) operands[3] = const0_rtx; @@ -8132,6 +8205,14 @@ : !REG_P (callee)) XEXP (operands[1], 0) = force_reg (Pmode, callee); + if (TARGET_FDPIC + && GET_CODE (XEXP (operands[1], 0)) != SYMBOL_REF) + { + /* Indirect call. */ + 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 +8225,28 @@ operands[2], operands[3]); arm_emit_call_insn (pat, XEXP (operands[1], 0), false); } + /* Force r9 after call. */ + if (TARGET_FDPIC) + { + /* No need to update r9 if calling a static function. */ + if (GET_CODE (callee) != SYMBOL_REF + || !SYMBOL_REF_LOCAL_P (callee) + || arm_is_long_call_p (SYMBOL_REF_DECL (callee))) + { + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (3)); + + XVECEXP (par, 0, 0) = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (2, gen_rtx_REG (Pmode, 9), + get_hard_reg_initial_val (Pmode, 9)), + UNSPEC_PIC_RESTORE); + XVECEXP (par, 0, 1) + = gen_rtx_USE (VOIDmode, gen_rtx_REG (Pmode, 9)); + XVECEXP (par, 0, 2) + = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 9)); + emit_insn (par); + } + } + DONE; }" ) @@ -8486,7 +8589,7 @@ (const_int 0)) (match_operand 1 "" "") (match_operand 2 "" "")])] - "TARGET_EITHER" + "TARGET_EITHER && !TARGET_FDPIC" " { int i; @@ -8553,7 +8656,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 b05f85e..5506e2d 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 May 25 08:03:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136808 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3291364lji; Fri, 25 May 2018 01:34:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo+a2UIfqHdSykgEkph6UqmTiTa2eH49fpY2bRvFrEJQSNOUHcnxG3EchwvbLNHzLeJ8t88 X-Received: by 2002:a62:4c53:: with SMTP id z80-v6mr1583914pfa.181.1527237248366; Fri, 25 May 2018 01:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237248; cv=none; d=google.com; s=arc-20160816; b=1Jnp6N7RVbGkhTOQiQg56pXne1oMks2DWCKhpALIIk/bJ9e6P/iJ1f8xtSVVC2Jpx1 rkgc+ey41zGbHvLvNTZBo3LAhyq1fOoX8ZIAPv1bmubM7nXLFx1v9Kn5fjPEHkXFYQG+ bsPufutpHVaIRfEVNfOun34ulSHhV4XrQJjLhYMiNF8esIcJwSNGQnBNhLcG+fuXWN6+ 6W0PfoCYTGNNtKy2JPYgkbMHzQmGpjG7AdqjKP63vJDS9O/0ty56DoLVvYFb8ekc1i+z Ia7Q9kXDrev+gmFciFqwWmwGffOmot31hqmoQN5nFeO6WL8uiKQ+3Tio1ZDKPvhFcpSc COyg== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=jDSe54S2QQ+MEA9LflrDgM3HNwbPzy+IkhcYDErdEvk=; b=aob4ABkG8cJSUEzwOCoo+nZNYpfY89cVy7/aN6bCYF9E00zjIgI1sUK1vrYjaIgo/V 1ak1Uy8gQBjtwb/YgUO3moDKsZ+d1cn/1taThfrQvsHu+BSnAKRKUMxNuyicia+5hv3Z QFbn9uSHk32tWndQDhbShVCndQutSYpSFGKUJ8aLLvRRXthmBiIrGMgZoqYbH4jwIRDL Swh2OSRaonzNGE40dQM7x+XxwqUXhjEQn0r4r+pKMwejeYfP8FNOMpRTx0MONh4oFZ8C jROjt9+2IvRrMtFSetJn/An27AKwK13UPzC38V7wna+okc1tg+zFw5KeZSXtGpPwjFPl 3NoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=enMfCdza; spf=pass (google.com: domain of gcc-patches-return-478475-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478475-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 w21-v6si22705802plp.199.2018.05.25.01.34.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478475-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=enMfCdza; spf=pass (google.com: domain of gcc-patches-return-478475-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478475-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=tY9 wGA9Wpf+Dw4G+oAVdZGNMKzN4yYVWthEoYxzEk5ztQMlZPEOFQ+mE3yi4CQ3Ukyi qiVBIs5NK/Mzv8GHe8mhpzj6Beh7ClM4CS+9qVAYckdmNmjxJ+DmzXAIJlMOc7kd UuPb0A5Q75kv0xZ83HHj49trAng75veEDsVoC1Yo= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=xQB8MsXO0 qkQVDnAQOw4//21D80=; b=enMfCdza5j9nPaxCrXHWmD0x5C0L3H2rTsf2hzTCF O4hU0yyHkHkatLfsRUWh00/VANETRwS0BXCgOnNoAGrO6/wJYT6bdkaOOo6tIUrU OZ8p9qEPBpwANjNohacsA57LXBO9i8iv3J75UVonVoq8RwFj5R58ENn40OzwnUsC 5I= Received: (qmail 74384 invoked by alias); 25 May 2018 08:09: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 43076 invoked by uid 89); 25 May 2018 08:05:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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 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, 25 May 2018 08:05:53 +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 w4P7wZMc011595; Fri, 25 May 2018 10:05:51 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59qwu3vr-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:05:51 +0200 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 EAEEE3F; Fri, 25 May 2018 08:05:50 +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 D18081B22; Fri, 25 May 2018 08:05:50 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:05:50 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 05/21] [ARM] FDPIC: Fix __do_global_dtors_aux and frame_dummy generation Date: Fri, 25 May 2018 10:03:18 +0200 Message-ID: <20180525080354.13295-6-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=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. Change-Id: Iff3aec3815e8ebd87276c0107752f00908a22100 -- 2.6.3 diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c index 5e89445..7238d9a 100644 --- a/libgcc/crtstuff.c +++ b/libgcc/crtstuff.c @@ -432,9 +432,17 @@ __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" + " .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) @@ -476,9 +484,17 @@ 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" + " .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 May 25 08:03:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136801 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3286532lji; Fri, 25 May 2018 01:28:23 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrUeDvG+Cg8bXm5QdlAB3ZdPJoTdmB0eHcLYzgDSszn8Uzg7Cw9Us2lo7SfmEfzBRyddBvO X-Received: by 2002:a62:a89:: with SMTP id 9-v6mr1570254pfk.112.1527236903475; Fri, 25 May 2018 01:28:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527236903; cv=none; d=google.com; s=arc-20160816; b=ZqAfFuwlwXxs84BO+aE0y2YX8Vg/q48ppMPtICyH3veK3Xpa5dSjJteU8eiIBFky+G 6p/1dJ2Z9N3Rb0jAy17TbGByLQ7kqkETegR+wFeA8D/5CpTwvynXaWRVH4FdOY4QD329 1ph2aELOeAL2cAgkgGCdG00g5lBNvhJUsQavms5YuifSaLbZmSrfxkQIgPNsFERe5ElV +qGMuFAvV9nsTJP52F/Q1L5yHpH4aMpDQN/V/fWXdq6PzHFTHW9iADtLxg1OUu4OlYbD FWtp3owGMfGYHWfvdIBQ20LEn5siYKWAjxgjZVcf2kyfW5zI94mc9DW0CdgJrm4gzJrC oqgg== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=Z5B5VbX+1gqjk9iW+Cv/gUNRnsmSZapdsh9kYK0n42g=; b=WroBcR2Z8kGmhS5PDg7/VAEzkKUzEdOhe+yu9xYuQQ0bg20VDvz4DRnK5Fl0Gag0Ga oSX7fytrpsLjazgjuOywgtEMmmSSB1DyyK2ZdvvLW8OuvASgT3T3phHNwOfplp0ymVgW 7ToEF4p/Z9ExhW9FRmttc4LBpH1Uwu3mYwXnk8N3EgOk0M8RkEYuXfK93PzC742F45lZ F0EqqjCcvRvYifKHCSGDM4U/OtFvPSQsAevvpW1bBtXb0WRpt0X6pw/5QF/0JVWnIBBa s5YUu/soL7jqx3aPCP1XV7n643gQ5sxUnmN3CBeA81bBkc8HxONPzFEz/hRGihh2JTeD AjKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eNxIJekZ; spf=pass (google.com: domain of gcc-patches-return-478468-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478468-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 d8-v6si18761711pgt.630.2018.05.25.01.28.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:28:23 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478468-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=eNxIJekZ; spf=pass (google.com: domain of gcc-patches-return-478468-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478468-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=Jmp uMyTAFDFunjC6fTp29MAgd9PLD5xdwXR+YOKeLArTLMxorcuydRXazwNMTfPpvOA +q0kwvr4o99aQfx7z/GF4SVH++rMFR/1Pss2nm6fRnurVtJVvmxVadK9nQ0SKTfG tMDEOpEL0rg55TVyqH5EqqNgYq2oromTwcHrhHCg= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=eCSiOIt9P zQZzttU5weTH0ZeAlU=; b=eNxIJekZU0PbcqSur6qqvdgu6bGp0X98MlWyZJfpM HXpZYV8vnCx7wB5Gsqtmofr4jdN8Bym4kDG6+jF77bP1iPgDKDH4+5X4N2Z6/v1k Z9OuJ+IrBre6GS5xWnIFs/KwJ0jKqmph8Uuki4lMFdsOCMYaG63GlR7oS3AvE248 Z4= Received: (qmail 44730 invoked by alias); 25 May 2018 08:08:25 -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 43215 invoked by uid 89); 25 May 2018 08:06:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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=UD:r 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, 25 May 2018 08:06:15 +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 w4P7xOwv010123; Fri, 25 May 2018 10:06:13 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59j8k649-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:06:13 +0200 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 644EB3F; Fri, 25 May 2018 08:06:11 +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 1F8462402; Fri, 25 May 2018 08:06:11 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:06:10 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 06/21] [ARM] FDPIC: Add support for c++ exceptions Date: Fri, 25 May 2018 10:03:19 +0200 Message-ID: <20180525080354.13295-7-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=0 X-IsSubscribed: yes 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. libgcc/ * config/arm/linux-atomic.c (__ARM_ARCH__): Define. (__kernel_cmpxchg): Add FDPIC support. (__kernel_dmb): Likewise. (__fdpic_cmpxchg): New function. (__fdpic_dmb): New function. * config/arm/unwind-arm.h (gnu_Unwind_Find_got): New function. (_Unwind_decode_typeinfo_ptr): Add FDPIC support. * unwindo-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. Change-Id: Ic0841eb3d7bfb0b3f6d187cd52a660b8fd394d85 -- 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..a20ad94 100644 --- a/libgcc/config/arm/linux-atomic.c +++ b/libgcc/config/arm/linux-atomic.c @@ -23,13 +23,99 @@ a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ +#if defined(__ARM_ARCH_2__) +# define __ARM_ARCH__ 2 +#endif + +#if defined(__ARM_ARCH_3__) +# define __ARM_ARCH__ 3 +#endif + +#if defined(__ARM_ARCH_3M__) || defined(__ARM_ARCH_4__) \ + || defined(__ARM_ARCH_4T__) +/* We use __ARM_ARCH__ set to 4 here, but in reality it's any processor with + long multiply instructions. That includes v3M. */ +# define __ARM_ARCH__ 4 +#endif + +#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \ + || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \ + || defined(__ARM_ARCH_5TEJ__) +# define __ARM_ARCH__ 5 +#endif + +#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ + || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \ + || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \ + || defined(__ARM_ARCH_6M__) +# define __ARM_ARCH__ 6 +#endif + +#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ + || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ + || defined(__ARM_ARCH_7EM__) +# define __ARM_ARCH__ 7 +#endif + +#ifndef __ARM_ARCH__ +#error Unable to determine architecture. +#endif + /* Kernel helper for compare-and-exchange. */ typedef int (__kernel_cmpxchg_t) (int oldval, int newval, int *ptr); +#if __FDPIC__ +#define __kernel_cmpxchg __fdpic_cmpxchg +#else #define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) 0xffff0fc0) +#endif /* Kernel helper for memory barrier. */ typedef void (__kernel_dmb_t) (void); +#if __FDPIC__ +#define __kernel_dmb __fdpic_dmb +#else #define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0) +#endif + +#if __FDPIC__ +static int __fdpic_cmpxchg (int oldval, int newval, int *ptr) +{ +#if __ARM_ARCH__ < 6 + #error architecture support not yet implemented + /* Use swap instruction (but is it always safe ? (interrupt?)) */ +#else + int result; + + asm volatile ("1: ldrex r3, [%[ptr]]\n\t" + "subs r3, r3, %[oldval]\n\t" + "itt eq\n\t" + "strexeq r3, %[newval], [%[ptr]]\n\t" + "teqeq r3, #1\n\t" + "it eq\n\t" + "beq 1b\n\t" + "rsbs %[result], r3, #0\n\t" + : [result] "=r" (result) + : [oldval] "r" (oldval) , [newval] "r" (newval), [ptr] "r" (ptr) + : "r3"); + return result; +#endif +} + +static void __fdpic_dmb () +{ +#if __ARM_ARCH__ < 6 + /* No op? Perhaps flush write buffer ? */ + return ; +#else + #if __ARM_ARCH__ >= 7 + asm volatile ("dmb\n\t"); + #elif __ARM_ARCH__ == 6 + asm volatile ("mcr p15, 0, r0, c7, c10, 5\n\t"); + #endif +#endif +} + +#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..a9598eb 100644 --- a/libgcc/config/arm/unwind-arm.h +++ b/libgcc/config/arm/unwind-arm.h @@ -36,6 +36,25 @@ #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], r9" + : [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 +67,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..f5415c1 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,12 @@ typedef struct __EIT_entry _uw content; } __EIT_entry; +/* Only used in FDPIC case. */ +struct funcdesc_t { + unsigned int ptr; + unsigned int got; +}; + /* Assembly helper functions. */ /* Restore core register state. Never returns. */ @@ -259,7 +266,23 @@ 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 */ @@ -269,7 +292,13 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) else { /* Execute region offset to PR */ +#if __FDPIC__ UCB_PR_ADDR (ucbp) = selfrel_offset31 (ucbp->pr_cache.ehtp); + UCB_PR_GOT (ucbp) + = (unsigned int) gnu_Unwind_Find_got ((_Unwind_Ptr) UCB_PR_ADDR (ucbp)); +#else + UCB_PR_ADDR (ucbp) = selfrel_offset31 (ucbp->pr_cache.ehtp); +#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[9] = 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[9] = 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[9] = 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..c18dffe 100644 --- a/libgcc/unwind-pe.h +++ b/libgcc/unwind-pe.h @@ -259,10 +259,25 @@ read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base, if (result != 0) { +#if __FDPIC__ + 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..138b606 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -93,7 +93,13 @@ 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__ + (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 May 25 08:03:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136799 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3286189lji; Fri, 25 May 2018 01:27:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoy3CLp62mDXELgV1f1m3cJsUHCg195V4SKwEzyoCPzf8mdwaUvtS7LJy2ROjd7WjwlOux3 X-Received: by 2002:a65:40cd:: with SMTP id u13-v6mr1229895pgp.372.1527236878215; Fri, 25 May 2018 01:27:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527236878; cv=none; d=google.com; s=arc-20160816; b=y+Cvu+h4aFrsigQXtOT3pz/lnAEsDUqh4XKK33F4XAMXqXHB4syyyC+YxSSV3dhfsM 72LfkRRr6C4fVoU8/fZOrrPef/VbiTdwAgbkKkLwM5bBn9sDl4zKcGEBA3qKCp06We4C 26L8q6jbyQ0Feyuyk3C00Inov9JxHTWJijVYkw/tQxTApJ4uT5xL5s95uvwE4O65kQIs ZaQJJ37xLy756P0VOXByJTMK2i9soo8Uuy18opFHiCFLMWsdGoUdFVPJdujHhW7z7981 Vgwa1rrXXfgye3gKEs1wiqL4CuR0GOFZhVBwB45v+CT/q4PUtrEEnmG54jWTJ2TMRdRA 2W6g== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=trfXcmzinjVzFdBP9zKZP48wT/ThDpD3XJlBZoG5PK8=; b=WmKJlueup1KjY4N8exeXPFj7G69kpZ3BsVDNCsQxJYkayKvuflAOzCuwOZIcSqfc4l WmhxHwDP0QrCxftE2rpZYo0Z9jHBNtox1i2NF7PdGQD7XiHXHnN8rZbSaziUjk+JEfk7 /QJdR43eOBe72fNu+b8vh0kt9t7cD07OtVpfC4ANOzq5NGr+dorMv0wTgByxbdbZ5aeP YULiE/kGRV5vcVafN0gfvSCf8IdAYPint9fcCguK6Qu/9VrEWROKCKkQU5ZxTm/b0GZ2 WC8eJBEQfj71vF6jfqz0xQPb483BZUgRA4U2z/khP9Ntr7LnKNlzMUGq3oyMfOQhpnto Q6xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Zm2mSx0N; spf=pass (google.com: domain of gcc-patches-return-478466-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478466-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 c83-v6si1052984pfl.319.2018.05.25.01.27.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:27:58 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478466-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=Zm2mSx0N; spf=pass (google.com: domain of gcc-patches-return-478466-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478466-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=avy gQRbJiW/omW5+9bgcEbSgLMa4lLQILUXJgQ5GacH2FQlwVJ/XBwcGnT4hpo9IShU HeCkVMtN5txhOuMny2YrmCN9vaiGlZxRvo6eAPKVIuyCMJvZOfLngzPE8Lvm5bxg srMZdJ973i1QNnoHgMn6I/TrLDxc7pEzMcbAdZcY= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=k/OaXqzAi OIfHWyTkfRkcLxZtvg=; b=Zm2mSx0NJmKhruDmE2vizMy73YDtQzl2M7Cnw6fE3 VuwHwRrycUj3jtZLFcA9WElbUVlk6aS1Cl4cNZhXU6ysa/uG2QGcNmIRwp0fr+jk q8noqOcWAFkeUrFU04cUufa2Gc3UWJh/P0tVCcaHzUv2rftse28bf4QQwRJoQItl 7Q= Received: (qmail 44572 invoked by alias); 25 May 2018 08:08:24 -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 43290 invoked by uid 89); 25 May 2018 08:06:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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:df_regs, 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, 25 May 2018 08:06:34 +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 w4P7xTIB028805; Fri, 25 May 2018 10:06:32 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2j5tt2nw8p-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:06:32 +0200 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 8B19234; Fri, 25 May 2018 08:06:31 +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 72B5F2409; Fri, 25 May 2018 08:06:31 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:06:30 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 07/21] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is RO Date: Fri, 25 May 2018 10:03:20 +0200 Message-ID: <20180525080354.13295-8-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=0 X-IsSubscribed: yes 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Handle FDPIC. (thumb1_compute_save_core_reg_mask): Likewise. Change-Id: Ib534cf91704cdc740867b46a8fe45fda27894562 -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 56670e3..bbf8884 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -19489,7 +19489,7 @@ arm_compute_save_reg0_reg12_mask (void) /* Also save the pic base register if necessary. */ if (flag_pic - && !TARGET_SINGLE_PIC_BASE + && !TARGET_SINGLE_PIC_BASE && !TARGET_FDPIC && arm_pic_register != INVALID_REGNUM && crtl->uses_pic_offset_table) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; @@ -19523,7 +19523,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 + && !TARGET_SINGLE_PIC_BASE && !TARGET_FDPIC && arm_pic_register != INVALID_REGNUM && (df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM) || crtl->uses_pic_offset_table)) @@ -19692,7 +19692,7 @@ thumb1_compute_save_core_reg_mask (void) mask |= 1 << HARD_FRAME_POINTER_REGNUM; if (flag_pic - && !TARGET_SINGLE_PIC_BASE + && !TARGET_SINGLE_PIC_BASE && !TARGET_FDPIC && arm_pic_register != INVALID_REGNUM && crtl->uses_pic_offset_table) mask |= 1 << PIC_OFFSET_TABLE_REGNUM; From patchwork Fri May 25 08:03:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136804 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3287207lji; Fri, 25 May 2018 01:29:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZofheXtXX6q4Iy0zTBL4FLE1Czy9Riqwsgzh5w3j/aqy1bXM1ePc6vRE4TtNRJrkCp1IreY X-Received: by 2002:a62:9099:: with SMTP id q25-v6mr1613547pfk.66.1527236957390; Fri, 25 May 2018 01:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527236957; cv=none; d=google.com; s=arc-20160816; b=F41QVbAAQAvT9yPeJhTTlxOycpw34jNqKombeGj9UCJwYSyZLDqcaZUIsoWXNCcTWp SevVd/h6J9/rwtfx4noMNbEDDty+N95mxJzDjxLQgTzkdYbOxy8jFNI4xBWkw/Fjn9Be T42YPzBXoMRtcIj7DiIWKJDMmhYR8N+FqBqIvPPG8Uw6CrRXrjsU/5fcYkXj1A0hJcMM YI0yg+/99MOpNU0KKh/QlUUvIjDFne8uAozpc8CPQYBSxoeR8/gCvMVdbDS5FiFgZftS Fp7AR/hsgWS7bqxHzKkPu5ip1zO9wI/R/11aPO/3nP/xAGzvamewExJtbqj5AC2RhYqb TqbQ== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=RPOeGbdJzFCB1pDYmc4w+c8buGsv5I1hIqeTpZWUk+U=; b=TX+6HHc20DT+NKEYYYRevagvksaw2iHbtFzvVggEgI58eIgJQm4rMJmtJDM/WSVhZA TSZdlJwZ/yzNmK1/zkaE2/m/tKwZVv/OeazkmCeNGndw5l08xE3yw20BLDyShPp0ZyXJ gxIuWNvK74X4JkYRhg3GVkKW1EAza1x8+emEvCjDhvQKKw+QQItj+ZmjvlNU5bY2hlHH Liza6CiWwMkAhjj9TQAwMyz1gr05f33xyY3XnN9EOmZRMBiTIscs2FH2ZThKRNZ0Xu70 bLafQSYepmypi2sBugSCC2pGESQ8S3nNZE42RMTJfB8muxzWA3M0OHZeFY2j3f5G7CiY gwgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=LJr5Tc7w; spf=pass (google.com: domain of gcc-patches-return-478473-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478473-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 v11-v6si13917198plo.130.2018.05.25.01.29.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:29:17 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478473-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=LJr5Tc7w; spf=pass (google.com: domain of gcc-patches-return-478473-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478473-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=jT4 5IBA1qlFth5jwk0ImuoxFoNbs/AhEkl/VQ6zduNAMfOwuHTmQq1oGFqTkWr/UZGq QRgOpTdwoDoZ5WFtLHN7l4kvocXIBZsahaWAKOoXbNJ2MQ99SrxX/OO1eN1lgliD Smnyl1TfgDow19lf/1VzOI8WC6j3gnn2RFLcxkCc= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=ah7aH7QzR T5DWlSVHVsEuzlFETU=; b=LJr5Tc7wO1+rcAymLjW2yMVmmvpiaIOSW/bzYAoXI Tw7ddAg1vFHB3fi+AcDFNNaMAa/yZ9GA1qiCoQ9ZhWBiVYSx5GsLw3zrpD4eFCqc 434z8PrmArhgi5ZRzG8szs8OyN/GeRfvPWKZ/Rpm21OpUIBEJeHEZL3dFcboRw4O UA= Received: (qmail 74215 invoked by alias); 25 May 2018 08:09:37 -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 43422 invoked by uid 89); 25 May 2018 08:07:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 May 2018 08:06:59 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7kV-0003GI-7s for gcc-patches@gcc.gnu.org; Fri, 25 May 2018 04:06:58 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:10870) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fM7kU-0003Fg-UR for gcc-patches@gcc.gnu.org; Fri, 25 May 2018 04:06:55 -0400 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 w4P7xBwp003910; Fri, 25 May 2018 10:06:52 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2j59prjvxf-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:06:52 +0200 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 B6B3434; Fri, 25 May 2018 08:06:51 +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 A18282405; Fri, 25 May 2018 08:06:51 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:06:50 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 08/21] [ARM] FDPIC: Fix corner case of weak symbol Date: Fri, 25 May 2018 10:03:21 +0200 Message-ID: <20180525080354.13295-9-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 62.209.51.94 X-IsSubscribed: yes When checking the address of a weak symbol in an executable, it is mandatory to use the GOTFUNCDESC scheme so that the address==NULL semantic is valid if the symbol is not present in the final link. 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_local_funcdesc_p): New function. (legitimize_pic_address): Handle weak symbols 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 bbf8884..025485d 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3771,6 +3771,46 @@ 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_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; + + /* Local function declared as weak must use GOTFUNCDESC so their + FUNCDESC is NULL if they are not linked in. */ + if (DECL_WEAK(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. */ + vis = VISIBILITY_DEFAULT; + + ret = default_binds_local_p_1 (fn, flag_pic); + + DECL_VISIBILITY (fn) = vis; + + return ret; +} + static void arm_add_gc_roots (void) { @@ -7488,7 +7528,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_local_funcdesc_p (orig)))) && NEED_GOT_RELOC && arm_pic_data_is_text_relative) insn = arm_pic_static_addr (orig, reg); @@ -23072,7 +23114,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_local_funcdesc_p (x))))) { if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) fputs ("(GOTFUNCDESC)", asm_out_file); From patchwork Fri May 25 08:03:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136805 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3287346lji; Fri, 25 May 2018 01:29:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqOMuzQdFxgvVtf4S44BgwFcWgXP88W2EJLLE8MeRuuUp8LEU4fh7Hmn1heANij4Dj+wEA1 X-Received: by 2002:a17:902:680c:: with SMTP id h12-v6mr1629620plk.113.1527236968972; Fri, 25 May 2018 01:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527236968; cv=none; d=google.com; s=arc-20160816; b=fWhYc4Abp65bx1MtZaOrW/7PEy/eWf/XP0W+u41IzzjiYt+fOtJ0cSHZiz8vg1W8li Ih4l6GYAtzYGfIR90PdM1Fq/D40A+dLzi4IMDKGx6CuH1XWd/EF7TA/VZ8/X621w9oQU euo2lX7wiA5NdNib+yiW8UO+acUHngrz8DvCP4QViNEjBUw3gnwl4XPMEphcYzMiSA2+ Ea+XUVBLZ+wX2bCL88GL1zSNb3e18yit1ZTMYw0hE4Nng1bbp0MBCA8j6N3DJwvIOPsm J7mfqvqWvQYAGqJvD0oU4dp7nHao3z2ysxLVFv+UG3AHmYrFDNnJ9NEu+zNKeYZfbiDD vZ5A== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=tL/A3FT8gDscc6QuJLCaN28uJoetqQ6vF++Ae3qkXIE=; b=RXuPOMJejEFab+Bt4L/g7H3vMG7rXrtTEeeWO/ChKCVb5/rlgjZ8bbvJhzdGxBOzN4 eAGknDe5beQNm/YD3d1kPmgd6EpSyrlbbovuMCS+YH6rqe+hfLsDZZqs6IIL6JBwjNAS RBnicQcj03lbabbzl5cSQdLD5oqs0Fxw4/f+WMyTc2ntkTProtdTVIqzks7V5TInY6rO m7fDXTcfiymXU7VOoHUYQl3jpqk7FIptqKUef4vw91xLdcW686GjpOJ3k1J/ch+ymD+W UxEpE1Yvjyi93Fscz4gMVKpqzk9SM6Y4i2+wAclzQ+QLrO/kLjbTpNW9yyuXASmGxiyP IL0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=jJCCDIqL; spf=pass (google.com: domain of gcc-patches-return-478472-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478472-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 k189-v6si18482237pgc.414.2018.05.25.01.29.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:29:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478472-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=jJCCDIqL; spf=pass (google.com: domain of gcc-patches-return-478472-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478472-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=B7N K+aANb2t/IPsQ8ki7mhHCGfohPkFKaNLsyWwiTXLtRKc2rsryBPCdr6hax/yKmJB 3Mt86L7VA+0wKIhhIXlal5K8JISID4oWM7J2CZvtH33JXOZN7TgEitKthWdra/xU gcrh17HU8gv2+aqHY8LkFMLwrGpJXW7vFaRpmMQ0= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=skZ6pxPB2 mgj5LQgvIr+SxIdb80=; b=jJCCDIqL9jIMULYkTVAFy2eNDjizwmwQv68eZlBDh A/gCh67ETD8ZA6BYTPMPaZ23OMD2O09lYRqfAOpz7q5f+gEHlbEFNXPv1/+TK6r7 Wv67KSR6ytG1vSD7vVSlBUR4YcZc4q6/9k39Q57tl1akm4HW6clrYge2tXAnXsIu zs= Received: (qmail 74194 invoked by alias); 25 May 2018 08:09:36 -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 43644 invoked by uid 89); 25 May 2018 08:07:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 May 2018 08:07:21 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7kq-0003MY-By for gcc-patches@gcc.gnu.org; Fri, 25 May 2018 04:07:19 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:62178 helo=mx07-00178001.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fM7kq-0003MC-1P for gcc-patches@gcc.gnu.org; Fri, 25 May 2018 04:07:16 -0400 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 w4P7wZNA011595; Fri, 25 May 2018 10:07:14 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59qwu473-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:07:14 +0200 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 AEA463D; Fri, 25 May 2018 08:07:12 +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 02F06241C; Fri, 25 May 2018 08:07:11 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:07:11 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 09/21] [ARM] FDPIC: Add support for taking address of nested function Date: Fri, 25 May 2018 10:03:22 +0200 Message-ID: <20180525080354.13295-10-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 91.207.212.93 X-IsSubscribed: yes 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. Change-Id: I4b5127261a9aefa0f0318f110574ec07a856aeb1 -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 025485d..2434602 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3967,7 +3967,27 @@ 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 to jump into + the trampoline code just below. */ + if (TARGET_ARM) fprintf (f, "\t.arm\n"); + else if (TARGET_THUMB2) fprintf (f, "\t.thumb\n"); + else fprintf (f, "\t.code\t16\n"); + + 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); @@ -4008,12 +4028,37 @@ 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)); + rtx trampolineCodeStart + = plus_constant (Pmode, XEXP (m_tramp, 0), TARGET_THUMB2 ? 9 : 8); + + /* Write initial funcdesc which will jump into trampoline. */ + mem = adjust_address (m_tramp, SImode, 0); + emit_move_insn (mem, trampolineCodeStart); + 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"), @@ -4027,7 +4072,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 e8ef439..db17ef2 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1578,7 +1578,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 May 25 08:03:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136806 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3287474lji; Fri, 25 May 2018 01:29:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqHZ7Hm7URxKl0XBEhZPt5NCJqTd8IkfwP1iXTu8U711nZ1jBKukoLDU2BZJtr09OC5f2kD X-Received: by 2002:a17:902:5327:: with SMTP id b36-v6mr1649636pli.316.1527236980714; Fri, 25 May 2018 01:29:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527236980; cv=none; d=google.com; s=arc-20160816; b=GqIK3WEHzLWyo7W1hbKwv+hXZ1vtDJT+KCijtkTmuppDOeIYEUJA6bNCKh0MriivDu qnKxB1Lnur23JEEpbBCOWkArGt+UbI7z8oqkkaY71uCyIYZH7HnChE5ZPGkmp8CB+Zxy 0WV6mvc/8hnyszHFMTimQt77TIQn6dK0yYsktjQr5mXHdNMGEPgWEqX+N7mzOcU2xIp8 XkxFzSYYyNc8qBIQEszLLC/NuIX5KQn4TCr9RbHUif07GCOQ08zZXfGLHXmGqf4E1vm0 CFV1A3c9m/AO2MHkZiTOOYD32SVbIT+YWmhBgBH3we5UTYuXcaSwkRDjzZ9L4aSJhybx C81g== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=ZfO32jWbgoUV0Pr2sWC+tCW58DIr3RjlYY72QNPYq0U=; b=Nglx1COKnUTP4lfCIqTSQD4nfW8quvABkjbvzD9QzeCAZrBRjLFEyvmvr+OWhPLV2o 3sX1Pl9IZ32716+I+xFppf+dFoPWo5fnhfyfVvF+igAFLEsC9SRuCVgEICf1KvjFRSi0 cu6wTXJnUcCQ0uW2AFEaiD3pJpZPa+ZxuJAa1nue/oFr0OsAy/Ci+RbydOR6hw+2Mm/d 0RcL/j9r/fIL2VLXrbFqqYRPOgIhzGhDOvUbdhLZWfPZfEOoKvu9kgHNjQwERbGYivP0 1Fg4wqoS2F0Z0uQPRALUNyCquNHE13rxb+SNCL32skO1CX3ZqXhW9Fb3/fKYeOYVc4FZ D1yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=I1lDoviu; spf=pass (google.com: domain of gcc-patches-return-478471-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478471-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 f7-v6si18749566pgq.393.2018.05.25.01.29.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:29:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478471-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=I1lDoviu; spf=pass (google.com: domain of gcc-patches-return-478471-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478471-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=MBM G2z5gPs/3kQp+r/pl13vZIBoGSqDxOcaRInFJokH25FRTmWACcbNGPJ3w/xJV7ws UjqCtq/CPqMO/5yB5p7FLL4yRoLYUucMCF+8UKxduYs3GCbUyWaxYgr1pUOte+KG 6Vxln9go9Ilu9ikPnMwWIXMiiKqRlpkx/sXDmzrk= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=PbC5DylWd t2XYrD0XDmdg+cDsbY=; b=I1lDoviuvUYIRoeQe6NYs2EKDGXYO9gLtXdGPhrar CrAveHc4KQZPOivr7S9iGyTvBh0+ZUepXEAvx8vN67usHvW2BDUjqapXal8hv1E0 L1AJCNtHyKhQF+hJrJIC9a4mFB8A+uBO1oUKkRjiPRx1TxlMv72myH8EdnNZxhcC qc= Received: (qmail 45908 invoked by alias); 25 May 2018 08:08:35 -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 43857 invoked by uid 89); 25 May 2018 08:07:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=Hx-languages-length:4698, start_sequence X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 May 2018 08:07:38 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7l8-0003Si-8d for gcc-patches@gcc.gnu.org; Fri, 25 May 2018 04:07:37 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:38714) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fM7l7-0003SR-Uj for gcc-patches@gcc.gnu.org; Fri, 25 May 2018 04:07:34 -0400 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 w4P7xBxD003910; Fri, 25 May 2018 10:07:32 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2j59prjw2a-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:07:32 +0200 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 6093F31; Fri, 25 May 2018 08:07:32 +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 40559241C; Fri, 25 May 2018 08:07:32 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:07:31 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 10/21] [ARM] FDPIC: Implement legitimize_tls_address_fdpic Date: Fri, 25 May 2018 10:03:23 +0200 Message-ID: <20180525080354.13295-11-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 62.209.51.94 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_fdpic): New. (legitimize_tls_address_fdpic): New. (legitimize_tls_address_not_fdpic): New. (legitimize_tls_address): Add FDPIC support. (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 2434602..20b8f66 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 */ }; @@ -8681,6 +8684,30 @@ load_tls_operand (rtx x, rtx reg) } static rtx_insn * +arm_call_tls_get_addr_fdpic (rtx x, rtx reg, rtx *valuep, int reloc) +{ + rtx sum; + + gcc_assert (reloc != TLS_DESCSEQ); + start_sequence (); + + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (reloc)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + emit_insn (gen_addsi3 (reg, reg, gen_rtx_REG (Pmode, 9))); + + *valuep = emit_library_call_value (get_tls_get_addr (), NULL_RTX, + LCT_PURE, /* LCT_CONST? */ + Pmode, reg, Pmode); + + rtx_insn *insns = get_insns (); + end_sequence (); + + return insns; +} + +static rtx_insn * arm_call_tls_get_addr (rtx x, rtx reg, rtx *valuep, int reloc) { rtx label, labelno, sum; @@ -8736,8 +8763,84 @@ arm_tls_descseq_addr (rtx x, rtx reg) return reg; } -rtx -legitimize_tls_address (rtx x, rtx reg) +static rtx +legitimize_tls_address_fdpic (rtx x, rtx reg) +{ + rtx dest, ret, eqv, addend, sum, tp; + rtx_insn *insns; + unsigned int model = SYMBOL_REF_TLS_MODEL (x); + + switch (model) + { + case TLS_MODEL_GLOBAL_DYNAMIC: + if (TARGET_GNU2_TLS) + { + abort (); + } + else + { + /* Original scheme. */ + insns = arm_call_tls_get_addr_fdpic (x, reg, &ret, TLS_GD32_FDPIC); + dest = gen_reg_rtx (Pmode); + emit_libcall_block (insns, dest, ret, x); + } + return dest; + break; + + case TLS_MODEL_LOCAL_DYNAMIC: + if (TARGET_GNU2_TLS) + { + abort (); + } + else + { + insns = arm_call_tls_get_addr_fdpic (x, reg, &ret, TLS_LDM32_FDPIC); + /* Attach a unique REG_EQUIV, to allow the RTL optimizers to + share the LDM result with other LD model accesses. */ + eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const1_rtx), + UNSPEC_TLS); + dest = gen_reg_rtx (Pmode); + emit_libcall_block (insns, dest, ret, eqv); + + /* Load the addend. */ + addend = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (TLS_LDO32)), + UNSPEC_TLS); + addend = force_reg (SImode, gen_rtx_CONST (SImode, addend)); + dest = gen_rtx_PLUS (Pmode, dest, addend); + } + return dest; + break; + + case TLS_MODEL_INITIAL_EXEC: + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (TLS_IE32_FDPIC)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + /* FIXME: optimize below? */ + emit_insn (gen_addsi3 (reg, reg, gen_rtx_REG (Pmode, 9))); + emit_insn (gen_movsi (reg, gen_rtx_MEM (Pmode, reg))); + tp = arm_load_tp (NULL_RTX); + + return gen_rtx_PLUS (Pmode, tp, reg); + break; + + case TLS_MODEL_LOCAL_EXEC: + tp = arm_load_tp (NULL_RTX); + reg = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (TLS_LE32)), + UNSPEC_TLS); + reg = force_reg (SImode, gen_rtx_CONST (SImode, reg)); + + return gen_rtx_PLUS (Pmode, tp, reg); + + default: + abort (); + } +} + +static rtx +legitimize_tls_address_not_fdpic (rtx x, rtx reg) { rtx dest, tp, label, labelno, sum, ret, eqv, addend; rtx_insn *insns; @@ -8831,6 +8934,15 @@ legitimize_tls_address (rtx x, rtx reg) } } +rtx +legitimize_tls_address (rtx x, rtx reg) +{ + if (TARGET_FDPIC) + return legitimize_tls_address_fdpic (x, reg); + else + return legitimize_tls_address_not_fdpic (x, reg); +} + /* Try machine-dependent ways of modifying an illegitimate address to be legitimate. If we find one, return the new, valid address. */ rtx @@ -28022,15 +28134,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 May 25 08:03:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136797 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3285883lji; Fri, 25 May 2018 01:27:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrEqPe+aB812SN2pk4CII5dhgFws9W+XzsIO2Bs3Svju22ey0tPoGEhATIR5fSoDtMEzF3+ X-Received: by 2002:a62:f80c:: with SMTP id d12-v6mr1560019pfh.159.1527236854195; Fri, 25 May 2018 01:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527236854; cv=none; d=google.com; s=arc-20160816; b=qTuvnGPcrQQuLyOhnqTTRUTMMDdRUW15ZB+7YXEIGk8s2qpxck1VKf5uvD4mjBZxam KTKDofQjrAfk5xz42HMbcQkh23ARZ00dOCpWe3kGjnPuTjtzT9aNsQ6so9vd7GnHd60K rMEagOI8FiWnvxpGOqddVlGknDcAGBvBURSGKO2UkP7ZBjy+8x0AWt3s9FWeoq0p45H9 TlDMWp60K0hvJN6jVAQBnGmesoftp/GwI9xzTe+x6GFGifo/jNGusmK+p4NciyjN8mpl 6Eziiaqzd1coF6XBVfgjhetyRLNCfDWNVQk4vkI8RAFy8yFDwcOsLPgXjUUtJIqLT/xE kyug== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=QIa5niC5Bng+z1rXLwrgnud0I6MLeqEpwK2SrYWqBm4=; b=SIUYonyadv3KYCZhFLTSSpI6LFJD2uDVRndKqpugeME40GB45plqDEAgCFgCyNnPm1 1t4vDReT4OaeuKuktLic2jX7nkuv9keHGzgAieKzdadw1aDpQcht8KwowHrO48h0qUBp Pj+W/WOBzccQtqYAecSV46siCZNk1HLwQRq7OMqOA45nIdFfVK0S0DrvGOmol0kjA1S8 oyD63cj+NZX4F5FXnppn+5ZCZigNkf9FZhiXAfMRDIUkfjicP28l0vSPaeLlPi6sOCFb kToxNozBoyTyrll5uB56L6dlIHR1MDLllXrcqOGd+MV5oLN5SeVN11iqULO+wxs4obJp bczA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=GC84wdWD; spf=pass (google.com: domain of gcc-patches-return-478465-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478465-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 p91-v6si23303567plb.457.2018.05.25.01.27.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:27:34 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478465-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=GC84wdWD; spf=pass (google.com: domain of gcc-patches-return-478465-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478465-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=amm p4QeaMchQAd1N7vBHMuLG5qeY2VFsYX2dwzeF5OuWRsBXf7y9jcwQa5gZzI7RtS0 Y5lTFvXaTI/kdgipKBrP7OW8u3vlEIp0w0VO/CZQBfStifwrIeYMIn8kz02qYbHJ gpj6c9mSJ2v3jJViKF8OuYYi/Gnc6OgbM6CZwPIU= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=NdDuTuj6b VqGfUyfARbE+1iM8wc=; b=GC84wdWD1uQBZB/Kwx/NxK57SiHOHqRBi/vZrnePB pSkuJ8qqwJgBFH89a8wOpNwllQs1eXGVmeCJKUMmmAdGPUGSaGtiQ9ob9At1kA0U 1+xO+tW/6neF68tDCJJWaMGRkfMmH5eBQ0Qgh2SRFbQb9FbnlxjTu+3FWru4ZXiw i4= Received: (qmail 44556 invoked by alias); 25 May 2018 08:08:24 -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 44130 invoked by uid 89); 25 May 2018 08:08:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=sk:search_ X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 May 2018 08:07:59 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7lS-0003Zc-Uc for gcc-patches@gcc.gnu.org; Fri, 25 May 2018 04:07:58 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:53660) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fM7lS-0003ZH-Kq for gcc-patches@gcc.gnu.org; Fri, 25 May 2018 04:07:54 -0400 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 w4P7xBxL003910; Fri, 25 May 2018 10:07:53 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2j59prjw3y-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:07:53 +0200 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 9EE643A; Fri, 25 May 2018 08:07:52 +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 8702B241D; Fri, 25 May 2018 08:07:52 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:07:51 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 11/21] [ARM] FDPIC: Add support to unwind FDPIC signal frame Date: Fri, 25 May 2018 10:03:24 +0200 Message-ID: <20180525080354.13295-12-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 62.209.51.94 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): 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 f5415c1..80d1e88 100644 --- a/libgcc/unwind-arm-common.inc +++ b/libgcc/unwind-arm-common.inc @@ -30,6 +30,21 @@ #include #endif +#if __FDPIC__ +/* Load r7 with rt_sigreturn value. */ +#define ARM_SET_R7_RT_SIGRETURN 0xe3a070ad +#define THUMB2_SET_R7_RT_SIGRETURN 0x07adf04f +/* FDPIC jump to restorer sequence. */ +#define FDPIC_LDR_R12_WITH_FUNCDESC 0xe59fc004 +#define FDPIC_LDR_R9_WITH_GOT 0xe59c9004 +#define FDPIC_LDR_PC_WITH_RESTORER 0xe59cf000 +#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); @@ -195,6 +210,46 @@ search_EIT_table (const __EIT_entry * table, int nrec, _uw return_address) } } +#if __FDPIC__ +/* FIXME: partial support (VFP not restored) but should be 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 + 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. */ @@ -218,6 +273,24 @@ 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) & ~3); + if (pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_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; } @@ -232,6 +305,24 @@ 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) & ~3); + if (pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_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; } @@ -240,6 +331,24 @@ 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) & ~3); + if (pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_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 May 25 08:03:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136796 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3285681lji; Fri, 25 May 2018 01:27:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqVt4BlsgolybFDLYFwkuegTKoBgo77l1PSgzy5hsR/BoalHXF2HQczgrGbHxS69qSeuzSf X-Received: by 2002:a17:902:7c0e:: with SMTP id x14-v6mr1620021pll.389.1527236840524; Fri, 25 May 2018 01:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527236840; cv=none; d=google.com; s=arc-20160816; b=FgNLb7ctO+jd1gi1xFowqLTb9aK3wR+nrkSSOmoP4Y2dpye+lgvFv3Vg2zBKuO8eka DtTKs8n7FZY3MXkDHo52RhYAM+mESpardCNYdTM4DB/KsObskdy8gJ34WNc2jC2w1S93 ugZaqoLS+l/dL29xVk+efTyB7QirXnv1j9UL86NLjRJ0AwbvkjTHubW7EjlCtQxxjH06 vBo3S0/gjcy//1MQPINUjmtXf8OTCqu42Ll+d0c5YIV7POQYAXAa5nLUGmMZMGlkqdUx Dc3xeJNRaHyO457fouvEqIu3V9YplTluYu2RPltoZunmooZ0LrCk8ioxzGl+cKL7xMn7 rq+g== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=aMd8ALQ/yDjO0ErXbRmoEHCtlOb1P1kCPpNNwhnnzmc=; b=ApSCPlZzybTm4e1kbyxWsCFwlX+KHg0jXQyfQOAaAQZ5cXYKVg+ma1zoHjGRkU8u4z 3uo9kFTd7KxNB4jRTwSDlv3IhhM8iVrX7FKNtQ1eWlo1ZqXMIZkw9uFdY1s1+3MU5cSW /cXndUlOM8GoZHQV3WaFyuhqE0o4DR0OvEJRt0GmXpruw81jjeykCmYHC9k8im3a38GJ pOoc4T9GZ24ejTw9L8y/qHMVQrMuaa7teyBrZZBBhx7Voz1iUA10B5ua/5h1ODdVm4Zp Y6iaEg0+U9uVsWfCF3ks8tdgio2DZhxglJ11gxGUc7EDIE6egMj1cKvXrFATTlIma6ig jgLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=btjCdgJ6; spf=pass (google.com: domain of gcc-patches-return-478464-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478464-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 z3-v6si22002596pln.292.2018.05.25.01.27.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:27:20 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478464-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=btjCdgJ6; spf=pass (google.com: domain of gcc-patches-return-478464-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478464-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=sMo /SCvp2qwA5nqRCixX6r8muyuciVl+ghWGxxgz8L19woprckC96SXYuacODyowIua F1NbCvSfxHbxF6WaTTZ/ssEH5mBEJs7ZCgWMAUL5ioq/e8fG4ywPjtjQW+JaP/Kr W8e25GT2nYhl3H1gh36/yuewynrISD55G02P7iOk= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=gxIX3aSq9 3IRVZINpgkRWtud8/A=; b=btjCdgJ6TGTEgCquA2k6jkSU+dJHupS3Hmu01G0FD /dhpT/0BHE60ZXdNoKs/Vsu8FFUSlG6vPsG6gr46PlhyCgFYqoHulb5QuZM9UEF/ 7L6JfeGh/kxlj/wMevvWSSmhmeu9wHSUr00Ceavj8kMCgcuxAE+Z6IGvDpGPYpsU 7o= Received: (qmail 44536 invoked by alias); 25 May 2018 08:08:24 -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 44377 invoked by uid 89); 25 May 2018 08:08:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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=LR_REGNUM, lr_regnum 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, 25 May 2018 08:08:17 +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 w4P7xHBj010097; Fri, 25 May 2018 10:08:14 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59j8k6ge-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:08:14 +0200 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 23F2658; Fri, 25 May 2018 08:08: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 CB75723E3; Fri, 25 May 2018 08:08:12 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:08:12 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 12/21] [ARM] FDPIC: Restore r9 after we call __aeabi_read_tp Date: Fri, 25 May 2018 10:03:25 +0200 Message-ID: <20180525080354.13295-13-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=0 X-IsSubscribed: yes 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. Change-Id: I0a2e3466c9afb869ad8e844083ad178de014658e -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 20b8f66..80fe96f 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -8660,7 +8660,27 @@ 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)); + + emit_insn (gen_load_tp_soft_fdpic ()); + + /* Restore r9. */ + XVECEXP (par, 0, 0) + = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (2, gen_rtx_REG (Pmode, 9), + get_hard_reg_initial_val (Pmode, 9)), + UNSPEC_PIC_RESTORE); + XVECEXP (par, 0, 1) = gen_rtx_USE (VOIDmode, gen_rtx_REG (Pmode, 9)); + XVECEXP (par, 0, 2) + = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 9)); + 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 78c236c..0bd0a6b 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -11482,12 +11482,24 @@ ) ;; 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")] +) + +;; 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 May 25 08:03:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136811 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3299094lji; Fri, 25 May 2018 01:43:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrg9Mt3jto79zaK6SFgMoGyC8ZKxXycjE0UTpVSW/ELYoM+YX5sTXE7Hnl+T+dI0K2vFHxP X-Received: by 2002:a17:902:8a82:: with SMTP id p2-v6mr1676267plo.244.1527237817822; Fri, 25 May 2018 01:43:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237817; cv=none; d=google.com; s=arc-20160816; b=Uy1vTqh55SIHxYbSICmEPVh4wiuGEQGmMgKhbPF6fL0XIEeKEOrhXv/AfLssVSBhEU 10SsKrZVXScUqyqsR04UhZ6quZIbLSNF4aIajt9BjmAHQnbn4HaGWFglgsnIWuWfPkZC AhFtN7rf0SK3YKJsW+vEHmV/4RsUD6CONf0JeNGKGkzHLOz602sUqRxqWeU9h2ZLQZCz 6bft7ssL5pq7hHew0FVj2kUWjp3x0GAHm7d+U/0Ux6uVn0wH5esYLKArFXhGzYnj61/H 4vhdd91ja1t17n1/lu2PlGfIQhCGwSsGsrmJG8GVUEHSUGw6Gdc8R54VjwGx6AzAlL/l Jmug== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=//HYn1APB4f/roQZAkaRhZOGeGI92X2Nn0I9HE3JlY4=; b=sWcsXMH04KgaMEZEp1fgEidOW2bwqbsbbcpz3eqHTku6q+xwzw//Y9pfr+qQFpKY9M T4ntOh7qQD9MXKglRUMHD8BGcZldgqmKK1gM6sXi93bIykb7gziXVZR5uq7FrcEKaM0D zrJq8Nw/c9s50Ha1Au607OY2SC4p+qPULlcDKlP31t6UDXMMrMGwUOz/M2gg/PM51/zU ykfUmppPkMfX/uiu28Bu7Og1NBXohZ6bknM1GjIiQWIOBbbzrd/UzTdzoSX6TZBpCN3e pP/GBIaMTqJyRVXpLIyPjky6NB1GVYbY/Yqv1puZl/K/S+pcBUvbYC0D/5OfJTWYXmn8 DI3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=d2vj2mEA; spf=pass (google.com: domain of gcc-patches-return-478478-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478478-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 m11-v6si22820592pls.497.2018.05.25.01.43.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:43:37 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478478-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=d2vj2mEA; spf=pass (google.com: domain of gcc-patches-return-478478-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478478-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=qG4 T1Lvaa4kNNRN12ei5xluGX4ObIaimVLar3K38e9puMDEgg626E4dIqC7+iX0HK8x EcUCYdaxUpTDCf9+0zrQ9UdN7em8HUioAkupAOKO0+24iuQv02CyPZUszYuR0fre wLsVmg5UxaXg/pn2pmI7atz+vY/9Jqu/PW2F2qWU= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=lNhOJW2jY wdnUAOhtSZsawR41Yw=; b=d2vj2mEAwcLTkg78kyfCPgDgN7h2EXZaMhNxeQUg5 3whd1k5lXeC41Ybtrmanes1Swvv7sjd1llM8qgZUpJEUibT+QxWfnxc4wnY7DfX7 bmk01QAQsvupUkkIKmOstKqgHAuzLfP6oExiAqs4gJshhveJrK7L4uANwkw+uLy2 qQ= Received: (qmail 122632 invoked by alias); 25 May 2018 08:22:46 -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 54621 invoked by uid 89); 25 May 2018 08:08:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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, 25 May 2018 08:08:38 +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 w4P7xHBs010097; Fri, 25 May 2018 10:08:36 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59j8k6j9-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:08:36 +0200 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 6F5623D; Fri, 25 May 2018 08:08: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 1BE4B1404; Fri, 25 May 2018 08:08:33 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:08:32 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 13/21] [ARM] FDPIC: Support unwinding across thumb2 signal trampoline Date: Fri, 25 May 2018 10:03:26 +0200 Message-ID: <20180525080354.13295-14-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=0 X-IsSubscribed: yes 2018-XX-XX Christophe Lyon Mickaël Guêné libgcc/ * unwind-arm-common.inc (FDPIC_T2_LDR_R12_WITH_FUNCDESC) (FDPIC_T2_LDR_R9_WITH_GOT, FDPIC_T2_LDR_PC_WITH_RESTORER): New. (__gnu_personality_sigframe_fdpic): Support Thumb address. (get_eit_entry): Support Thumb code. Change-Id: I2bb8994e733e48a89c6f4e0682921186c086f8bc -- 2.6.3 diff --git a/libgcc/unwind-arm-common.inc b/libgcc/unwind-arm-common.inc index 80d1e88..7de4033 100644 --- a/libgcc/unwind-arm-common.inc +++ b/libgcc/unwind-arm-common.inc @@ -38,6 +38,9 @@ #define FDPIC_LDR_R12_WITH_FUNCDESC 0xe59fc004 #define FDPIC_LDR_R9_WITH_GOT 0xe59c9004 #define FDPIC_LDR_PC_WITH_RESTORER 0xe59cf000 +#define FDPIC_T2_LDR_R12_WITH_FUNCDESC 0xc008f8df +#define FDPIC_T2_LDR_R9_WITH_GOT 0x9004f8dc +#define FDPIC_T2_LDR_PC_WITH_RESTORER 0xf000f8dc #define FDPIC_FUNCDESC_OFFSET 12 /* Signal frame offsets. */ #define ARM_NEW_RT_SIGFRAME_UCONTEXT 0x80 @@ -228,7 +231,7 @@ __gnu_personality_sigframe_fdpic (_Unwind_State state, _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 + FDPIC_FUNCDESC_OFFSET); + funcdesc = *(unsigned int *)((pc & ~1) + FDPIC_FUNCDESC_OFFSET); handler = *(unsigned int *)(funcdesc); first_handler_instruction = *(unsigned int *)(handler & ~1); @@ -277,10 +280,13 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) /* 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) & ~3); - if (pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC - && pc[1] == FDPIC_LDR_R9_WITH_GOT - && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + _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; @@ -309,13 +315,16 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) /* 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) & ~3); - if (pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC - && pc[1] == FDPIC_LDR_R9_WITH_GOT - && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + _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; + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; UCB_PR_ADDR (ucbp) = funcdesc->ptr; UCB_PR_GOT (ucbp) = funcdesc->got; @@ -335,13 +344,16 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) /* 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) & ~3); - if (pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC - && pc[1] == FDPIC_LDR_R9_WITH_GOT - && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + _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; + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; UCB_PR_ADDR (ucbp) = funcdesc->ptr; UCB_PR_GOT (ucbp) = funcdesc->got; From patchwork Fri May 25 08:03:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136812 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3299210lji; Fri, 25 May 2018 01:43:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqNF9vEO1TeKzQA27Nxhnd6aZGr+V3NT1MPYI1taAH+fImBTsJxs4XQp8s0+w/saYrENpCC X-Received: by 2002:a62:1411:: with SMTP id 17-v6mr1455360pfu.3.1527237829360; Fri, 25 May 2018 01:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237829; cv=none; d=google.com; s=arc-20160816; b=OM69RR2ONJuu/v4G80oRcsnPd5Fur5rkOEzyOeqt3tHk0pppo0Tax/1r9GA34Bl1Va C8HCIc1E8y6k13QGlweDzp4g5tzmNuFBkvlrbej8N/DM9SUhS1tIHBFC8Lz0K1OvJQLW q1mFmC9rK8txzTAKrACq7BHkWaaiM22SI2WWhZPdxq2b6V8hAksdEr8C0PtMlh3HKhn0 DgqgkmOqnrZ/tUZ7QGy0pmc2ahmqwIobFZP0Fdz/BOnGJtzgQNomOlHCU2oBjk0ZVIdG RDLPXfRA85ZbAXSqsKwApQAhXtrv3H3+gvUufdaRJmDZBOnSiAMb+Ek1GXyBB9kx9ydk jlKQ== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=cHl2PUgm9VZrqHbeIwCfV/Fb2uBseeIxyXbkvN/1eMM=; b=CCh76FYtPXm2/CcKTL2++hUgCS+8x5YYF5toJRKtjSVe6waNz5alOX2cakVsl9mRTm 03U8XWDxOCLMZDRpHF9jMrfzj6fu63b+1XS/GzUruxNdr0pDua49Mdgh1HdpL2Vb2bUP sx+LySfYwglfdi7VGX2pXCOf3R9TAqpAxRTbWcRvFtT1gY1anRSNUdZLtTEbb8dyliqb RzSBm3EPYzTRDIz9irXSe6tDuhDN43NaN0OQCSaBQdZrFXH9NOc9UeA92sOBDNEpLbhf uoZ+es8Kz6IMSThcAashRlCCz/4MmF+y2JlCXr6aMd91qC4kyGSN5ADNNTvQql8Ch0pF 5b9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=AV/zbKeN; spf=pass (google.com: domain of gcc-patches-return-478479-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478479-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 z3-v6si22883346plb.228.2018.05.25.01.43.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:43:49 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478479-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=AV/zbKeN; spf=pass (google.com: domain of gcc-patches-return-478479-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478479-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=tq7 YAFLubOVzOWhiRgygTjg7hiasuni8DCUIRqEO7+jb9kpglpt17IEMTNEs/CfTux/ ICb65qTQk6Nmh9dLEJHPh/u18NBs1a4InWga4gHiNnB2p2JCeeiVqcUoA3+88zsK 3az0yoJEoOqdWNaqrSJyxJCYSh3NOEVE5Lr4q6iY= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=ZJbCtrZZw ervOlkyJTUg8ylnKDw=; b=AV/zbKeNBc6aMbJTGcDzES8upGqplvdjAu7MT4dZ3 zdSjHKjoIVH9j23dOgTBUkIPK00bTuTVMS+4zNpVQ71Mpve2n2E6tIR007uaMWjW wurjrGFF1g6fNtnTiSYiUUCcHivPYu22IiX6QHWIfXP9laB+BB1azcUUv7j2AKnt XI= Received: (qmail 124489 invoked by alias); 25 May 2018 08:25:27 -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 73745 invoked by uid 89); 25 May 2018 08:08:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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, 25 May 2018 08:08: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 w4P7xObS010120; Fri, 25 May 2018 10:08:55 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59j8k6kr-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:08:55 +0200 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 7D3A731; Fri, 25 May 2018 08:08: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 62B4C2424; Fri, 25 May 2018 08:08:53 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:08:52 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 14/21] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture Date: Fri, 25 May 2018 10:03:27 +0200 Message-ID: <20180525080354.13295-15-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=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 May 25 08:03:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136809 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3298800lji; Fri, 25 May 2018 01:43:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoyP1NQt4JGoH+H7DfIqwPX2+Wwg88N9RYqIFPdhq/ehiy7sqTta4m63MbHdQ/71lxJlWo5 X-Received: by 2002:a62:e04c:: with SMTP id f73-v6mr1650791pfh.88.1527237794998; Fri, 25 May 2018 01:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237794; cv=none; d=google.com; s=arc-20160816; b=kP0PLnDQi+q5S1rPTRPPWxk+UMx4HucA1T67HcS+N5Us5fpvCMC3E5sgD10yh/kwnB OG8DlqGEHCcMb3uVprCBbalax89fwp422QW58vzAgyK4Q9n72ANFB+sDMCzYz8dd15Kh aGmwxRFneEaJiKopY2YlYvDnaNWcxmATHHDr9MqhrAe3WO7qUu/ktu6jeVKYN451Nj/Q eGwpXLMMTuUMqsVYiutpalR7AoT2d3ojEHUSiYKUY/wZW8BJRw99GpDqovy2qWtoNSuG b8ZSCsttSBNe/cvi1Q7aFjB37MK3hNvqe620gwEJxr0yMK640ha/vs50F4T3HG2EqJ5v rCDg== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=zWpUmf5RmPVzGYNbpkeExDhIc7emw9RoOduPo8FFgY0=; b=Fw/PWiWvS67JuoZSsaf02na3LQI43xNx7yAGBste33sPJkVpJrLbHgz60LI+QMlOgN aJWuE+XZSP+nsTxQACJWPI7Xr59JaR1O0cA+mQdIsRFBYmVBtP96E0PBznXCfJ+WGmX5 i4AdF1V9FOJvtt4p/TWM4yStklGtNh9+hKdXMBn49zEE4rykT+6TxxCldvNY9/HbxoQW teLI1A28RIHB1Ft4yPIW7lVD91Zmbyf3kFHxnRxyNEE0RL+h0X8EcAKVRXEu2wcjdfou ENyErP/ltVRhW/w1dgIINt0rndRxbDksu9751zPJa/IXucrx5zBA88Dw38iyR7WfrWp1 IqzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=toG2hOgx; spf=pass (google.com: domain of gcc-patches-return-478476-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478476-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 30-v6si23438755plb.531.2018.05.25.01.43.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:43:14 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478476-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=toG2hOgx; spf=pass (google.com: domain of gcc-patches-return-478476-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478476-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=ekl 9mHePGl6UgSATj6VdTw5CqDonNj1Au+kihq1cHFBN7Q0wPcSFCQ3gKxFmZyzyI33 A7RUR7Ad5rWokBup5KSSchB5QLlx0gKTzgEHlBgMKn0HvwLibZRfVOD2BUWU0C9E 2ZMfP+ydL3uUfiGkUtntBfGuB2rNa+Tjx40MuYiU= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=PlzqAcqk1 VXtXfzvWrlG2+fRWto=; b=toG2hOgxUQ6weLmpUuk4hCg4p7QqGZ0LgaFpcTtlY p9P1v5f+HQTbYodAmBDbdZxzlf3XwepSg1gWKSxpkYnwGv9NWdkXcJHE0lpPcBsL MI9a6BUiw5vnRa3obe9Eqov8O0c5IXWD2rldRrySuPDbyuia6TZJSzcnAGKGu/Z9 7E= Received: (qmail 110583 invoked by alias); 25 May 2018 08:18: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 74123 invoked by uid 89); 25 May 2018 08:09:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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, 25 May 2018 08:09:27 +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 w4P89Pr0017153; Fri, 25 May 2018 10:09:25 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59j8k6nk-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:09:25 +0200 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 14D9131; Fri, 25 May 2018 08:09: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 B6C812427; Fri, 25 May 2018 08:09:13 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:09:12 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 15/21] [ARM][testsuite] FDPIC: Skip unsupported tests Date: Fri, 25 May 2018 10:03:28 +0200 Message-ID: <20180525080354.13295-16-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=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 f5929e0..a7758b8 100644 --- a/gcc/testsuite/gcc.dg/20020312-2.c +++ b/gcc/testsuite/gcc.dg/20020312-2.c @@ -8,6 +8,7 @@ /* { dg-do run } */ /* { dg-options "-O -fno-pic" } */ /* { 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: 136810 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3298932lji; Fri, 25 May 2018 01:43:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqUhpvLXKX1GWlRCgbZI+DreBR+rhmsqg3Sw+MhOIX01dW6n+VgdTPVqvhS47FfJl04kmAq X-Received: by 2002:a17:902:264:: with SMTP id 91-v6mr1628698plc.341.1527237805572; Fri, 25 May 2018 01:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237805; cv=none; d=google.com; s=arc-20160816; b=Puzd4pU/Ufq5M+LJmOJnaBxerSXMaTFgOlTydC8eBg0rBFUfB0Gmx4zF5IhcZ04rOZ TUv4CSUS3AzQZ0ui52t3D8UNYcfHNivI1GzYJ/elu2YmsdduPTsDYEgaR1bNHF5JOcHp 2i6jXY2oLlUSWUuUbSJ/xIs82Ml1suTxpVS4Hl73sjJ/LgTz50Z7VUlCTlvETYuG/kZ6 JvBh6RNZHOKvGcDqSsaISU3eoxx2A1sRxhG7gNHQEDzl0WYAjquAnoQ95gTJdM1dVqT0 ChY7hOI0ELZMCIq5Vbs7bbvoYujnk2EYBHK3BQuMZ1Z9cjR8qO7kX8zLWi/RfOszCTf/ oLbA== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=8iMdJnjf58b7q/d7VfZcKHwkniOm7sXcAAwu76X80fI=; b=S8cPCJytM9DzcCMnprcxsRMkai5ACDvv4npoyb7E065TRBDEHumHBIbSH4C0o7QCQ7 KDb5DDXzQfOyttVBHgVqAcSZ28Zke9mR/f8K591wHv+w8e07AMIkyk8dOw+qoNH6spnO W4D8Iq4W9jGYOdJMQJqUbIQh39r6+KVdpdJ9PyRid8ZuHk7PAs1771Kp9E8AxXpHmsMC 28S/yqRjo6itnbHPtXh3ZBAHebV6X3Rl1U1bIBkAqwMYO0lhsx0hVUmyu68c0R3HEFpC Xj35/WJZ8kwwZJUKS4RPC3SOskyCdBYO8qfB2ZQJB59pqrLEk0KAbjzEEELKSzSv0+fN Zqow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=HqyMmZ+A; spf=pass (google.com: domain of gcc-patches-return-478477-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478477-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 x2-v6si22374124plv.388.2018.05.25.01.43.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:43:25 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478477-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=HqyMmZ+A; spf=pass (google.com: domain of gcc-patches-return-478477-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478477-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=nfK 9lVPldWrbWYiL81mZ3WuQSgtNpFLQ5aKtqBM3h4hrNxUBefZUrru1uUy2hNWjkU2 VKiNPiw2v72kCcnrdSMTvSt6rYWm/zslCypqDp1M7iMwv83ay88mV4riPspiIFch aS1ad+XinLNQOFUYqjfu+G0+XYpFW5tfQZoRI6+U= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=mTYV4cWIv +IaHxyExOaE3FCucsE=; b=HqyMmZ+AVwnQJEb9Lspaf+oeIEcDTXMpbksa7EXBc b6dZdyzL+y79dNwCggUt8R5CI9C7ak8AY+6ZBaoLnIKkrN1ELw8EBt7ajuUVuptg yLESj+URBa37oklLsj5P9BYo2l0FabYQZjgQn6Joz17SjGeBUg9m5wuaVgjqYNXR 5k= Received: (qmail 121966 invoked by alias); 25 May 2018 08:21:30 -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 74230 invoked by uid 89); 25 May 2018 08:09:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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, 25 May 2018 08:09:36 +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 w4P88ZDF010559; Fri, 25 May 2018 10:09:34 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2j59prjwbw-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:09:34 +0200 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 2CDE434; Fri, 25 May 2018 08:09: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 F28562428; Fri, 25 May 2018 08:09:33 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:09:33 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 16/21] [ARM][testsuite] FDPIC: Adjust scan-assembler patterns. Date: Fri, 25 May 2018 10:03:29 +0200 Message-ID: <20180525080354.13295-17-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=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 May 25 08:03:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136813 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3299369lji; Fri, 25 May 2018 01:44:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoZOM9Zmtf/aoWfts2630u++UB1dMa7SfLMY/6PlWlJSjyYLKPLK5P69bsRMqnm+NzXIQIe X-Received: by 2002:a17:902:8d8c:: with SMTP id v12-v6mr1651974plo.366.1527237841509; Fri, 25 May 2018 01:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237841; cv=none; d=google.com; s=arc-20160816; b=AdhQ5I4eNKCWPg+Y9W6ENY5fWPIIQzcGU4C266s1Hr+P86a0EDpx6TBy/7v/eApzv5 zFKyIL95zg6yTiWJ57UXQTfgH+J4VOsuQ4Z0GRRFylasaNHS7rPYpnJVIs2yvwE7eezH ET40tKzq5JxblN9QSpPOjnnNQCKyy7JTxjUc+NrcyBddqkICjUkq4f16f5rZ/MTWGgOD Ks5vnBnQ+lufKnTLqsYkXK3xYFcLPzckM6HREAm9moUoenA8i2y1Xxvx2t1X1bYNM95Z HdS1T+i6Po7pAqp1OoWb0K789ptay4WZ88fPfwdz3TjNE8kGiKO9a/2vkPTQumhx63uW HG8w== 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:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=VhUbLeKzP0oPz62jh6ISVgj4aIqtnzgbrxbru2U1P7Y=; b=kqGNLPe3kFSD+CJe00ufhPgynZGCBLlKjsQR4SaQYv+C/dcvRSA8P7BcF1AOCQo5MH v1HnekFYLCY/hIHfUNqvWHsVugO3IvAlXIkaXkDsIfNXeie5VTCyA8vzdOYQCIFa6kJ3 RaTflWvx8foC4iOfvpm1TR2/c3zL7EhrqSP6NEizY430/B7pbb9qITaYLBLKbfxysn8J 6HI3cAbB9A71jN4fZLMmDug22YQntAGx3fRKm/SZlQyrGEA28Uz9C2M+SGSCeFMUcYPJ YkCFkcd9a713DO8+xnIrnq9O5IX6wCGKke4yRDDPSHQ5CV3RQx6On4EQCxDwU24wWpQR wh7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=BRlsO5rw; spf=pass (google.com: domain of gcc-patches-return-478481-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478481-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 l3-v6si22681473pfi.179.2018.05.25.01.44.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:44:01 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478481-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=BRlsO5rw; spf=pass (google.com: domain of gcc-patches-return-478481-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478481-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=eLU chLelV24OfVBxdKhUyJ6CGgq6jtVOqCAC3pCLZdji01sFC3+O9+c55DQI5Q41jYt JZK8OM5AdDeWUhopqRZBHFWQ9ymdZ3gU67dQqs1IJ2A1VNxkR1aKtc0y5oSiFt+R 7+8U6G6NLCTfMpaAyVjJPnUbePcnLVgVRVMJI5Ss= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=E14a3nMlN jmDhFLofw9Tp4P3ezY=; b=BRlsO5rwdkAFIY6FUB7w9h4kiWTPlpKuaArqxGmwf oHrflVGPqwTi6sdMQ1P9ejqI+MhWX8X2+kQHrabq4LZ6IL2azUc+TeoVOoexHMq9 K4KAVlzL1PbsmuFaLS9C/wb3vU68fjW1GvcigZH9EQWOZhLe3kyTBG0Jnu7uh8HP fg= Received: (qmail 125337 invoked by alias); 25 May 2018 08:26:27 -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 74742 invoked by uid 89); 25 May 2018 08:09:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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, 25 May 2018 08:09: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 w4P89P19017154; Fri, 25 May 2018 10:09:55 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59j8k6rx-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:09:54 +0200 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 62B8234; Fri, 25 May 2018 08:09: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 427AD2431; Fri, 25 May 2018 08:09:54 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:09:53 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 17/21] [ARM][testsuite] FDPIC: Skip v8-m and v6-m tests that currently produce an ICE Date: Fri, 25 May 2018 10:03:30 +0200 Message-ID: <20180525080354.13295-18-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=0 X-IsSubscribed: yes v6-M and v8-M are not supported currently in FDPIC mode, it's better to skip the tests. 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/testsuite/ * gcc.target/arm/atomic-comp-swap-release-acquire-3.c: Skip on arm*-*-uclinuxfdpiceabi. * gcc.target/arm/atomic-op-acq_rel-3.c: Likewise. * gcc.target/arm/atomic-op-acquire-3.c: Likewise. * gcc.target/arm/atomic-op-char-3.c: Likewise. * gcc.target/arm/atomic-op-consume-3.c: Likewise. * gcc.target/arm/atomic-op-int-3.c: Likewise. * gcc.target/arm/atomic-op-relaxed-3.c: Likewise. * gcc.target/arm/atomic-op-release-3.c: Likewise. * gcc.target/arm/atomic-op-seq_cst-3.c: Likewise. * gcc.target/arm/atomic-op-short-3.c: Likewise. * gcc.target/arm/pr65647.c: Likewise. Change-Id: I2357be4c92b5a1a8430ae6617c7bba7bec0ea213 -- 2.6.3 diff --git a/gcc/testsuite/gcc.target/arm/atomic-comp-swap-release-acquire-3.c b/gcc/testsuite/gcc.target/arm/atomic-comp-swap-release-acquire-3.c index 0191f7a..81b5c3d 100644 --- a/gcc/testsuite/gcc.target/arm/atomic-comp-swap-release-acquire-3.c +++ b/gcc/testsuite/gcc.target/arm/atomic-comp-swap-release-acquire-3.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "FDPIC does not support v8m yet" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-require-effective-target arm_arch_v8m_base_ok } */ /* { dg-options "-O2 -fno-ipa-icf" } */ /* { dg-add-options arm_arch_v8m_base } */ diff --git a/gcc/testsuite/gcc.target/arm/atomic-op-acq_rel-3.c b/gcc/testsuite/gcc.target/arm/atomic-op-acq_rel-3.c index f2ed32d..2b03f75 100644 --- a/gcc/testsuite/gcc.target/arm/atomic-op-acq_rel-3.c +++ b/gcc/testsuite/gcc.target/arm/atomic-op-acq_rel-3.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "FDPIC does not support v8m yet" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-require-effective-target arm_arch_v8m_base_ok } */ /* { dg-options "-O2" } */ /* { dg-add-options arm_arch_v8m_base } */ diff --git a/gcc/testsuite/gcc.target/arm/atomic-op-acquire-3.c b/gcc/testsuite/gcc.target/arm/atomic-op-acquire-3.c index bba1c27..d315b25 100644 --- a/gcc/testsuite/gcc.target/arm/atomic-op-acquire-3.c +++ b/gcc/testsuite/gcc.target/arm/atomic-op-acquire-3.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "FDPIC does not support v8m yet" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-require-effective-target arm_arch_v8m_base_ok } */ /* { dg-options "-O2" } */ /* { dg-add-options arm_arch_v8m_base } */ diff --git a/gcc/testsuite/gcc.target/arm/atomic-op-char-3.c b/gcc/testsuite/gcc.target/arm/atomic-op-char-3.c index 17117ee..11e596d 100644 --- a/gcc/testsuite/gcc.target/arm/atomic-op-char-3.c +++ b/gcc/testsuite/gcc.target/arm/atomic-op-char-3.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "FDPIC does not support v8m yet" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-require-effective-target arm_arch_v8m_base_ok } */ /* { dg-options "-O2" } */ /* { dg-add-options arm_arch_v8m_base } */ diff --git a/gcc/testsuite/gcc.target/arm/atomic-op-consume-3.c b/gcc/testsuite/gcc.target/arm/atomic-op-consume-3.c index 8352f0c..e5da00b 100644 --- a/gcc/testsuite/gcc.target/arm/atomic-op-consume-3.c +++ b/gcc/testsuite/gcc.target/arm/atomic-op-consume-3.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "FDPIC does not support v8m yet" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-require-effective-target arm_arch_v8m_base_ok } */ /* { dg-options "-O2" } */ /* { dg-add-options arm_arch_v8m_base } */ diff --git a/gcc/testsuite/gcc.target/arm/atomic-op-int-3.c b/gcc/testsuite/gcc.target/arm/atomic-op-int-3.c index d4f1db3..997ab08 100644 --- a/gcc/testsuite/gcc.target/arm/atomic-op-int-3.c +++ b/gcc/testsuite/gcc.target/arm/atomic-op-int-3.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "FDPIC does not support v8m yet" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-require-effective-target arm_arch_v8m_base_ok } */ /* { dg-options "-O2" } */ /* { dg-add-options arm_arch_v8m_base } */ diff --git a/gcc/testsuite/gcc.target/arm/atomic-op-relaxed-3.c b/gcc/testsuite/gcc.target/arm/atomic-op-relaxed-3.c index 09b5ea9..383a48a 100644 --- a/gcc/testsuite/gcc.target/arm/atomic-op-relaxed-3.c +++ b/gcc/testsuite/gcc.target/arm/atomic-op-relaxed-3.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "FDPIC does not support v8m yet" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-require-effective-target arm_arch_v8m_base_ok } */ /* { dg-options "-O2" } */ /* { dg-add-options arm_arch_v8m_base } */ diff --git a/gcc/testsuite/gcc.target/arm/atomic-op-release-3.c b/gcc/testsuite/gcc.target/arm/atomic-op-release-3.c index 2b136f5..3227c75 100644 --- a/gcc/testsuite/gcc.target/arm/atomic-op-release-3.c +++ b/gcc/testsuite/gcc.target/arm/atomic-op-release-3.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "FDPIC does not support v8m yet" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-require-effective-target arm_arch_v8m_base_ok } */ /* { dg-options "-O2" } */ /* { dg-add-options arm_arch_v8m_base } */ diff --git a/gcc/testsuite/gcc.target/arm/atomic-op-seq_cst-3.c b/gcc/testsuite/gcc.target/arm/atomic-op-seq_cst-3.c index 7f38d42..77afacb 100644 --- a/gcc/testsuite/gcc.target/arm/atomic-op-seq_cst-3.c +++ b/gcc/testsuite/gcc.target/arm/atomic-op-seq_cst-3.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "FDPIC does not support v8m yet" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-require-effective-target arm_arch_v8m_base_ok } */ /* { dg-options "-O2" } */ /* { dg-add-options arm_arch_v8m_base } */ diff --git a/gcc/testsuite/gcc.target/arm/atomic-op-short-3.c b/gcc/testsuite/gcc.target/arm/atomic-op-short-3.c index 60ae42e..1770cba 100644 --- a/gcc/testsuite/gcc.target/arm/atomic-op-short-3.c +++ b/gcc/testsuite/gcc.target/arm/atomic-op-short-3.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "FDPIC does not support v8m yet" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-require-effective-target arm_arch_v8m_base_ok } */ /* { dg-options "-O2" } */ /* { dg-add-options arm_arch_v8m_base } */ diff --git a/gcc/testsuite/gcc.target/arm/pr65647.c b/gcc/testsuite/gcc.target/arm/pr65647.c index 26b4e39..3ac469d 100644 --- a/gcc/testsuite/gcc.target/arm/pr65647.c +++ b/gcc/testsuite/gcc.target/arm/pr65647.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-skip-if "FDPIC does not support v6m" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } {"-mfloat-abi=soft" } } */ /* { dg-options "-march=armv6-m -mthumb -O3 -w -mfloat-abi=soft" } */ From patchwork Fri May 25 08:03:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136815 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3299735lji; Fri, 25 May 2018 01:44:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpqz/OBODicT3gJ22p5gIosoNzchPzIRNk7oooBQp3SH1rEj7B3RBx61Gq0JJ850JAfiL2B X-Received: by 2002:a17:902:8d85:: with SMTP id v5-v6mr1648382plo.93.1527237869985; Fri, 25 May 2018 01:44:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237869; cv=none; d=google.com; s=arc-20160816; b=rUMyxmxuLTGQqiaDh4wsK2agNHzjy5wxMxX/ceuB+ToMyihweKdQmRKwfCD+ClmnUw Pis+K1Lat1O5zwvvHq+kGAHxej6/NobUitZjJ0K+Lm5+YXOL9se2AI3O8QIMHtf9BG9n xxIepFhgvTudys2JMpYlr1TZ6dFDs0cqoQ88iQAgNlT4IdzwiOIby86s3uViAYpdCc4u vFS0ctDudazj/6u8wtqjZUc5MGmMNljBJkvZNOWZSO6vRzJURimdOgsyRhBdy7XWvhYS V8F1kVwhDcmetykwEEQKIwlWHjWxRCfxKs3kkgdskPWKMWnkG1jLsXI5nIg8jN5Em5Vq fMUg== 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:to:from :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=sNOThwMyfazvN16cNXz1UAv0yECorcIRkHNVigkZnhg=; b=HO03iKKxXotQ0UAnLAu/5AdsYrq3cBzPDFlkLn0i0eX2aVU+UC61XXLWNPUQJ73m7U x3dEsaddbbRAgEtJPeCUTC0sLaypk2YSkbQuGe9AoIrQ4+TZoOPXDVBStR+yq16wRofY I7/QrtWQJg8GEQCqleaj6x9PXJmRhY3iSJx4TvJQXySn4XX/TopJbZMQvWihR1ILe2Ds s2NO4C50aybhn90a/KM05HacV2cTFiI6BCfHnayLTHqEiQRi9gzrEZc5/dohsfSBozjU PvK4b6oc72ieNSh2XTn99Tzo2nwptc46IEBpG8en/wDZ7kDXqbMB3lpDtrY/qhjp7+03 OJbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=OMkaFVnc; spf=pass (google.com: domain of gcc-patches-return-478482-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478482-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 a3-v6si13915826pgc.300.2018.05.25.01.44.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:44:29 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478482-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=OMkaFVnc; spf=pass (google.com: domain of gcc-patches-return-478482-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478482-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:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=oQfJ53ezWXcXbGdf90Lv+P/187wXm PD96foFLDQ8ri2mJDFwcwXuDb5yTn4sNjbKa5WpjAnsHyyijP7m0kyEaLRfE7NnG l6v6e/SzApkCMLcOpZ6v1VAT8ggkBlDb4HuoJg5r439XPNwLVaUBlSTVrO/76Bh9 K84gaZvLEK3mMs= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=2WQuaKp5EK5CXw+/wvj5/JQeMcQ=; b=OMk aFVncdbw5RPSU/q5ExIf8p74YFxvSeTEDET0i92ajGFJeFM1p5mWGttr1LZmIzM8 N1a8Wabpq7gyJYGstBfppx6XqZKjqIVjiZnx7Rdp2lGYq7y5hQvi2q9t0/IB2UfU mCRxONZ0gHJSOnhjl1Ebl8L0eKE4KTeXl7cZPl74= Received: (qmail 125394 invoked by alias); 25 May 2018 08:26:27 -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 75452 invoked by uid 89); 25 May 2018 08:10:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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=gdwarf-2, gdwarf2, nonpic 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, 25 May 2018 08:10:18 +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 w4P895Eg019433; Fri, 25 May 2018 10:10:16 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59qwu4n7-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:10:16 +0200 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 E853F31; Fri, 25 May 2018 08:10: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 97B8E2435; Fri, 25 May 2018 08:10:14 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:10:13 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 18/21] [ARM][testsuite] FDPIC: Skip tests that don't work in PIC mode Date: Fri, 25 May 2018 10:03:31 +0200 Message-ID: <20180525080354.13295-19-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=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 May 25 08:03:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136814 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3299553lji; Fri, 25 May 2018 01:44:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZomEw1aCkpzXPLMlnE3tjNpnUp0Kz9QHYvSpUIFf9PalAyiq1ZlybcSkoxpWhY9PfiIieB9 X-Received: by 2002:a63:87c8:: with SMTP id i191-v6mr1292378pge.124.1527237856230; Fri, 25 May 2018 01:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237856; cv=none; d=google.com; s=arc-20160816; b=CMw6QULvJrO1swhmTcY8Wz3YlaZDe5avihRs0RbkENFlLdzbx72mUX1LTm9oBrm4F3 QRYovsWJWxh8l63kLn+ypvKD6tKUoANC+ZBEkZyeTWTBULnH+CxeY8cNq0j8Okh4/gz5 GwG5hMtWhMKmX21hDeZscByhkuOOan2+2yMNUPqh8AMZG/wgsOvx+TUlwjwC5228Zl8Z UC5ftXeYfg3VbO8uwEe+XCVzsIiwAlLNr6kGKRA6u6Ii40+fnEJjkhAYgREkyalAsDzG lpAaa5uigdFm8+F1NMvaTKPR7W6JXkRVWC+20P8rF0wKuQzvT3zTHM9d7ElQmM0BZZGl GItQ== 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:to:from :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=b8vmOEU2mQpiM6Mfwx1Y+9QFwesXMLEbtM/tvGCWBiU=; b=RVgjBB2f+eOPfRbE6WFQ7Eyi1OyYyHX9hh1+nW9T2inL6+yRevxaCVzcxbg8EGmKLh fUBtyY8Ze10PEUeIcFtZj8ek8Ytm1wUIFF7+BQ8Q/GYm4h/UpMXQb93UuI1obNz2/SGJ 2hw/IUpcenIwp+wMRNE4KC4Ld5e4pX3Ly90/iY5bFsb9234OHfWPufwaZsla+XKuSN/m bt9DMgmQDEjBe2gd9JchoG91xFmknZGqb1OhU+FORrtAizq1IOoaePQq0CXzCpDkP5E+ jr76geLKvxRRxEoCcPMo3Zu5ixH/+COtdGhY0I2nuCXjKy4EBkdHgUIozTd2WYl3tVnp CPCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=PMh7uOEh; spf=pass (google.com: domain of gcc-patches-return-478480-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478480-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 e6-v6si18317434pgr.374.2018.05.25.01.44.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:44:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478480-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=PMh7uOEh; spf=pass (google.com: domain of gcc-patches-return-478480-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478480-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:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=gLRqjYZmfDYyY8dUofIJLphCeaORH QIdDsvUs98XbVwVjZXtVdXiLtox5MZ5U1iCBJVrTHLg0kqchtywlJHzrcVoV09m0 G4EGIJSwEMQe20YJFcsHX4CKrAvR25Vmzjd3on4TOd83+4F9zq+Jfk+OCJ9zcON4 m7zhbghKcakw5A= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=G4GIJqwJsmVMMKEk4kBvSposMSs=; b=PMh 7uOEhAPH2+tFsHdyXarTc7a12jibFpIvmy6036rm7ZisNMdDfMyEipEnqwc9/6Hb bWvIF5XFGRQl4P8p9o0XgmfmmWqg4fJfxWHLGQ1EAhHptXfBNyWXTCEQ708srrPE 33MrhUmK7AKOreygE5AJRjsMq8P5SKAmd/3s2JFw= Received: (qmail 125253 invoked by alias); 25 May 2018 08:26:27 -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 75876 invoked by uid 89); 25 May 2018 08:10:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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=Origin 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, 25 May 2018 08:10:41 +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 w4P89PrI017153; Fri, 25 May 2018 10:10:37 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59j8k6v2-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:10:37 +0200 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 D2E7B3A; Fri, 25 May 2018 08:10: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 F3D37243A; Fri, 25 May 2018 08:10:34 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:10:34 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 19/21] [ARM][testsuite] FDPIC: Handle *-*-uclinux* Date: Fri, 25 May 2018 10:03:32 +0200 Message-ID: <20180525080354.13295-20-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=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 5e3baec..30f8e97 100644 --- a/gcc/testsuite/gcc.dg/pr39323-1.c +++ b/gcc/testsuite/gcc.dg/pr39323-1.c @@ -1,5 +1,5 @@ /* PR c/39323 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ int foo __attribute__ ((aligned(1 << 29))) = 20; /* { dg-error "requested alignment is too large" } */ typedef int __attribute__ ((aligned(1 << 29))) int29; /* { dg-error "requested alignment is too large" } */ 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 aa1296e6..bec000b 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1184,6 +1184,7 @@ proc check_effective_target_pie { } { || [istarget *-*-dragonfly*] || [istarget *-*-freebsd*] || [istarget *-*-linux*] + || [istarget arm*-*-uclinuxfdpiceabi] || [istarget *-*-gnu*] } { return 1; } @@ -7338,6 +7339,7 @@ proc check_effective_target_sync_long_long_runtime { } { } "" }]) || [istarget aarch64*-*-*] + || [istarget arm*-*-uclinuxfdpiceabi] || ([istarget arm*-*-linux-*] && [check_runtime sync_longlong_runtime { #include @@ -7414,6 +7416,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*] @@ -7449,6 +7452,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 May 25 08:03:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136816 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3299944lji; Fri, 25 May 2018 01:44:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqtp/s1utOJeelCfWrv4zGNH4CPF4cxhPZYe4AxmOYVQUuwgwSpMIywUCslDUFUPSqpahRs X-Received: by 2002:a17:902:8bc4:: with SMTP id r4-v6mr1618939plo.381.1527237883426; Fri, 25 May 2018 01:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237883; cv=none; d=google.com; s=arc-20160816; b=gYpKHgpRW7KRd/UsLwVIpuZ2wUvt3jer5YYtvkwJXIacFl6uPC70CtRW/Na0Vx2H0P n0llUR/BbYCK5ikxxF6SdiLTJ2SqA2khrMOiSHxI7U1EIPFJQ7cmshZK8/Sq3gZF7JQ6 xUI+VKR2Hmbp+pFZr56XdHPbqX/CAKPMABH7GJ1e5CSMLjJJILhSAXTu3+lasMqtL/5L QaXyElzVveWp3NnOnNOdQVgbUK8ZoSuu06/Yv5W3rwH8lpWCRLdfIC1cV0HhWopSZv3R aCQKNS1gNBTJGw7s6pSwpmwvTSMAKbFLij9PfHSrh0AF6Q0I1SIfAw8+WYDcO86EXsGA itAA== 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:to:from :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=f9DjUhoZVxph5l9kU+mOkmaNj1HWIyt8GoYVxz59S7M=; b=vzURsoWFDncNDXUKg7MdDjQeM7H1u7juSLg5DSG8m1z4WKZ7loEo8pIBn0me1BWiec 9ZBMSVoOnMh547ewxvuKi3tmz/TUyUyqQKYwX9Cr/rt8JE9/dyLnkUAM+BgFuZxHRfr6 MY7wdlYo9UK+udmlb4cWqZRbPTED92Xex1Ur0ABegyAznZyM1gTTyx83TWZOjMWIiyGw O5/w0Bl1i43UNP/QHB61T7VllXC2/yt/oTTd30VmGND8A5FQm479zSVpTxI2awbsJTRM lEAmoul6ReMUq82JaaPMvenyjUqMe6QBf5jPE81xdQl79pfbhvk36YeU6VOTdw/9AQob fUIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=sBg8HPcr; spf=pass (google.com: domain of gcc-patches-return-478483-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478483-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 u132-v6si18062481pgc.555.2018.05.25.01.44.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:44:43 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478483-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=sBg8HPcr; spf=pass (google.com: domain of gcc-patches-return-478483-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478483-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:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=R4AHFc7fjeql4TuRh51DIbMmV1VBZ 7qhXcQaXk+968jgU3HUIsYjZoGRqoF1nyMvXpajuzW+SZiYNXWwqzCPZ2EzlKLKl uX6+ovP+c72232+rg99t6ZpCAvF1s7XqfIgY5cUgL51Ji+e46rPBu5CsL+JfW/W7 HMs3JpeKKWmKdE= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=B/lRBKnj2LsFfH9zQFVMUEkeVs0=; b=sBg 8HPcr81QRzlsOLmiY455wWVdVD6uhr3xJQXxbvy+uku65x6w9Jj499S2wkV+Nfqi XsAc1caXR3vps0Kf8n6IdazZWDgDejKjhAtJgbkHMgGvHo2WxfeiJlkhVdc9rWST d/OCt9b5wJo5uNTS2O1/98AR5pg24sX74slDvK6I= Received: (qmail 125494 invoked by alias); 25 May 2018 08:26:28 -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 76338 invoked by uid 89); 25 May 2018 08:11:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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=UD:stddef.h, stddefh, stddef.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, 25 May 2018 08:10:58 +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 w4P89PrR017153; Fri, 25 May 2018 10:10:56 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59j8k6x3-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:10:56 +0200 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 618CF3F; Fri, 25 May 2018 08:10: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 32993243A; Fri, 25 May 2018 08:10:55 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:10:54 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 20/21] [ARM][testsuite] FDPIC: Enable tests on pie_enabled targets Date: Fri, 25 May 2018 10:03:33 +0200 Message-ID: <20180525080354.13295-21-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=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 dd237a7..a544743 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" } */ 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 diff --git a/gcc/testsuite/gcc.dg/uninit-19.c b/gcc/testsuite/gcc.dg/uninit-19.c index 094dc0e..3f5f06a 100644 --- a/gcc/testsuite/gcc.dg/uninit-19.c +++ b/gcc/testsuite/gcc.dg/uninit-19.c @@ -12,7 +12,7 @@ fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4, { if (p1 & 8) b[3] = p10[a]; - /* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } .-1 } */ + /* { dg-warning "may be used uninitialized" "" { target { { nonpic || pie_enabled } || { hppa*64*-*-* } } } .-1 } */ } void @@ -22,5 +22,5 @@ fn2 () if (l & 6) n = &c + m; fn1 (l, &d, &e, &g, &i, &h, &k, n); - /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } .-1 } */ + /* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic || pie_enabled } || { hppa*64*-*-* } } } } .-1 } */ } From patchwork Fri May 25 08:03:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 136817 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp3300102lji; Fri, 25 May 2018 01:44:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqCNsLJ+O5B5Bu0wgrc/6h7yBlg5T95VDK14eub9nZ0G3fpEWluIhFfhzcMcQZogoMaGE6m X-Received: by 2002:a62:a89:: with SMTP id 9-v6mr1617871pfk.112.1527237895948; Fri, 25 May 2018 01:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527237895; cv=none; d=google.com; s=arc-20160816; b=tQdRiBKR4YcTyuaPWikKKoFuJ9yxTGA0yXPPjHwsegYVdQRgCnnUiFzXXy58SE5yIl h+uzSOr1LAjeBUmG/34rV+o4YeBSRAzh3ZAQuZHWjAWvbwPCE9RAUKqDrmFCTvxfCKS8 K2/tEB0qGhWkoI5QAevRMGCgxQgO20aTBZhwez11SpCiffweB5k1E6e+HFTyT63+vNtu 6gaonYWJE9Sd1ntngG7oDK0UdGCc99x6f1WpM39E/fLzy0pSxy4hL+EMdoVkBY4HV4nn neqmpRNgC5A5k4VC7ZhwrkdYhUf92wBCSBUEvu+a6KuCkJtNnIwLHbQee1vwBsHCUCnu rk9A== 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:to:from :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=5pGNw++6w4XkIYmngqlzQM683+H564py9s4c8+L1b6Y=; b=QkMx6Zc+E/JVm+cPWhW0KBBvQd5oCveTWhwlDhW28bYlq/TN7vu+aA3xhNfZsuZ65f pB789JkQ+UF0QehN5gPaphR/NiWTGI/WTvwG9we48Vtsr1LDB5lEbpH9wDj+nnSUd+U3 NW9wlPcOTewyDFM1LUg5AWsVeh32NML/+3QwuMy6W30e/GJ3zc489OVIBktYcfrvO7gA lGlut+s1yXM7p/6Drt9QM9dEk3ZIIkWXjKgi7FtSQ6sAVKhVWQqVeZOp+1ZJ1l8JujVF TW/V3IpvrDiSy8LPHmn/1cEJ+hWEr6zAIVG5PwJ0SGQ8K0IFgwOcIu3ltZ2D7aBjndnk MCQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=xaiQw+A6; spf=pass (google.com: domain of gcc-patches-return-478484-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478484-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 e125-v6si13204967pgc.128.2018.05.25.01.44.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 01:44:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-478484-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=xaiQw+A6; spf=pass (google.com: domain of gcc-patches-return-478484-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-478484-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:subject:date:message-id:in-reply-to:references:mime-version :content-type; q=dns; s=default; b=V1NX5rCqdsrk0AsZcheMCNOOKfEvJ IwvcWppVhKweAq9GuOqLELYilPT28Gsr5e3iFFclOwADKwwmdPInDtOi34l7JcZ4 NM1/k/v/VKbkrlxQAXMveIRcbaQoom4Q8CIJAxsgmxhHsFjssYjDdGApeMGXZ5VW bFPoDUlLqtSlL8= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type; s=default; bh=nl2T//wwiQkZjVdNuCttcq3KkLY=; b=xai Qw+A6e1/Er7gIgCu/PIEXtAvmhZp6QtVkJGhb48OaSodAnqoF73+MISxLLZsxGfO S3sWDRRivVeoHlfbya0ObYM5D0MSK43rHzr/bXfSpSJBE6NY1ThTjLcHUA5GbFdK 6LcMvI0iuTt495YzRQG6wb6SY0kqOc4WzOfpve5g= Received: (qmail 125613 invoked by alias); 25 May 2018 08:26:28 -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 76622 invoked by uid 89); 25 May 2018 08:11:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 May 2018 08:11:33 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fM7or-0004vq-5X for gcc-patches@gcc.gnu.org; Fri, 25 May 2018 04:11:32 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:65467 helo=mx07-00178001.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fM7oq-0004vJ-SH for gcc-patches@gcc.gnu.org; Fri, 25 May 2018 04:11:25 -0400 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 w4P892aj019427; Fri, 25 May 2018 10:11:23 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2j59qwu4u5-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 25 May 2018 10:11:23 +0200 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 9F7823A; Fri, 25 May 2018 08:11: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 6D704243D; Fri, 25 May 2018 08:11:15 +0000 (GMT) Received: from gnb.st.com (10.75.127.51) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 25 May 2018 10:11:14 +0200 From: Christophe Lyon To: , Subject: [ARM/FDPIC 21/21] [ARM][testsuite] FDPIC: Adjust pr43698.c to avoid clash with uclibc. Date: Fri, 25 May 2018 10:03:34 +0200 Message-ID: <20180525080354.13295-22-christophe.lyon@st.com> In-Reply-To: <20180525080354.13295-1-christophe.lyon@st.com> References: <20180525080354.13295-1-christophe.lyon@st.com> MIME-Version: 1.0 X-ClientProxiedBy: SFHDAG1NODE2.st.com (10.75.127.2) To SFHDAG5NODE1.st.com (10.75.127.13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-25_03:, , signatures=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 91.207.212.93 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; \ }))