From patchwork Wed May 15 12:39:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164276 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp602202oca; Wed, 15 May 2019 05:40:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMssO1MCbjH7nXVp9hOaSMmqjf4tx6zj/vmOmjSq8R+0mgVunTN/Bg207UbvQDtez7oCOj X-Received: by 2002:a63:1d05:: with SMTP id d5mr43420417pgd.157.1557924055022; Wed, 15 May 2019 05:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924055; cv=none; d=google.com; s=arc-20160816; b=mUjcmV0uKnLb1IdBM1NhK10LXUAGJ8ExDi+CC/r5i8B9Bgn8qn3W+sZGK/oxLeM+sl LWxb1oad36wEGixIeg1UFNTsiFmumVZpDoRxcfmVAd2J60c43QbBCv5OT7c7aeXip6uc gpD+Xqvt0G2nwrizFrVlheGX2Fjw0+ucLCeg4cm/68sd2oKrLuubuGaA6MxCFOIWCo8M Ap3J7bMlu2IV361ApJSvGpbEPf6PzToUIt7rsoHEi6mqyiQ6a8j3ZUF0mKW1kehaQtle NrbDQuQ3tkFYQGsI46b1e6488V5SUlyDZsct/4g5rLwClOQb8xZ+F7HiQH8nu1h1N050 g4jg== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=aWwxTkIWEvWAbPorTqMtQcgPqhxKxdJzMlCX72tYqCY=; b=HzjCuBCZi6hlUyT02CRtzd8Xzf3Cp1X/b7KUaoRNkXuFHMwdSwdsm+hrITFqokIwpB qSazDsuLawaj99obycny00BYZ+almiBtGZ2F/JTjtt7AbT6DEzo7qAEmv4lmMEP6pyZf fTU238P8HanojMGCNzgfX+tRmhdDWe8VpyYT4ECuBRorDZxf274/nhYi51oUAndYX0to DgUILHe1dytzdbrpgm3YhD05tLSOfLJytWOS8iMe2FW93+BLd0OZQ31wG1/lg5J2pon2 jD5rKFA9C/e/iJ39hxAS2xTHz3M6MATfezcP8hSrW9BZD3CHpzJN5I9VlwyilVq4GMKc T3tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=TNpvr2Nc; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=UK9kmKmY; spf=pass (google.com: domain of gcc-patches-return-500765-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500765-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 f62si1722971plb.339.2019.05.15.05.40.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:40:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500765-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=TNpvr2Nc; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=UK9kmKmY; spf=pass (google.com: domain of gcc-patches-return-500765-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500765-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=CLV Qom8ZlGUHkh66QpiZ3qhLY/pgFIG9vYAgDNvEy/xeu+r1smaRVtYUY3kq6+3MAap HrBt7jqmCYQEkeOmq22tfeB9N5/YMewGZDGTedOIrqZDJupu3DgaKvfmG5fvSM1Q bI2KUxZDq3ggpzUOyUTxPRcKXzg3A0H4uMr53sZI= 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=p0m/wmin/ E/RWuDg94FKxVva9aA=; b=TNpvr2NcHuL1VtN/ZL1+TEAum2Xv72RMU8CQF51Oi qLNqeKf+0TZRDkPeafP3fMzAXSrLw5a2rPrJChtyNZN2JxCqbEzA93R0sESBEvaN jykCpd90YrlD9K99s3N2aOz4fQ09CcAkN6Q8fqHioSNqgpkptfbzYcz1L6Xmz9r6 +g= Received: (qmail 128571 invoked by alias); 15 May 2019 12:40:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 128463 invoked by uid 89); 15 May 2019 12:40:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.6 required=5.0 tests=AWL, 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.1 spammy=Requirements, gun, Specification 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; Wed, 15 May 2019 12:40:40 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCcNsu003671 for ; Wed, 15 May 2019 14:40:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=aWwxTkIWEvWAbPorTqMtQcgPqhxKxdJzMlCX72tYqCY=; b=UK9kmKmYfDuwRqjXGtdImIgdDK6/Ze/S9L59pEZvAMJGRGGgHuy/018AHIvJFMOJLmIP NLyKkke//bkDq+p1HbA770Wg6dsJclksYoWvRTg7zC1umuExTwNwXSL7vmdnCT4zfVNm BD7ENvWuwAHn4+ZgMRRJcjoR4arhgODsRUcrdCaoTOrUrdKizeV4o6VGr5RLiOklayf2 NpD0KOEVXRDv38s06XRT4Jw3DqHA0BZ1qwnKUt75hzCKa4gdLg05npUMgq0jXkZjuYk1 xc3VDHjsBAW1B0ZrbLbVjFPSVye4niBRv5vQLX1BpmVNNLRDEuQR98TimNpQKHA2pNKT NA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sdkv00gdr-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:40: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 4B69A38 for ; Wed, 15 May 2019 12:40: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 AC48E2736 for ; Wed, 15 May 2019 12:40:34 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:40:33 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 01/21] [ARM] FDPIC: Add -mfdpic option support Date: Wed, 15 May 2019 14:39:26 +0200 Message-ID: <20190515124006.25840-2-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.opt: Add -mfdpic option. * doc/invoke.texi: Add documentation for -mfdpic. Change-Id: I0eabd1d11c9406fd4a43c4333689ebebbfcc4fe8 -- 2.6.3 diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt index 9067d49..2ed3bd5 100644 --- a/gcc/config/arm/arm.opt +++ b/gcc/config/arm/arm.opt @@ -306,3 +306,7 @@ Cost to assume for a branch insn. mgeneral-regs-only Target Report RejectNegative Mask(GENERAL_REGS_ONLY) Save Generate code which uses the core registers only (r0-r14). + +mfdpic +Target Report Mask(FDPIC) +Enable Function Descriptor PIC mode. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 29585cf..805d7cc 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -703,7 +703,8 @@ Objective-C and Objective-C++ Dialects}. -mrestrict-it @gol -mverbose-cost-dump @gol -mpure-code @gol --mcmse} +-mcmse @gol +-mfdpic} @emph{AVR Options} @gccoptlist{-mmcu=@var{mcu} -mabsdata -maccumulate-args @gol @@ -17912,6 +17913,23 @@ MOVT instruction. Generate secure code as per the "ARMv8-M Security Extensions: Requirements on Development Tools Engineering Specification", which can be found on @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}. + +@item -mfdpic +@itemx -mno-fdpic +@opindex mfdpic +@opindex mno-fdpic +Select the FDPIC ABI, which uses function descriptors to represent +pointers to functions. When the compiler is configured for +@code{arm-*-uclinuxfdpiceabi} targets, this option is on by default +and implies @option{-fPIE} if none of the PIC/PIE-related options is +provided. On other targets, it only enables the FDPIC-specific code +generation features, and the user should explicitly provide the +PIC/PIE-related options as needed. + +The opposite @option{-mno-fdpic} option is useful (and required) to +build the Linux kernel using the same (@code{arm-*-uclinuxfdpiceabi}) +toolchain as the one used to build the userland programs. + @end table @node AVR Options From patchwork Wed May 15 12:39:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164277 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp602514oca; Wed, 15 May 2019 05:41:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCxDd0o5PMc9L3GBvyO1M8mLFPiL6TPc96iK5AFoYb4WcD1ZRUFjrkWCNw2dXEnQ7IPCJ3 X-Received: by 2002:a65:41c7:: with SMTP id b7mr19677246pgq.165.1557924076105; Wed, 15 May 2019 05:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924076; cv=none; d=google.com; s=arc-20160816; b=YOEftpBX0f2aCeJcCS6MFjO1CjG6yx4oWqpSJe7txIt6sP85oW2D1gnQ6NTGoO/vtK hnfA13GDT5JyRDzLj3jyJIRJjgVbF/ePwgdf1ecBQANYHMvQ4IrfzeJJ7uZSBv6bQBj7 OFqb3adYJUjFWPM2LAzxO2/tWTbBS0+SHU2XZazf7v+2FxI4tIGdwRfyB4Sev5JJYGTh daPICnp1P16WDtH/X2yGyVpWMgSDHPlmH5tPbZ5Cj2KAw1M30VkZ6mPfLW9EESfJ9j3g tS0bfwpRh4Wbo+4jAcZ/ADPGjMQva2B/uVySVL3bBkegI5GfUVrLcB/SP7fa+Nzml4SB Uaig== 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 :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=THJmfOEyeqkk7SzN5SguHkM/jc3GqIfub0PV2oKcWJ0=; b=jTO0rFGWY0eWy+BMQeY3CgcgMcXUNq2BzZTQlG5kHDn/GtA1ZI10Gqjrwfoxr+b8Ov xPLfv6cV2GGf89x0tyoJwAe2F5ipNMn7taCTXhs+557a3KdQQNUnvZd67jjlRM77ZLrL I6wslrwI+/VbDhaFd/GP5QrOLk1ZaKja1d8kHFzpAZaQnl3BODJ23U8kL/hy1ZWR4Kp/ wWAB9sG98ePU/xWT08/G2FOQbKecS9DbkoyauREmtZe8gyWBlon60BbdwE5ke1U12lJ3 szC46BRCeVe6zt9G11Kd5yEbPN3wpSka/+B8DxjWBzBrEOyKlqFm64gVeuuc7NHW2uLV LP4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=iShzXTF1; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=anWmYtUQ; spf=pass (google.com: domain of gcc-patches-return-500766-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500766-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 5si1829055pgm.540.2019.05.15.05.41.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:41:16 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500766-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=iShzXTF1; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=anWmYtUQ; spf=pass (google.com: domain of gcc-patches-return-500766-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500766-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=vGdxdquFMli/qO2NxjJBJ24fK2iRB y3K7XW+tYXkXELxqxwFVOGxh5ULGHuODCYFfNhOB0Gfc7ROTd3HGtDsMH1u3tcRY Mcmv6vjcry1dekEMioikf+CaFLWMMyUIBEahypq+4Fhq5z69ae/QNt+DowFLrimP 2e367841lGCy48= 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=jLO0zG0haPCmZd8ZbOh88O9bIgg=; b=iSh zXTF16R6A3+/rRgLnUvPdWoJa6M14KIYDjhhjWQXILScOINnu5fdUiOQYMmkdaf8 rtqlyLS63LKFPjvY9bIzS3XsR5hK0dzHR/3+s4F0FU9D6lSjSlTOynIipy5nvoL0 781cDjOp0Xt35G0QsN7sw0zMA2biP+cFovuzz6tk= Received: (qmail 3351 invoked by alias); 15 May 2019 12:41:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 2928 invoked by uid 89); 15 May 2019 12:41:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.8 required=5.0 tests=AWL, 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.1 spammy=TABLE, telf 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; Wed, 15 May 2019 12:40:58 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCaVSi006076 for ; Wed, 15 May 2019 14:40:55 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=THJmfOEyeqkk7SzN5SguHkM/jc3GqIfub0PV2oKcWJ0=; b=anWmYtUQhi+MYQwydcwh73URBHVlEZ7ROw3wAs7hE7SsivOxL7xmgr9+p+YYKSi643O4 jXQ2DmD413eF381zjW4fD34BjVxj+Hx4pqo/VP41rstDmbKZ7bIHHY+u9hEB1Eadbgp4 IDZU+oB1Hhd6AI3n1ykJtMo4xps7CSVwHyoIosLft15MiF/KRNgeqGSq/s290rLcJ/I0 /1GgmmY441W+cqhuv1ZkmBi/qIH8QNY86SeNx3t4MgVI9CDO6j8uS4PAQibKnmorZwMs pBjdV3nC9vJH6zQV5C3dYa/9neCI/s/nj5R98xA3GzwZbA6tJDW7vHKB4xYmixrNnMVj YQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sg0an6auh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:40: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 1AA7F34 for ; Wed, 15 May 2019 12:40: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 D68602750 for ; Wed, 15 May 2019 12:40:54 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:40:54 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 02/21] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts Date: Wed, 15 May 2019 14:39:27 +0200 Message-ID: <20190515124006.25840-3-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes The new arm-uclinuxfdpiceabi target behaves pretty much like arm-linux-gnueabi. In order the enable the same set of features, we have to update several configure scripts that generally match targets like *-*-linux*: in most places, we add *-uclinux* where there is already *-linux*, or uclinux* when there is already linux*. In gcc/config.gcc and libgcc/config.host we use *-*-uclinuxfdpiceabi because there is already a different behaviour for *-*uclinux* target. In libtool.m4, we use uclinuxfdpiceabi in cases where ELF shared libraries support is required, as uclinux does not guarantee that. 2019-XX-XX Christophe Lyon config/ * futex.m4: Handle *-uclinux*. * tls.m4 (GCC_CHECK_TLS): Likewise. gcc/ * config.gcc: Handle *-*-uclinuxfdpiceabi. libatomic/ * configure.tgt: Handle arm*-*-uclinux*. * configure: Regenerate. libgcc/ * config.host: Handle *-*-uclinuxfdpiceabi. libitm/ * configure.tgt: Handle *-*-uclinux*. * configure: Regenerate. libstdc++-v3/ * acinclude.m4: Handle uclinux*. * configure: Regenerate. * configure.host: Handle uclinux* * libtool.m4: Handle uclinux*. Change-Id: I6a1fdcd9847d8a82179a214612a3474c1f492916 -- 2.6.3 diff --git a/config/futex.m4 b/config/futex.m4 index e95144d..4dffe15 100644 --- a/config/futex.m4 +++ b/config/futex.m4 @@ -9,7 +9,7 @@ AC_DEFUN([GCC_LINUX_FUTEX],[dnl GCC_ENABLE(linux-futex,default, ,[use the Linux futex system call], permit yes|no|default) case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then diff --git a/config/tls.m4 b/config/tls.m4 index 1a5fc59..a487aa4 100644 --- a/config/tls.m4 +++ b/config/tls.m4 @@ -76,7 +76,7 @@ AC_DEFUN([GCC_CHECK_TLS], [ dnl Shared library options may depend on the host; this check dnl is only known to be needed for GNU/Linux. case $host in - *-*-linux*) + *-*-linux* | -*-uclinux*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac diff --git a/gcc/config.gcc b/gcc/config.gcc index c7a464c..67780fb 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -776,7 +776,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 @@ -785,7 +785,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 @@ -805,7 +805,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*) @@ -1167,7 +1167,7 @@ arm*-*-netbsdelf*) tmake_file="${tmake_file} arm/t-arm" target_cpu_cname="strongarm" ;; -arm*-*-linux-*) # ARM GNU/Linux with ELF +arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) # ARM GNU/Linux with ELF tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" extra_options="${extra_options} linux-android.opt" case $target in diff --git a/libatomic/configure b/libatomic/configure index e7076a0..10b0287 100755 --- a/libatomic/configure +++ b/libatomic/configure @@ -6055,7 +6055,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -8540,7 +8540,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -9135,7 +9135,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -10666,7 +10666,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt index ecbb7d3..38e77ce 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 91abc84..facca2a 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -245,7 +245,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 @@ -435,7 +435,7 @@ arm*-*-fuchsia*) arm*-*-netbsdelf*) tmake_file="$tmake_file arm/t-arm arm/t-netbsd t-slibgcc-gld-nover" ;; -arm*-*-linux*) # ARM GNU/Linux with ELF +arm*-*-linux* | arm*-*-uclinuxfdpiceabi) # ARM GNU/Linux with ELF tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm" tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" tm_file="$tm_file arm/bpabi-lib.h" diff --git a/libitm/configure b/libitm/configure index fb742d7..7b4c749 100644 --- a/libitm/configure +++ b/libitm/configure @@ -6731,7 +6731,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -9217,7 +9217,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -9812,7 +9812,7 @@ _LT_EOF archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -11343,7 +11343,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -13244,7 +13244,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi inherit_rpath_CXX=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -13831,7 +13831,7 @@ interix[3-9]*) postdeps_CXX= ;; -linux*) +linux* | uclinux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 @@ -14082,7 +14082,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -15003,7 +15003,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -16468,7 +16468,7 @@ fi case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then @@ -16591,7 +16591,7 @@ _ACEOF if ac_fn_c_try_link "$LINENO"; then : chktls_save_LDFLAGS="$LDFLAGS" case $host in - *-*-linux*) + *-*-linux* | -*-uclinux*) LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS" ;; esac diff --git a/libitm/configure.tgt b/libitm/configure.tgt index 4c0b602..eea865d 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 84258d8..cb0fdc5 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1404,7 +1404,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 ], @@ -1526,7 +1526,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 @@ -2415,7 +2415,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*) @@ -2661,7 +2661,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 ;; *) @@ -4361,7 +4361,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*) @@ -4543,7 +4543,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 7d134a0..91873b8 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -6652,7 +6652,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 ;; @@ -9003,7 +9003,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*) @@ -9598,7 +9598,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 @@ -11138,7 +11138,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 @@ -13063,7 +13063,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 @@ -13650,7 +13650,7 @@ interix[3-9]*) postdeps_CXX= ;; -linux*) +linux* | uclinux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 @@ -13901,7 +13901,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 @@ -14822,7 +14822,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 @@ -16143,7 +16143,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*) @@ -16560,7 +16560,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 ;; *) @@ -20834,7 +20834,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 @@ -21334,7 +21334,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 @@ -28220,7 +28220,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 @@ -53895,7 +53895,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 @@ -60082,7 +60082,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 @@ -78725,7 +78725,7 @@ fi case "$target" in - *-linux*) + *-linux* | *-uclinux*) case "$enable_linux_futex" in default) # If headers don't have gettid/futex syscalls definition, then @@ -80354,7 +80354,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*) @@ -80906,7 +80906,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 f2ff129..ae156fc 100644 --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -264,7 +264,7 @@ case "${host_os}" in linux-musl*) os_include_dir="os/generic" ;; - gnu* | linux* | kfreebsd*-gnu) + gnu* | linux* | kfreebsd*-gnu | uclinux*) if [ "$uclibc" = "yes" ]; then os_include_dir="os/uclibc" elif [ "$bionic" = "yes" ]; then @@ -327,7 +327,7 @@ esac # Set any OS-dependent and CPU-dependent bits. # THIS TABLE IS SORTED. KEEP IT THAT WAY. case "${host}" in - *-*-linux*) + *-*-linux* | *-*-uclinux*) case "${host_cpu}" in i[567]86) abi_baseline_pair=i486-linux-gnu @@ -361,7 +361,7 @@ case "${host}" in fi esac case "${host}" in - arm*-*-linux-*) + arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver" ;; esac diff --git a/libtool.m4 b/libtool.m4 index 8966762..afd3f05 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -2449,7 +2449,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) version_type=linux need_lib_prefix=no need_version=no @@ -3089,7 +3089,7 @@ irix5* | irix6* | nonstopux*) ;; # This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) lt_cv_deplibs_check_method=pass_all ;; @@ -3734,7 +3734,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4032,7 +4032,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinux*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4449,7 +4449,7 @@ _LT_EOF _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in @@ -5946,7 +5946,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | uclinuxfdpiceabi) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler @@ -6598,7 +6598,7 @@ interix[[3-9]]*) _LT_TAGVAR(postdeps,$1)= ;; -linux*) +linux* | uclinux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 From patchwork Wed May 15 12:39:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164278 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp602822oca; Wed, 15 May 2019 05:41:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5vDj3Btb7T/kVS6J/oyugoPR94ClwstfxohCagL7D2CTfAIA5ztzDGCEL6E6cdVmy/v+h X-Received: by 2002:a65:4544:: with SMTP id x4mr20542875pgr.323.1557924093687; Wed, 15 May 2019 05:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924093; cv=none; d=google.com; s=arc-20160816; b=0TkzWoLc+fQukd3q25l4WnWfPpcDGI2tyq1AEggIzqwVrVNBcs4hefBtnhk9DAY8Pw k7UbiGGo32An2fbShjLZ9u7q4U6TFXx1cJ6WkW+2yAt3xLYB1/swZR3zJ26DmdbNQ12J Pkb9mAK7XlVoCiO+10EENGBdN7MaHrN1s/mqI7C+8FG4s/qQJu/NW7Gfa2u/bQ9AA80H CufhSmecTLirLfTQGV402aAfpeO+aqqb2FTV7iMGYa261hw3ctrC1uhp8NHbBvbstRH+ 1yaHWDK17j+WGZ+uq5Ymt6uSiCEyCvLDF7Euo4S9m3ULCbPf9dx9ly/zWtfaTnnyikvb tgKA== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=9U4L2Ua8RIb7Wnjwy3iRSeO1jYfzHqJaaNEX+qCR5CY=; b=zQcpIlDTlD3WLE2Lp6XTGJ58kHl1IXbID80BkBtG22ooSstqf6EL9ofv2+xSv8Whd4 gpmvJ1xVm4dZRMZGmrDcwUxDskTIOsHd2g2rQRQZNF7GCekRXRGPneohKYIxCjGKE826 iFEfZyA3es26P881+vxOQUG/apXnweZBvizhqf6XVpYM1PDd7+qmzh0qLziO3XoQUB35 3nlZRbgXnKdxOAQDNqQAfeqJfI5MvWMDOoAFjnsjnLkJZqir1lIh7AbyNhgLtxw+6tHb 7gk7HEgZp1xsRXr7y5+mPZutKtA/Z4DzIaXzwWI8GjmSSN6+B22KK+Ejbd4KzeySH6mX NuUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KQLdOg7x; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=vl+QnyS9; spf=pass (google.com: domain of gcc-patches-return-500767-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500767-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 h191si543728pge.15.2019.05.15.05.41.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:41:33 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500767-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=KQLdOg7x; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=vl+QnyS9; spf=pass (google.com: domain of gcc-patches-return-500767-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500767-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=mut c1T4/loIcvyL7vwqML4eoVJiVuk5RPJUbdMQMLlzudFs3BvFDCzBikw8nhtncHfu dQWDrpQzt6fqV4tRCCrvX3bcfyaiHdZfUFANc+xo1qLK7L7S3ydMxezng25SI8Ub v2vYsuE2prWGbr52I4XkafT13YzvSf0EyeQk7L5Q= 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=E2LZSHBsk dAGWf77yEujnvmb7eY=; b=KQLdOg7xPB/TZjSKsaMLM8Eh2I3nKaYtRay4lCKSC uVApYS9ii/+ONLlGAnTs6AyKrCHUbEO14R+SIXe/C2++efn0WsQmmwew3CPVUc5Q cvTXy25uMaaw9yyTKud/ZvC7BnzHFtnYEb0BaLLQwlJ3waGCZIh+5CvSFv8opqtq Jk= Received: (qmail 8523 invoked by alias); 15 May 2019 12:41:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 8409 invoked by uid 89); 15 May 2019 12:41:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.9 required=5.0 tests=AWL, 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.1 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; Wed, 15 May 2019 12:41:18 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCcNsR003672 for ; Wed, 15 May 2019 14:41:15 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=9U4L2Ua8RIb7Wnjwy3iRSeO1jYfzHqJaaNEX+qCR5CY=; b=vl+QnyS9/xzkvz1VbvlV7EMm8kqRht1dEBazTXaL2I+xVuRGjkr+f0EVwnpLh0D6LH7Y Ea1BeA4A7s3objIG/in/lLOmklFQVFjwFAZKNlRUGdaBTr0XPv7v+oERzX8CHMY5E/cN fFclkoaW8/pfmjfTfuNywMG+ID5p0p0MQ/y3jpRp1H50vY0j/o4zTwSSL9SQvK4F4ltA Z0H9zfdEycJuvKu7FjiE5Powo94D7jk4vLiGT2zVM+YPVYDE8rh7LzTvReOrBQEXTtJr Ujvs3IN9pZzrJpiXoQQab5NmsKIjEmfwd5MBIwUEDHR6Fw5xgvzqZOYKWRJy1y1gTgag pA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sdkv00gkf-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:41:15 +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 30C8E31 for ; Wed, 15 May 2019 12:41: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 1A3312750 for ; Wed, 15 May 2019 12:41:15 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:41:14 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 03/21] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided Date: Wed, 15 May 2019 14:39:28 +0200 Message-ID: <20190515124006.25840-4-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes In FDPIC mode, we set -fPIE unless the user provides -fno-PIE, -fpie, -fPIC or -fpic: indeed FDPIC code is PIC, but we want to generate code for executables rather than shared libraries by default. We also make sure to use the --fdpic assembler option, and select the appropriate linker emulation. At link time, we also default to -pie, unless we are generating a shared library or a relocatable file (-r). Note that even for static link, we must specify the dynamic linker because the executable still has to relocate itself at startup. We also force 'now' binding since lazy binding is not supported. We should also apply the same behavior for -Wl,-Ur as for -r, but I couldn't find how to describe that in the specs fragment. 2019-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 67780fb..495cbc2 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1177,6 +1177,11 @@ arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) # ARM GNU/Linux with ELF esac tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi" tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h arm/arm.h" + case $target in + arm*-*-uclinuxfdpiceabi) + tm_file="$tm_file arm/uclinuxfdpiceabi.h" + ;; + esac # Generation of floating-point instructions requires at least ARMv5te. if [ "$with_float" = "hard" -o "$with_float" = "softfp" ] ; then target_cpu_cname="arm10e" diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h index e1bacf4..6c25a1a 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 66ec0ea..67edb42 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -101,11 +101,14 @@ #undef ASAN_CC1_SPEC #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}" +#define FDPIC_CC1_SPEC "" + #undef CC1_SPEC #define CC1_SPEC \ - LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC, \ + LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \ + FDPIC_CC1_SPEC, \ GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \ - ANDROID_CC1_SPEC) + ANDROID_CC1_SPEC "" FDPIC_CC1_SPEC) #define CC1PLUS_SPEC \ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC) diff --git a/gcc/config/arm/uclinuxfdpiceabi.h b/gcc/config/arm/uclinuxfdpiceabi.h new file mode 100644 index 0000000..43a17de --- /dev/null +++ b/gcc/config/arm/uclinuxfdpiceabi.h @@ -0,0 +1,53 @@ +/* Configuration file for ARM GNU/Linux FDPIC EABI targets. + Copyright (C) 2018 Free Software Foundation, Inc. + Contributed by STMicroelectronics. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +/* On uClibc EABI GNU/Linux, we want to force -mfdpic by default, + which also means we produce PIE code by default. */ +#undef FDPIC_CC1_SPEC +#define FDPIC_CC1_SPEC \ + "%{!mno-fdpic:-mfdpic %{!no-PIE:%{!fpie:%{!fPIC:%{!fpic: -fPIE}}}}}" + +/* Add --fdpic assembler flag by default. */ +#undef TARGET_FDPIC_ASM_SPEC +#define TARGET_FDPIC_ASM_SPEC "%{!mno-fdpic: --fdpic}" + +/* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ +#if TARGET_BIG_ENDIAN_DEFAULT +#define TARGET_FDPIC_LINKER_EMULATION "armelfb_linux_fdpiceabi" +#else +#define TARGET_FDPIC_LINKER_EMULATION "armelf_linux_fdpiceabi" +#endif + +/* Unless we generate a shared library or a relocatable object, we + force -pie. */ +/* Even with -static, we have to define the dynamic-linker, as we + have some relocations to resolve at load time. */ +#undef SUBTARGET_EXTRA_LINK_SPEC +#define SUBTARGET_EXTRA_LINK_SPEC \ + "%{!mno-fdpic: -m " TARGET_FDPIC_LINKER_EMULATION \ + "%{!shared:%{!r: -pie}} \ + %{static:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}" \ + "%{mno-fdpic: -m " TARGET_LINKER_EMULATION "}" \ + "%{!r:%{!mno-fdpic: -z now}}" + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "%{!mno-fdpic:%{!shared:crtreloc.o%s}} " \ + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC) diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt index b241ddb..c38b3f4 100644 --- a/libsanitizer/configure.tgt +++ b/libsanitizer/configure.tgt @@ -45,6 +45,9 @@ case "${target}" in ;; sparc*-*-solaris2.11*) ;; + arm*-*-uclinuxfdpiceabi) + UNSUPPORTED=1 + ;; arm*-*-linux*) ;; mips*64*-*-linux*) From patchwork Wed May 15 12:39:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164279 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp603153oca; Wed, 15 May 2019 05:41:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqypWMqYvDih4vdBKRGs5EJRd0bC5reD817EMyuLwOYvQpGMgcwf/BSQofXfhSAC4B9rEOwp X-Received: by 2002:a63:8949:: with SMTP id v70mr44866558pgd.196.1557924115500; Wed, 15 May 2019 05:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924115; cv=none; d=google.com; s=arc-20160816; b=CU8PHg6QMmhChVJ0C7Plq5twHpMBApMbVjU0L3BRtudGmbqh1p5XX3n+EJRc9Uji9z aLXO2m5YsWgq4AmEkYeJdRv6oSoSyJSPUyvfzDTSTEf+kkxwLA4seNiEkQCBs2RJfrHA YokVUtU/UDieHWCQrylVlHCCM9XEfE7pryqjblCj+Wn7bxy3HqH7cmiKosonHBNpsXyK g+8o+eVA5qWmKsJMXzuBZjteVhHxm0jQ95tC9BmNf7pVUOPzvm9/tO7Q8IR0HjI6Teez AwQh7rDSIeN6aKXyA8r6G34KcepH73A/HWfHuf+Rhfd90yoKCceNbhbha856q3JrJgtn WVBQ== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=8x6xW+OdeFFYw6JJkJWJxnwgvzSHxpvBsCwH+A251qg=; b=BTLr6JkXYGhAXCOkKU27ffgEb73+lkskehxZufe+ZMFsKfoJBW/jFbVTKOmEdioYXG iZ1Yq+or9OTxSbKc/7yjGOws7pgB9cTHTYC90Xa7/dbrVjG5CGGiopQiOiAjhE02L8fM Tn1O8JAi4h60SYmQN+p/iF9XaQzwwMEKPsbyDQ56IHdG4c5uC2CssTh4fi8NXV8N1xOl UiMRTDXm+XvI8gK3GT7klSG3RhJZYXC77xfWtaUJzt7zzVXMrAkO+yCcPpL+W7F35e/C aFhRq+hsxylDlfXv0AEabmMkwA0N4GshdNI3zoQgjMRLOHrU7TNyGWAZsHl8kGjLi4wv Jwnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=wkV9V2oi; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=U7fDIYrD; spf=pass (google.com: domain of gcc-patches-return-500768-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500768-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 h190si1756926pgc.248.2019.05.15.05.41.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:41:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500768-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=wkV9V2oi; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=U7fDIYrD; spf=pass (google.com: domain of gcc-patches-return-500768-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500768-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=iUP +fH9+fmuCIfPfQIGBbHAtBq3Q2ZwBfSNdcxJCMpwW/cdk804QeXoffUWi+idrHDX HSmSU0oB10ous+8hmgdhRUD2W6pfg/o/FJwV//uJeekHBKtlMSZ9EpmVti0l9j4M viHKcLzd3cWFpt4fzNxIP+DfjZiO8VZFk9eP3G8A= 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=aInPlpaF9 r/Qi7kkZMSydXlSlTs=; b=wkV9V2oi4QtgmbFHdOU3w8Hg8hdn3BeIDrPZsTnrM t6HeIRNP8e5UXbK1ixt3ahXc70XYjewG4ZXeTegGARUr39Pc5KAcI5LilBhRNZYr dfA3s81N3AtwRrmDww3LsGJoO09nsIQdnvKk8eZ4mKgj4mw88LvFv/+Woqcb8WBZ ck= Received: (qmail 17319 invoked by alias); 15 May 2019 12:41: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 17109 invoked by uid 89); 15 May 2019 12:41:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.3 required=5.0 tests=AWL, 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.1 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; Wed, 15 May 2019 12:41:38 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCcNsU003672 for ; Wed, 15 May 2019 14:41:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=8x6xW+OdeFFYw6JJkJWJxnwgvzSHxpvBsCwH+A251qg=; b=U7fDIYrDQuTJhpOs9dyOb71ORxQhkYzWXkfmL84MENuSNFXPnAmVInQgG4oyZCHJ7lMz BBAFwWHDTT9afuqaxdxKo86YAKUmRMJdnGp+FBqa6QFAs3VFjtxOyIt13BP42Aob4X9l WBLULS4KnUtsVgpC8/80PFpBfJGygprDFIoiZnLbp7vsxCpJg2JYNf1EwkSyVcD37ICB 58KbwolvqzZLjQIjMMQzn8VBWAaE0W0xfwR5lmzImCCbS++gUJ1O/oahOliXDiKDox6O mIKyCzgF/gghxGnK/DZEcrbOR0mvp4zqbFmWWJ4A9vSC4vKe1qNplsN5Ubf30eQt1CtH Zg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sdkv00gne-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:41: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 8646431 for ; Wed, 15 May 2019 12:41: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 5FBCC2753 for ; Wed, 15 May 2019 12:41:35 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:41:34 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 04/21] [ARM] FDPIC: Add support for FDPIC for arm architecture Date: Wed, 15 May 2019 14:39:29 +0200 Message-ID: <20190515124006.25840-5-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes The FDPIC register is hard-coded to r9, as defined in the ABI. We have to disable tailcall optimizations if we don't know if the target function is in the same module. If not, we have to set r9 to the value associated with the target module. When generating a symbol address, we have to take into account whether it is a pointer to data or to a function, because different relocations are needed. 2019-XX-XX Christophe Lyon Mickaël Guêné * config/arm/arm-c.c (__FDPIC__): Define new pre-processor macro in FDPIC mode. * config/arm/arm-protos.h (arm_load_function_descriptor): Declare new function. * config/arm/arm.c (arm_option_override): Define pic register to FDPIC_REGNUM. (arm_function_ok_for_sibcall): Disable sibcall optimization if we have no decl or go through PLT. (arm_load_pic_register): Handle TARGET_FDPIC. (arm_is_segment_info_known): New function. (arm_pic_static_addr): Add support for FDPIC. (arm_load_function_descriptor): New function. (arm_assemble_integer): Add support for FDPIC. * config/arm/arm.h (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED): Define. (FDPIC_REGNUM): New define. * config/arm/arm.md (call): Add support for FDPIC. (call_value): Likewise. (*restore_pic_register_after_call): New pattern. (untyped_call): Disable if FDPIC. (untyped_return): Likewise. * config/arm/unspecs.md (UNSPEC_PIC_RESTORE): New. Change-Id: I8fb1a6b85ace672184013568c5d28fbda2f7fda4 -- 2.6.3 diff --git a/gcc/config/arm/arm-c.c b/gcc/config/arm/arm-c.c index 6e256ee..34695fa 100644 --- a/gcc/config/arm/arm-c.c +++ b/gcc/config/arm/arm-c.c @@ -203,6 +203,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 485bc68..272968a 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -139,6 +139,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 45abcd8..d9397b5 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3485,6 +3485,15 @@ arm_option_override (void) if (flag_pic && TARGET_VXWORKS_RTP) arm_pic_register = 9; + /* If in FDPIC mode then force arm_pic_register to be r9. */ + if (TARGET_FDPIC) + { + arm_pic_register = FDPIC_REGNUM; + if (! TARGET_ARM && ! TARGET_THUMB2) + sorry ("FDPIC mode is supported on architecture versions that " + "support ARM or Thumb-2 only."); + } + if (arm_pic_register_string != NULL) { int pic_register = decode_reg_name (arm_pic_register_string); @@ -7295,6 +7304,21 @@ arm_function_ok_for_sibcall (tree decl, tree exp) if (cfun->machine->sibcall_blocked) return false; + if (TARGET_FDPIC) + { + /* In FDPIC, never tailcall something for which we have no decl: + the target function could be in a different module, requiring + a different FDPIC register value. */ + if (decl == NULL) + return false; + + /* Don't tailcall if we go through the PLT since the FDPIC + register is then corrupted and we don't restore it after + static function calls. */ + if (!targetm.binds_local_p (decl)) + return false; + } + /* Never tailcall something if we are generating code for Thumb-1. */ if (TARGET_THUMB1) return false; @@ -7711,7 +7735,9 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED, rtx pic_reg) { rtx l1, labelno, pic_tmp, pic_rtx; - 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); @@ -7780,28 +7806,142 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED, rtx pic_reg) emit_use (pic_reg); } +/* Try to determine whether an object, referenced via ORIG, will be + placed in the text or data segment. This is used in FDPIC mode, to + decide which relocations to use when accessing ORIG. IS_READONLY + is set to true if ORIG is a read-only location, false otherwise. + Return true if we could determine the location of ORIG, false + otherwise. IS_READONLY is valid only when we return true. */ +static bool +arm_is_segment_info_known (rtx orig, bool *is_readonly) +{ + bool res = false; + + *is_readonly = false; + + if (GET_CODE (orig) == LABEL_REF) + { + res = true; + *is_readonly = true; + } + else if (SYMBOL_REF_P (orig)) + { + if (CONSTANT_POOL_ADDRESS_P (orig)) + { + res = true; + *is_readonly = true; + } + else if (SYMBOL_REF_LOCAL_P (orig) + && !SYMBOL_REF_EXTERNAL_P (orig) + && SYMBOL_REF_DECL (orig) + && (!DECL_P (SYMBOL_REF_DECL (orig)) + || !DECL_COMMON (SYMBOL_REF_DECL (orig)))) + { + tree decl = SYMBOL_REF_DECL (orig); + tree init = (TREE_CODE (decl) == VAR_DECL) + ? DECL_INITIAL (decl) : (TREE_CODE (decl) == CONSTRUCTOR) + ? decl : 0; + int reloc = 0; + bool named_section, readonly; + + if (init && init != error_mark_node) + reloc = compute_reloc_for_constant (init); + + named_section = TREE_CODE (decl) == VAR_DECL + && lookup_attribute ("section", DECL_ATTRIBUTES (decl)); + readonly = decl_readonly_section (decl, reloc); + + /* We don't know where the link script will put a named + section, so return false in such a case. */ + res = !named_section; + + if (!named_section) + *is_readonly = readonly; + } + else + { + /* We don't know. */ + res = false; + } + } + else + gcc_unreachable (); + + return res; +} + /* Generate code to load the address of a static var when flag_pic is set. */ static rtx_insn * arm_pic_static_addr (rtx orig, rtx reg) { rtx l1, labelno, offset_rtx; + rtx_insn *insn; gcc_assert (flag_pic); - /* We use an UNSPEC rather than a LABEL_REF because this label - never appears in the code stream. */ - labelno = GEN_INT (pic_labelno++); - l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - l1 = gen_rtx_CONST (VOIDmode, l1); + bool is_readonly = false; + bool info_known = false; - /* On the ARM the PC register contains 'dot + 8' at the time of the - addition, on the Thumb it is 'dot + 4'. */ - offset_rtx = plus_constant (Pmode, l1, TARGET_ARM ? 8 : 4); - offset_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, orig, offset_rtx), - UNSPEC_SYMBOL_OFFSET); - offset_rtx = gen_rtx_CONST (Pmode, offset_rtx); + if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && !SYMBOL_REF_FUNCTION_P (orig)) + info_known = arm_is_segment_info_known (orig, &is_readonly); - return emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, labelno)); + if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && !SYMBOL_REF_FUNCTION_P (orig) + && !info_known) + { + /* We don't know where orig is stored, so we have be + pessimistic and use a GOT relocation. */ + rtx pat; + rtx mem; + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + + pat = gen_calculate_pic_address (reg, pic_reg, orig); + + /* Make the MEM as close to a constant as possible. */ + mem = SET_SRC (pat); + gcc_assert (MEM_P (mem) && !MEM_VOLATILE_P (mem)); + MEM_READONLY_P (mem) = 1; + MEM_NOTRAP_P (mem) = 1; + + insn = emit_insn (pat); + } + else if (TARGET_FDPIC + && SYMBOL_REF_P (orig) + && (SYMBOL_REF_FUNCTION_P (orig) + || (info_known && !is_readonly))) + { + /* We use the GOTOFF relocation. */ + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + + rtx l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, orig), UNSPEC_PIC_SYM); + emit_insn (gen_movsi (reg, l1)); + insn = emit_insn (gen_addsi3 (reg, reg, pic_reg)); + } + else + { + /* Not FDPIC, not SYMBOL_REF_P or readonly: we can use + PC-relative access. */ + /* We use an UNSPEC rather than a LABEL_REF because this label + never appears in the code stream. */ + labelno = GEN_INT (pic_labelno++); + l1 = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + l1 = gen_rtx_CONST (VOIDmode, l1); + + /* On the ARM the PC register contains 'dot + 8' at the time of the + addition, on the Thumb it is 'dot + 4'. */ + offset_rtx = plus_constant (Pmode, l1, TARGET_ARM ? 8 : 4); + offset_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, orig, offset_rtx), + UNSPEC_SYMBOL_OFFSET); + offset_rtx = gen_rtx_CONST (Pmode, offset_rtx); + + insn = emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, + labelno)); + } + + return insn; } /* Return nonzero if X is valid as an ARM state addressing register. */ @@ -16112,9 +16252,36 @@ get_jump_table_size (rtx_jump_table_data *insn) return 0; } +/* Emit insns to load the function address from FUNCDESC (an FDPIC + function descriptor) into a register and the GOT address into the + FDPIC register, returning an rtx for the register holding the + function address. */ + +rtx +arm_load_function_descriptor (rtx funcdesc) +{ + rtx fnaddr_reg = gen_reg_rtx (Pmode); + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx fnaddr = gen_rtx_MEM (Pmode, funcdesc); + rtx gotaddr = gen_rtx_MEM (Pmode, plus_constant (Pmode, funcdesc, 4)); + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (3)); + + emit_move_insn (fnaddr_reg, fnaddr); + /* The ABI requires the entry point address to be loaded first, so + prevent the load from being moved after that of the GOT + address. */ + XVECEXP (par, 0, 0) = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (2, pic_reg, gotaddr), + UNSPEC_PIC_RESTORE); + XVECEXP (par, 0, 1) = gen_rtx_USE (VOIDmode, gotaddr); + XVECEXP (par, 0, 2) = gen_rtx_CLOBBER (VOIDmode, pic_reg); + emit_insn (par); + + return fnaddr_reg; +} + /* Return the maximum amount of padding that will be inserted before label LABEL. */ - static HOST_WIDE_INT get_label_padding (rtx label) { @@ -23069,9 +23236,37 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) && (!SYMBOL_REF_LOCAL_P (x) || (SYMBOL_REF_DECL (x) ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0)))) - fputs ("(GOT)", asm_out_file); + { + if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) + fputs ("(GOTFUNCDESC)", asm_out_file); + else + fputs ("(GOT)", asm_out_file); + } else - fputs ("(GOTOFF)", asm_out_file); + { + if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) + fputs ("(GOTOFFFUNCDESC)", asm_out_file); + else + { + bool is_readonly; + + if (arm_is_segment_info_known (x, &is_readonly)) + fputs ("(GOTOFF)", asm_out_file); + else + fputs ("(GOT)", asm_out_file); + } + } + } + + /* For FDPIC we also have to mark symbol for .data section. */ + if (TARGET_FDPIC + && NEED_GOT_RELOC + && flag_pic + && !making_const_table + && SYMBOL_REF_P (x)) + { + if (SYMBOL_REF_FUNCTION_P (x)) + fputs ("(FUNCDESC)", asm_out_file); } fputc ('\n', asm_out_file); return true; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 4866e1e..7b50ef5 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -892,6 +892,9 @@ extern int arm_arch_cmse; Pascal), so the following is not true. */ #define STATIC_CHAIN_REGNUM 12 +/* r9 is the FDPIC register (base register for GOT and FUNCDESC accesses). */ +#define FDPIC_REGNUM 9 + /* Define this to be where the real frame pointer is if it is not possible to work out the offset between the frame pointer and the automatic variables until after register allocation has taken place. FRAME_POINTER_REGNUM @@ -1948,6 +1951,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 0aecd03..9036255 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -8127,6 +8127,23 @@ rtx callee, pat; tree addr = MEM_EXPR (operands[0]); + /* Force FDPIC register (r9) before call. */ + if (TARGET_FDPIC) + { + /* No need to update r9 if calling a static function. + In other words: set r9 for indirect or non-local calls. */ + callee = XEXP (operands[0], 0); + if (!SYMBOL_REF_P (callee) + || !SYMBOL_REF_LOCAL_P (callee) + || arm_is_long_call_p (SYMBOL_REF_DECL (callee))) + { + emit_insn (gen_blockage ()); + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + emit_move_insn (pic_reg, get_hard_reg_initial_val (Pmode, FDPIC_REGNUM)); + emit_insn (gen_rtx_USE (VOIDmode, pic_reg)); + } + } + /* In an untyped call, we can get NULL for operand 2. */ if (operands[2] == NULL_RTX) operands[2] = const0_rtx; @@ -8140,6 +8157,13 @@ : !REG_P (callee)) XEXP (operands[0], 0) = force_reg (Pmode, callee); + if (TARGET_FDPIC && !SYMBOL_REF_P (XEXP (operands[0], 0))) + { + /* Indirect call: set r9 with FDPIC value of callee. */ + XEXP (operands[0], 0) + = arm_load_function_descriptor (XEXP (operands[0], 0)); + } + if (detect_cmse_nonsecure_call (addr)) { pat = gen_nonsecure_call_internal (operands[0], operands[1], @@ -8151,10 +8175,38 @@ pat = gen_call_internal (operands[0], operands[1], operands[2]); arm_emit_call_insn (pat, XEXP (operands[0], 0), false); } + + /* Restore FDPIC register (r9) after call. */ + if (TARGET_FDPIC) + { + /* No need to update r9 if calling a static function. */ + if (!SYMBOL_REF_P (callee) + || !SYMBOL_REF_LOCAL_P (callee) + || arm_is_long_call_p (SYMBOL_REF_DECL (callee))) + { + rtx pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + emit_move_insn (pic_reg, get_hard_reg_initial_val (Pmode, FDPIC_REGNUM)); + emit_insn (gen_rtx_USE (VOIDmode, pic_reg)); + emit_insn (gen_blockage ()); + } + } DONE; }" ) +(define_insn "*restore_pic_register_after_call" + [(parallel [(unspec [(match_operand:SI 0 "s_register_operand" "=r,r") + (match_operand:SI 1 "nonimmediate_operand" "r,m")] + UNSPEC_PIC_RESTORE) + (use (match_dup 1)) + (clobber (match_dup 0))]) + ] + "" + "@ + mov\t%0, %1 + ldr\t%0, %1" +) + (define_expand "call_internal" [(parallel [(call (match_operand 0 "memory_operand" "") (match_operand 1 "general_operand" "")) @@ -8215,6 +8267,30 @@ rtx pat, callee; tree addr = MEM_EXPR (operands[1]); + /* Force FDPIC register (r9) before call. */ + if (TARGET_FDPIC) + { + /* No need to update the FDPIC register (r9) if calling a static function. + In other words: set r9 for indirect or non-local calls. */ + callee = XEXP (operands[1], 0); + if (!SYMBOL_REF_P (callee) + || !SYMBOL_REF_LOCAL_P (callee) + || arm_is_long_call_p (SYMBOL_REF_DECL (callee))) + { + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (3)); + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg = + get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + XVECEXP (par, 0, 0) = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (2, fdpic_reg, initial_fdpic_reg), + UNSPEC_PIC_RESTORE); + XVECEXP (par, 0, 1) = gen_rtx_USE (VOIDmode, initial_fdpic_reg); + XVECEXP (par, 0, 2) = gen_rtx_CLOBBER (VOIDmode, fdpic_reg); + emit_insn (par); + } + } + /* In an untyped call, we can get NULL for operand 2. */ if (operands[3] == 0) operands[3] = const0_rtx; @@ -8228,6 +8304,14 @@ : !REG_P (callee)) XEXP (operands[1], 0) = force_reg (Pmode, callee); + if (TARGET_FDPIC + && !SYMBOL_REF_P (XEXP (operands[1], 0))) + { + /* Indirect call: set r9 with FDPIC value of callee. */ + XEXP (operands[1], 0) + = arm_load_function_descriptor (XEXP (operands[1], 0)); + } + if (detect_cmse_nonsecure_call (addr)) { pat = gen_nonsecure_call_value_internal (operands[0], operands[1], @@ -8240,6 +8324,28 @@ operands[2], operands[3]); arm_emit_call_insn (pat, XEXP (operands[1], 0), false); } + /* Restore FDPIC register (r9) after call. */ + if (TARGET_FDPIC) + { + /* No need to update r9 if calling a static function. */ + if (!SYMBOL_REF_P (callee) + || !SYMBOL_REF_LOCAL_P (callee) + || arm_is_long_call_p (SYMBOL_REF_DECL (callee))) + { + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (3)); + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg = + get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + XVECEXP (par, 0, 0) = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (2, fdpic_reg, initial_fdpic_reg), + UNSPEC_PIC_RESTORE); + XVECEXP (par, 0, 1) = gen_rtx_USE (VOIDmode, initial_fdpic_reg); + XVECEXP (par, 0, 2) = gen_rtx_CLOBBER (VOIDmode, fdpic_reg); + emit_insn (par); + } + } + DONE; }" ) @@ -8582,7 +8688,7 @@ (const_int 0)) (match_operand 1 "" "") (match_operand 2 "" "")])] - "TARGET_EITHER" + "TARGET_EITHER && !TARGET_FDPIC" " { int i; @@ -8649,7 +8755,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 174bcc5..bda35d5 100644 --- a/gcc/config/arm/unspecs.md +++ b/gcc/config/arm/unspecs.md @@ -89,6 +89,7 @@ UNSPEC_SP_SET ; Represent the setting of stack protector's canary UNSPEC_SP_TEST ; Represent the testing of stack protector's canary ; against the guard. + UNSPEC_PIC_RESTORE ; Use to restore fdpic register ]) (define_c_enum "unspec" [ From patchwork Wed May 15 12:39:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164280 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp603393oca; Wed, 15 May 2019 05:42:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyED/pbEwHsEfbKfg+JGiR+kBbIToVrWNIWG7S6OoCXfq1qhwuOnPsyzNaMOjBETh/RGoZl X-Received: by 2002:a63:2d87:: with SMTP id t129mr43998453pgt.451.1557924130991; Wed, 15 May 2019 05:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924130; cv=none; d=google.com; s=arc-20160816; b=IDnoWXlOijt3S+QAEDK5qI9mqTKSjHEXDPLtbUC7vIMsrgS+0R1V5tn6sbzV297BL1 cd8bvMB8z8ZjiOF65y+74UiBnn/iNQOz/j3Tsk9Hr0lg6yVtItuNKuMOCR62TO4WRAbR PiWhEGY5mrjptkNoVyGWJGOMPxxDD1m1k+tJgbTiYbJE6/bw+5p7nC5BEUCheDOLRsbi CUgbjP46JXoLbwkYKeH2Y8ePmPRtTuYKaBx6mI0gnmB69SoAusF2YDiy2F+Cch7vUm31 VXzGkcoJoFINnVRy0Fz7wEEzJiGRSTtOOP+0K5Zhyf/CEMKG1VBD9+3rWJQpGUj7GwV9 yXeQ== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=ODXjMO45F6yf0qYZ0QWTkk4SOuzykAzSlWGudMGYlfM=; b=06f2P/yyg9tSDyFZKO72Uuh3hzdGDxU77UL23oRGbdpkvM+F4++L4lRqU/y47Cfdfm 0D03+WKzlp+vfgRm6YHpokfPPC8KA2QtlXBAulsro7++OswTi+lSXAfQc4+YVj/z+yTT M6V9rOqN5YabZ0T25I8dVrSDh6g5XM4C78QKpdR9Ss9sBOmX295WeWBKf6IWZKYuiGmb PJlSbzS59a2O04l7fLooJRebJZuVjzD1WcxfvQZ551xTEbm2CktHUS5KDo8RCgt9IPGL 7e/bvti7OHD+HOGuK2IZV/OMOkb/tH1pkCgoNhvldA1LjtSFKeIDfvpQZbCHfY8l+A51 ++eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=s8WokRKo; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="bZKwGu/u"; spf=pass (google.com: domain of gcc-patches-return-500769-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500769-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 p10si1656842plr.137.2019.05.15.05.42.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:42:10 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500769-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=s8WokRKo; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="bZKwGu/u"; spf=pass (google.com: domain of gcc-patches-return-500769-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500769-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=yaE HTwdmTXyuPaTAIBhoqE2A+K6JdAsIkIO9eoWC2k3by3+ci1Z96I5Wbdx+VUEVb02 TnG42/dsglJWfV22XoyQzDLcYT8h/pvTRYSARtOlGP/7MJfF8zu2CrAgud9uofJj HgS/VbT9JHUEhhu5b55XbmmPHRjNfP0h4sVrWhaM= 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=9QwoZYdYQ Kq2Tn5rp0H1+A9cfk4=; b=s8WokRKoX5rfK4kaFxDMDMl4QCYvShigvgR4/x0/Z 960p6HErJfDQ8lJo7bNrh8r1mWqXEt85VDW7jBZoYLXFxb8Kai5++5XFxiCLOTdk A64eEo87t8yPpqJkcgNa1AlmhPbP5SoOXjZGvZ/kaW6smf28JAmm/+DTqU9w4EX/ AY= Received: (qmail 26124 invoked by alias); 15 May 2019 12:41:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 25734 invoked by uid 89); 15 May 2019 12:41:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.2 required=5.0 tests=AWL, 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.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 May 2019 12:41:58 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCaWDa006112 for ; Wed, 15 May 2019 14:41:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=ODXjMO45F6yf0qYZ0QWTkk4SOuzykAzSlWGudMGYlfM=; b=bZKwGu/uuKpFOePMwLDBgGI9NFz3sE9IkoB5+2Q3WLQ/57yDF9dlC4J8+H2Mz51G2/vB qjBbPrVAqCX8M1VSAabO4r/vZvuNZycWWrC4eC58GYRq7vh4MAGjeihz8grvEfleniEp 4cMHTnm+NJCFuI43HZKFZXPAVm0DP+VdzybfYL0Rl9myjwasW1/6j8H27NcfSdIY67HW NRKCmh+QRbrMrz9mTD1Dfg9vWRmHj7/0QXfPoAMyUtoQJLzcwIhPMsg7xLaaYxBkrlVt 9E3PzdfNjLG87rdvi1KkfQ8ftFY+EOK/kgyL6am/3W+txRa72Be4hI5O9uNViQHlbSII eQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sg0an6b2b-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:41: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 A523034 for ; Wed, 15 May 2019 12:41: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 955402756 for ; Wed, 15 May 2019 12:41:55 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:41:54 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 05/21] [ARM] FDPIC: Fix __do_global_dtors_aux and frame_dummy generation Date: Wed, 15 May 2019 14:39:30 +0200 Message-ID: <20190515124006.25840-6-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes In FDPIC, we need to make sure __do_global_dtors_aux and frame_dummy are referenced by their address, not by pointers to the function descriptors. 2019-XX-XX Christophe Lyon Mickaël Guêné * libgcc/crtstuff.c: Add support for FDPIC. Change-Id: I0bc4b1232fbf3c69068fb23a1b9cafc895d141b1 -- 2.6.3 diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c index 4927a9f..159b461 100644 --- a/libgcc/crtstuff.c +++ b/libgcc/crtstuff.c @@ -429,9 +429,18 @@ __do_global_dtors_aux (void) #ifdef FINI_SECTION_ASM_OP CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux) #elif defined (FINI_ARRAY_SECTION_ASM_OP) +#if defined(__FDPIC__) +__asm__( + " .section .fini_array\n" + " .align 2\n" + " .word __do_global_dtors_aux\n" +); +asm (TEXT_SECTION_ASM_OP); +#else /* defined(__FDPIC__) */ static func_ptr __do_global_dtors_aux_fini_array_entry[] __attribute__ ((__used__, section(".fini_array"), aligned(sizeof(func_ptr)))) = { __do_global_dtors_aux }; +#endif /* defined(__FDPIC__) */ #else /* !FINI_SECTION_ASM_OP && !FINI_ARRAY_SECTION_ASM_OP */ static void __attribute__((used)) __do_global_dtors_aux_1 (void) @@ -473,9 +482,18 @@ frame_dummy (void) #ifdef __LIBGCC_INIT_SECTION_ASM_OP__ CRT_CALL_STATIC_FUNCTION (__LIBGCC_INIT_SECTION_ASM_OP__, frame_dummy) #else /* defined(__LIBGCC_INIT_SECTION_ASM_OP__) */ +#if defined(__FDPIC__) +__asm__( + " .section .init_array\n" + " .align 2\n" + " .word frame_dummy\n" +); +asm (TEXT_SECTION_ASM_OP); +#else /* defined(__FDPIC__) */ static func_ptr __frame_dummy_init_array_entry[] __attribute__ ((__used__, section(".init_array"), aligned(sizeof(func_ptr)))) = { frame_dummy }; +#endif /* defined(__FDPIC__) */ #endif /* !defined(__LIBGCC_INIT_SECTION_ASM_OP__) */ #endif /* USE_EH_FRAME_REGISTRY || USE_TM_CLONE_REGISTRY */ From patchwork Wed May 15 12:39:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164281 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp603801oca; Wed, 15 May 2019 05:42:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqypkf312D6BknX7ss0ghk3fsnIBTeDeHVTRF3SSU+6NiRCYqYZR5ACOsOaXybnlBHKz5ccu X-Received: by 2002:a17:902:765:: with SMTP id 92mr42729451pli.196.1557924155409; Wed, 15 May 2019 05:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924155; cv=none; d=google.com; s=arc-20160816; b=GDjJ0hYOtptioHVoueHLotWvSHmed8c86ln6KCM4ptQRMGoU7eA9Drwrcora753NUO w4KbZFCHk08pw1w/XZjEsFV2lv6D2xTM25wUpoo8RKZfp6DFxIMdZB/uNfHCKSe8g/Nw sr+v12FZVlz9KtbxCJeeVzemZ32P6LgfUYI377M7Wew5f712p+pUUCorkFxbz1mYBfzx afLAW2VD3H6Qpzm4tsV8y3nsbRiCd1tazrG1/O5TEeRd4nEn0RwcEgUP4qOBoXTiKQ8V vf8QEvpVppbGY/uwc0CV6Isya371t6dXuCBdchYnRwds8cwASzVc/USgVplvABiCHWDh lEBg== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=EvU+oFV912e8mMG/11WMETsbECp1/81N3YYZduqpZ0Q=; b=NlcXJ7OePdDMdF0NGq6uPQYAB+OrpXg3ODYSJ2KlZTPZ0PqczFVQtvqRvhc8hZYi8m 3mLH544HDlCu8YJ9AMY7o56ZsNJb/YiFCXnNKg0DvvbQAAaytRhqc0thrEqN/5ULYjYg KhVb12sJxNWl4BvRBPedMOfD/yiTFzbxRU0RnRxA0zZBl/CGNWGHf4DKe07FiWGlltX2 ulBAGHIWRbqQMyBpUx5Oh5mGWSsRKUxzkKIxOYOnkkfwBFqjXT5R5LuXYaQ1zW57woHs GVMKDEI2N9Kt3YEBrMOgANiXEtnSitdp/bxrAVb0+6GL4GHVuU1ogf+uMous2Ei3LmLr 9olQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=J9XsgfxR; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=EDSfndJ7; spf=pass (google.com: domain of gcc-patches-return-500770-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500770-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 z11si1785001pgv.333.2019.05.15.05.42.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:42:35 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500770-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=J9XsgfxR; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=EDSfndJ7; spf=pass (google.com: domain of gcc-patches-return-500770-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500770-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=k17 rT6PS+rlLuajpn6luqt5Wh7nS13gbfolkWCyS/inMdkPI8kMH6NzRez7DDVe/UHp MdH5GuAWSOBux8IFae63eFFVSmqbrdWh3qKwIr/PdM+JEP8lSUIvZEUXKQY9KhHf UIhR1LnjdcNNU2WHKjvFCR9w2lRCppUlK5EszGQQ= 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=LNWGZvc43 cqJgxTopFE3AtrPLkQ=; b=J9XsgfxRrsOYztkfRoM5XupVuyzv4CKgOCSqB6BMC 93PcUjb6z0zCmKcUJST8X6r4rqG4AmR3KHiN5WNECahYv4alQRz+a3JjALC6pC5c /aDZx5z5v+Y1GcxPPczHhJY4Mue09Y+Ymezu79Y1m8tm6YZzkKWXwDMGyjeFaEsf 5I= Received: (qmail 58025 invoked by alias); 15 May 2019 12:42:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 56020 invoked by uid 89); 15 May 2019 12:42:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.3 required=5.0 tests=AWL, 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.1 spammy=pad 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; Wed, 15 May 2019 12:42:18 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCg5XB010209 for ; Wed, 15 May 2019 14:42:16 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=EvU+oFV912e8mMG/11WMETsbECp1/81N3YYZduqpZ0Q=; b=EDSfndJ7kus8kHv6bvKtK31WW+skSdk66QHfxIQOFcl9vYPAwAOuXvBpsX294AeF3QWJ +/Yu2EsDxkhPoYFzg6ItpyDIGeAZPaEblKkHA6p204aFQ5tHPblUWPug4tH+OzOVHQk5 Etjc8I816KzUaBfQ0Ti5IGc0hwtElPSdipnNaLOIhR6Xif3srDq7AjJ7CG4OVz3RaARB qYPLaEjy+nRDTjD966ba4ZlTzM4qMN52DHepj0dhVkWlxNmUO5Hor/h7e7dixfJmMf7R YJVW/BfUbog1ffU9+Smq526T5S794rHlCBrrVqUjVrJ/ZcFnkdebMjVp0OQ+NRlAfO6B IA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sg0an6b4c-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:42: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 EF16638 for ; Wed, 15 May 2019 12:42: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 DAB2A2758 for ; Wed, 15 May 2019 12:42:15 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:42:15 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 06/21] [ARM] FDPIC: Add support for c++ exceptions Date: Wed, 15 May 2019 14:39:31 +0200 Message-ID: <20190515124006.25840-7-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes The main difference with existing support is that function addresses are function descriptor addresses instead. This means that all code dealing with function pointers now has to cope with function descriptors instead. For the same reason, Linux kernel helpers can no longer be called by dereferencing their address, so we implement wrappers that directly call the kernel helpers. When restoring a function address, we also have to restore the FDPIC register value (r9). 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * ginclude/unwind-arm-common.h (unwinder_cache): Add reserved5 field. (FDPIC_REGNUM): New define. libgcc/ * config/arm/linux-atomic.c (__kernel_cmpxchg): Add FDPIC support. (__kernel_dmb): Likewise. (__fdpic_cmpxchg): New function. (__fdpic_dmb): New function. * config/arm/unwind-arm.h (FDPIC_REGNUM): New define. (gnu_Unwind_Find_got): New function. (_Unwind_decode_typeinfo_ptr): Add FDPIC support. * unwind-arm-common.inc (UCB_PR_GOT): New. (funcdesc_t): New struct. (get_eit_entry): Add FDPIC support. (unwind_phase2): Likewise. (unwind_phase2_forced): Likewise. (__gnu_Unwind_RaiseException): Likewise. (__gnu_Unwind_Resume): Likewise. (__gnu_Unwind_Backtrace): Likewise. * unwind-pe.h (read_encoded_value_with_base): Likewise. libstdc++/ * libsupc++/eh_personality.cc (get_ttype_entry): Add FDPIC support. Change-Id: I64b81cfaf390a05f2fd121f44ba1912cb4b47cae -- 2.6.3 diff --git a/gcc/ginclude/unwind-arm-common.h b/gcc/ginclude/unwind-arm-common.h index 6df783e..d4eb03e 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 06a6d46..565f829 100644 --- a/libgcc/config/arm/linux-atomic.c +++ b/libgcc/config/arm/linux-atomic.c @@ -25,11 +25,62 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* Kernel helper for compare-and-exchange. */ typedef int (__kernel_cmpxchg_t) (int oldval, int newval, int *ptr); -#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) 0xffff0fc0) + +#define STR(X) #X +#define XSTR(X) STR(X) + +#define KERNEL_CMPXCHG 0xffff0fc0 + +#if __FDPIC__ +/* Non-FDPIC ABIs call __kernel_cmpxchg directly by dereferencing its + address, but under FDPIC we would generate a broken call + sequence. That's why we have to implement __kernel_cmpxchg and + __kernel_dmb here: this way, the FDPIC call sequence works. */ +#define __kernel_cmpxchg __fdpic_cmpxchg +#else +#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *) KERNEL_CMPXCHG) +#endif /* Kernel helper for memory barrier. */ typedef void (__kernel_dmb_t) (void); -#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0) + +#define KERNEL_DMB 0xffff0fa0 + +#if __FDPIC__ +#define __kernel_dmb __fdpic_dmb +#else +#define __kernel_dmb (*(__kernel_dmb_t *) KERNEL_DMB) +#endif + +#if __FDPIC__ +static int __fdpic_cmpxchg (int oldval, int newval, int *ptr) +{ + int result; + + asm volatile ( + "ldr ip, 1f\n\t" + "bx ip\n\t" + "1:\n\t" + ".word " XSTR(KERNEL_CMPXCHG) "\n\t" + : "=r" (result) + : "r" (oldval) , "r" (newval), "r" (ptr) + : "r3", "memory"); + /* The result is actually returned by the kernel helper, we need + this to avoid a warning. */ + return result; +} + +static void __fdpic_dmb (void) +{ + asm volatile ( + "ldr ip, 1f\n\t" + "bx ip\n\t" + "1:\n\t" + ".word " XSTR(KERNEL_DMB) "\n\t" + ); +} + +#endif /* Note: we implement byte, short and int versions of atomic operations using the above kernel helpers; see linux-atomic-64bit.c for "long long" (64-bit) diff --git a/libgcc/config/arm/unwind-arm.h b/libgcc/config/arm/unwind-arm.h index 43c5379..2bf320a 100644 --- a/libgcc/config/arm/unwind-arm.h +++ b/libgcc/config/arm/unwind-arm.h @@ -33,9 +33,33 @@ /* Use IP as a scratch register within the personality routine. */ #define UNWIND_POINTER_REG 12 +#define FDPIC_REGNUM 9 + +#define STR(x) #x +#define XSTR(x) STR(x) + #ifdef __cplusplus extern "C" { #endif +_Unwind_Ptr __attribute__((weak)) __gnu_Unwind_Find_got (_Unwind_Ptr); + +static inline _Unwind_Ptr gnu_Unwind_Find_got (_Unwind_Ptr ptr) +{ + _Unwind_Ptr res; + + if (__gnu_Unwind_Find_got) + res = __gnu_Unwind_Find_got (ptr); + else + { + asm volatile ("mov %[result], r" XSTR(FDPIC_REGNUM) + : [result]"=r" (res) + : + :); + } + + return res; +} + /* Decode an R_ARM_TARGET2 relocation. */ static inline _Unwind_Word _Unwind_decode_typeinfo_ptr (_Unwind_Word base __attribute__ ((unused)), @@ -48,7 +72,12 @@ extern "C" { if (!tmp) return 0; -#if (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__) \ +#if __FDPIC__ + /* For FDPIC, we store the offset of the GOT entry. */ + /* So, first get GOT from dynamic linker and then use indirect access. */ + tmp += gnu_Unwind_Find_got (ptr); + tmp = *(_Unwind_Word *) tmp; +#elif (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__) \ || defined(__FreeBSD__) || defined(__fuchsia__) /* Pc-relative indirect. */ #define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_pcrel | DW_EH_PE_indirect) diff --git a/libgcc/unwind-arm-common.inc b/libgcc/unwind-arm-common.inc index fd572fe..0bacc11 100644 --- a/libgcc/unwind-arm-common.inc +++ b/libgcc/unwind-arm-common.inc @@ -62,6 +62,7 @@ __gnu_Unwind_Find_exidx (_Unwind_Ptr, int *); #define UCB_PR_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved2) #define UCB_SAVED_CALLSITE_ADDR(ucbp) ((ucbp)->unwinder_cache.reserved3) #define UCB_FORCED_STOP_ARG(ucbp) ((ucbp)->unwinder_cache.reserved4) +#define UCB_PR_GOT(ucbp) ((ucbp)->unwinder_cache.reserved5) /* Unwind descriptors. */ @@ -85,6 +86,16 @@ typedef struct __EIT_entry _uw content; } __EIT_entry; +#ifdef __FDPIC__ + +/* Only used in FDPIC case. */ +struct funcdesc_t +{ + unsigned int ptr; + unsigned int got; +}; +#endif + /* Assembly helper functions. */ /* Restore core register state. Never returns. */ @@ -259,7 +270,21 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) { /* One of the predefined standard routines. */ _uw idx = (*(_uw *) ucbp->pr_cache.ehtp >> 24) & 0xf; +#if __FDPIC__ + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) __gnu_unwind_get_pr_addr (idx); + if (funcdesc) + { + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + } + else + UCB_PR_ADDR (ucbp) = 0; + } +#else UCB_PR_ADDR (ucbp) = __gnu_unwind_get_pr_addr (idx); +#endif if (UCB_PR_ADDR (ucbp) == 0) { /* Failed */ @@ -270,6 +295,10 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) { /* Execute region offset to PR */ UCB_PR_ADDR (ucbp) = selfrel_offset31 (ucbp->pr_cache.ehtp); +#if __FDPIC__ + UCB_PR_GOT (ucbp) + = (unsigned int) gnu_Unwind_Find_got ((_Unwind_Ptr) UCB_PR_ADDR (ucbp)); +#endif } return _URC_OK; } @@ -291,14 +320,29 @@ unwind_phase2 (_Unwind_Control_Block * ucbp, phase2_vrs * vrs) UCB_SAVED_CALLSITE_ADDR (ucbp) = VRS_PC(vrs); /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_UNWIND_FRAME_STARTING, ucbp, (_Unwind_Context *) vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_UNWIND_FRAME_STARTING, ucbp, (_Unwind_Context *) vrs); +#endif } while (pr_result == _URC_CONTINUE_UNWIND); if (pr_result != _URC_INSTALL_CONTEXT) abort(); +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + vrs->core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (vrs)); +#endif + uw_restore_core_regs (vrs, &vrs->core); } @@ -346,8 +390,18 @@ unwind_phase2_forced (_Unwind_Control_Block *ucbp, phase2_vrs *entry_vrs, next_vrs = saved_vrs; /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (action, ucbp, (void *) &next_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (action, ucbp, (void *) &next_vrs); +#endif saved_vrs.prev_sp = VRS_SP (&next_vrs); } @@ -384,6 +438,11 @@ unwind_phase2_forced (_Unwind_Control_Block *ucbp, phase2_vrs *entry_vrs, return _URC_FAILURE; } +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + saved_vrs.core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (&saved_vrs)); +#endif + uw_restore_core_regs (&saved_vrs, &saved_vrs.core); } @@ -429,8 +488,18 @@ __gnu_Unwind_RaiseException (_Unwind_Control_Block * ucbp, return _URC_FAILURE; /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_VIRTUAL_UNWIND_FRAME, ucbp, (void *) &saved_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_VIRTUAL_UNWIND_FRAME, ucbp, (void *) &saved_vrs); +#endif } while (pr_result == _URC_CONTINUE_UNWIND); @@ -488,13 +557,27 @@ __gnu_Unwind_Resume (_Unwind_Control_Block * ucbp, phase2_vrs * entry_vrs) } /* Call the cached PR. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + pr_result = ((personality_routine) &funcdesc) + (_US_UNWIND_FRAME_RESUME, ucbp, (_Unwind_Context *) entry_vrs); + } +#else pr_result = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_UNWIND_FRAME_RESUME, ucbp, (_Unwind_Context *) entry_vrs); +#endif switch (pr_result) { case _URC_INSTALL_CONTEXT: /* Upload the registers to enter the landing pad. */ +#if __FDPIC__ + /* r9 could have been lost due to PLT jump. Restore correct value. */ + entry_vrs->core.r[FDPIC_REGNUM] = gnu_Unwind_Find_got (VRS_PC (entry_vrs)); +#endif uw_restore_core_regs (entry_vrs, &entry_vrs->core); case _URC_CONTINUE_UNWIND: @@ -586,9 +669,20 @@ __gnu_Unwind_Backtrace(_Unwind_Trace_Fn trace, void * trace_argument, } /* Call the pr to decide what to do. */ +#if __FDPIC__ + { + volatile struct funcdesc_t funcdesc; + funcdesc.ptr = UCB_PR_ADDR (ucbp); + funcdesc.got = UCB_PR_GOT (ucbp); + code = ((personality_routine) &funcdesc) + (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND, + ucbp, (void *) &saved_vrs); + } +#else code = ((personality_routine) UCB_PR_ADDR (ucbp)) (_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND, ucbp, (void *) &saved_vrs); +#endif } while (code != _URC_END_OF_STACK && code != _URC_FAILURE); diff --git a/libgcc/unwind-pe.h b/libgcc/unwind-pe.h index 4ed1c66..1c9dae5 100644 --- a/libgcc/unwind-pe.h +++ b/libgcc/unwind-pe.h @@ -262,10 +262,27 @@ read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base, if (result != 0) { +#if __FDPIC__ + /* FDPIC relative addresses imply taking the GOT address + into account. */ + if ((encoding & DW_EH_PE_pcrel) && (encoding & DW_EH_PE_indirect)) + { + result += gnu_Unwind_Find_got ((_Unwind_Ptr) u); + result = *(_Unwind_Internal_Ptr *) result; + } + else + { + result += ((encoding & 0x70) == DW_EH_PE_pcrel + ? (_Unwind_Internal_Ptr) u : base); + if (encoding & DW_EH_PE_indirect) + result = *(_Unwind_Internal_Ptr *) result; + } +#else result += ((encoding & 0x70) == DW_EH_PE_pcrel ? (_Unwind_Internal_Ptr) u : base); if (encoding & DW_EH_PE_indirect) result = *(_Unwind_Internal_Ptr *) result; +#endif } } diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc index 35e4e46..1528ab9 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -93,7 +93,15 @@ get_ttype_entry (lsda_header_info *info, _uleb128_t i) _Unwind_Ptr ptr; i *= size_of_encoded_value (info->ttype_encoding); - read_encoded_value_with_base (info->ttype_encoding, info->ttype_base, + read_encoded_value_with_base ( +#if __FDPIC__ + /* Force these flags to nake sure to + take the GOT into account. */ + (DW_EH_PE_pcrel | DW_EH_PE_indirect), +#else + info->ttype_encoding, +#endif + info->ttype_base, info->TType - i, &ptr); return reinterpret_cast(ptr); From patchwork Wed May 15 12:39:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164282 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp604015oca; Wed, 15 May 2019 05:42:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxY1RU7CsT+z4VrP54HRLr1YeRfvVN8ddIIZ2T5p9M3lf/6UH1LcjtiLlOjqPAP9cMYUWJ2 X-Received: by 2002:a17:902:ab98:: with SMTP id f24mr42659806plr.223.1557924171425; Wed, 15 May 2019 05:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924171; cv=none; d=google.com; s=arc-20160816; b=JkY3COYATJMn32mWXg00JWQrquPAtN8vOnyBWEULhfZ/JvKpRBkKdtVS3zSmTaPHVV DNJfZBlTZbQs/giu8yY51OAlcuxm8H/T066TvbXuDQl8T0uA/qUwTsxi1qa69i+E/1yZ 3C4wUipYlrcVU9oVFukh8Lr2fPDY+Kex/fNRIZQnGdamDg8WE3hLQEGY4A5o8ssO2xdU TZmVmEH3l+uz8p8IVvZvMapf8dY3Zk6K76/XDAYI3todT8n5aOGc/eJK4dh5ElqhEo7T 0abLoF2+id1eQW43wjDYLOwznC9Hf+izQEIussjUY2t7hO7wo4V+UKYVplMNSpCQKTOO p/nQ== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=a5TMQAnew7zN/mIlQfeVb+dddY5xvbZ4gU0Eq5Morb0=; b=MSrPPrj/yVTwmDUq3/iGkAJXztfChkpZmmVwzrpVuUskzyjjznVbmqJEkIhfQt/94M ykAjqdaDfd5CHLaS6nafXVyr073s5kZPDjzU+HWsiCF1j1h5RByzEdrA+EyDYu2ObWQ5 KqD+xpE8tejuJX3UuOslpGmBqFLkizzd/DFq8Em4BaqU9VpMbcwI8ki+HQU7EVGewoxg BUgmqh2b14sbRqlo7cXyH0eKk1f27273l4OlL3EDyz/GHv72G1+McC8NyTq8GH3JQ6xK /BglkI5c2UCZ4VawN4Xo/x145HVoAGAHsAv86iU9jZuHWr415jb0PNjqvek5Ec8YM5aU q2dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Kw+ZwWAO; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=FgckDIGN; spf=pass (google.com: domain of gcc-patches-return-500771-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500771-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 d34si1869801pgd.558.2019.05.15.05.42.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:42:51 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500771-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=Kw+ZwWAO; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=FgckDIGN; spf=pass (google.com: domain of gcc-patches-return-500771-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500771-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=AB9 9bGjkj0gK8EfFF5hPeR9Gyt4lzoxGZpnxvi01xl4cf/nq0LUEzcFKOJZtfxviPxC 0GnY2WiSOF/GKpT3hT2LK/a0dMu2rPEGsJdszt6AYgkj7C2dstcp5IOYSdeQo+wt E3O0J+oAnyLojE1H5btM3EwOCWsxTK3/9T3mw2JI= 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=CyrwNDF8f 3G0jvM3rQGiXKvkHPg=; b=Kw+ZwWAO9+U40o5Y0A+o26s2nlgMVHJKdRawuB2BP tJ19VuzYgpNy6YUUd04hogcfOefyB+AxbMOawUjCnknV4ksmuihyCac2L11XFhVV Bx1O+0ceHHnxxcHeyWSneTtk3opUIu/wj/wp4TsYrW9NWkCS8jQLaP8bCyfdRLlN LY= Received: (qmail 76690 invoked by alias); 15 May 2019 12:42:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 76303 invoked by uid 89); 15 May 2019 12:42:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.5 required=5.0 tests=AWL, 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.1 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; Wed, 15 May 2019 12:42:38 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCfqRs022149 for ; Wed, 15 May 2019 14:42:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=a5TMQAnew7zN/mIlQfeVb+dddY5xvbZ4gU0Eq5Morb0=; b=FgckDIGNGPQKa14Lok3dKHErWN7weCYRqX2pjP6GKK8R2lWixDX3znxtwuZrjCSOyejL 2byymDHz+OWwSq0VV5B2ZeuhX709UxA5xX0OeCA/tQ6fpy18MWXDUG+0DKCos0hIPOBS 9kNjO/shC3kWyRk6LpMG8Ko+08+1vv8dR/quYsScWHARlO/aZeg3XN91jnwmhqwHzJ9V EY1Y2wjhxNfQBGA6NS89b2gEu7PyTjhnc3VDdswfa9wG3aeOWxo5CJCpkrFuC8H4dziY og1zLEkXoLCqk0nHgU4wuj5Hm+1Fo4OMIrfFNPfttlJUDtt8HuaDWThvadyzz2zECD5K Nw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sek5ajrc4-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:42: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 2AA7938 for ; Wed, 15 May 2019 12:42:36 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 19BCD2757 for ; Wed, 15 May 2019 12:42:36 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:42:35 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 07/21] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is read-only Date: Wed, 15 May 2019 14:39:32 +0200 Message-ID: <20190515124006.25840-8-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.h (PIC_REGISTER_MAY_NEED_SAVING): New helper. * config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Handle FDPIC. Change-Id: I0f3b2023ab2a2a0433dfe081dac6bbb194b7a76c -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index d9397b5..dbd1671 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -19651,9 +19651,7 @@ arm_compute_save_reg0_reg12_mask (void) save_reg_mask |= (1 << reg); /* Also save the pic base register if necessary. */ - if (flag_pic - && !TARGET_SINGLE_PIC_BASE - && arm_pic_register != INVALID_REGNUM + if (PIC_REGISTER_MAY_NEED_SAVING && crtl->uses_pic_offset_table) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; } @@ -19685,9 +19683,7 @@ arm_compute_save_reg0_reg12_mask (void) /* If we aren't loading the PIC register, don't stack it even though it may be live. */ - if (flag_pic - && !TARGET_SINGLE_PIC_BASE - && arm_pic_register != INVALID_REGNUM + if (PIC_REGISTER_MAY_NEED_SAVING && (df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM) || crtl->uses_pic_offset_table)) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 7b50ef5..45c0e2b 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1967,6 +1967,13 @@ extern unsigned arm_pic_register; || label_mentioned_p (get_pool_constant (X))))) \ || tls_mentioned_p (X)) +/* We may want to save the PIC register if it is a dedicated one. */ +#define PIC_REGISTER_MAY_NEED_SAVING \ + (flag_pic \ + && !TARGET_SINGLE_PIC_BASE \ + && !TARGET_FDPIC \ + && arm_pic_register != INVALID_REGNUM) + /* We need to know when we are making a constant pool; this determines whether data needs to be in the GOT or can be referenced via a GOT offset. */ From patchwork Wed May 15 12:39:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164283 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp604341oca; Wed, 15 May 2019 05:43:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgj3TOswrl+b6ZT9DhVNt5awZpAljDdLriR0IK4ywoa9BCMbO5Ap750ogZKPZ7J7ghNel1 X-Received: by 2002:a63:2d87:: with SMTP id t129mr44002605pgt.451.1557924192439; Wed, 15 May 2019 05:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924192; cv=none; d=google.com; s=arc-20160816; b=yQ2YoUiW9kWBHaILBrg7RG6ZjDRIpsYgEZ06IzD6e/8cPWZk/PRpitoLxAHMXJPNF7 lzCVI5BXSdJabuf3eu127o4W1nQeGSuL4UDbGC46Y5Zcy0O77nlBU71pLO3JMEXdrsLp xRAUgbP6AooIysek4MLohDgLpVYWfwnO2Kj7SWti8+wqqPIICfBv/6xlV30BX5BPC9fS 2tRnKa6v05ZpNXUUBZZ4CXvQylQwb6JT2Q2S1Apz6iGNhTaxBAoLGV9Pq2BfArVWLncB JPd8iM1k6iGTt3a51Lgtxr61vZBl/YEsY1MY9efHbHfBC8NM/Zkg6oANrR9qzDDWtExi FixA== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=BMTckNDoV46DueOljhQlv5aHn9JSttvpvrHmHcbQBPQ=; b=yMh2OQ09TLQ0NXvpJVwBIgX0vpQJy3stxUPwnNEiGTQOkLyffj0204M8w0QdDcrjzt fdCDTbgL/GXChoFmM6Yd4xYYxThS9HSTbSq/kEr23NDuchoMppiDIwbvKI9v1nbVsvA+ bmZGgyYIm6T7kvC0GAzE9DCEkR3xPCU9VRbxRxzLYiygcDru7c0xsHMVDFcckUQN2myJ Ej/4EdGk2GuAGw1ZnCTNYoZRv2PQC0gDK/icp2tMDDkQ7Ld6oHWRh6ign+n6+arbwPR+ pUWCaqJiVV2qZ3ZOYuQ1LG+N2lT5dFCj91NFyFzhIg+hw8Q8AVqF0Z/oOstzoqjThsC3 ui0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=oupLSSgv; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="Dm/xdNSo"; spf=pass (google.com: domain of gcc-patches-return-500772-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500772-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 c6si2058982pfc.235.2019.05.15.05.43.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:43:12 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500772-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=oupLSSgv; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="Dm/xdNSo"; spf=pass (google.com: domain of gcc-patches-return-500772-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500772-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=n7S /NLCtjfmz9vcB3NoK2P/q2XWcu6AMW331BdeGxOEubZa/K4NFAPZEskv9trzyxHx GuPstmCyn5hSyEcnPyYFn798hOPugvzOAhxYVny/ccdvR0d+TODkPVanxNE6LimK w8mfvyyhAlKQkB4PvwqGKR5npkrB25iryLrHsGpA= 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=BFSOT2KSj 673nflUDqP8x/ZB1XY=; b=oupLSSgvxerq1oy5M6L43zmLydoXrKW/qLQEzYU3k oEUD6Tv5ERM3Ag49m1S4+KdeoUdKHUcDLCcz+61aaAW94ZM86y2E4iP7PHvBvDyw E6rnciC94FoNRglhghAMHrdkyThs4WL1wGmYaODw9aTZ7EkvQeTqwgk53A21o9rB H0= Received: (qmail 106340 invoked by alias); 15 May 2019 12:43:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 106002 invoked by uid 89); 15 May 2019 12:43:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.8 required=5.0 tests=AWL, 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.1 spammy=uniqueness, Private 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; Wed, 15 May 2019 12:42:59 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCgG4k014526 for ; Wed, 15 May 2019 14:42:57 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=BMTckNDoV46DueOljhQlv5aHn9JSttvpvrHmHcbQBPQ=; b=Dm/xdNSoLS6xXKpm4+dxIn/0S6LeIt6zuHA4eAtzpBw6IAAnVyAS+xAK/hwsy1WT8vW2 M8snCC6+L8d7jddY7Zg0flsPOl/zmzEkwncLHewDN7tCSGj3h1JH2eLOGsOrVJd38yVz 6QVN7c+sj9AuzZ5Zh1ukLoR0k+R4GgqvSMzNjOYk4q5Rw2J4eVgf259D0KAViuPEm5FD irCaGrPxnqWk9STxX2uSCzqZSFscME8lI0T9wSYYLUj9ToyPb7ckxWcKlKMRNdklqyci kbpZhALv3v4lpja6HK0IceNq6VzsIceJ8VGTIYn7L/E3tlsvsRxVDdps5ESHvyiQGlJH 2Q== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sdn9g0sy6-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:42:57 +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 61B2738 for ; Wed, 15 May 2019 12:42:56 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5131F2757 for ; Wed, 15 May 2019 12:42:56 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:42:55 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 08/21] [ARM] FDPIC: Enforce local/global binding for function descriptors Date: Wed, 15 May 2019 14:39:33 +0200 Message-ID: <20190515124006.25840-9-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Use local binding rules to decide whether we can use GOTOFFFUNCDESC to compute the function address. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (arm_local_funcdesc_p): New function. (legitimize_pic_address): Enforce binding rules on function pointers in FDPIC mode. (arm_assemble_integer): Likewise. Change-Id: I3fa0b63bc0f672903f405aa72cc46052de1c0feb -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index dbd1671..40e3f3b 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3790,6 +3790,42 @@ arm_options_perform_arch_sanity_checks (void) } } +/* Test whether a local function descriptor is canonical, i.e., + whether we can use GOTOFFFUNCDESC to compute the address of the + function. */ +static bool +arm_fdpic_local_funcdesc_p (rtx fnx) +{ + tree fn; + enum symbol_visibility vis; + bool ret; + + if (!TARGET_FDPIC) + return TRUE; + + if (! SYMBOL_REF_LOCAL_P (fnx)) + return FALSE; + + fn = SYMBOL_REF_DECL (fnx); + + if (! fn) + return FALSE; + + vis = DECL_VISIBILITY (fn); + + if (vis == VISIBILITY_PROTECTED) + /* Private function descriptors for protected functions are not + canonical. Temporarily change the visibility to global so that + we can ensure uniqueness of funcdesc pointers. */ + DECL_VISIBILITY (fn) = VISIBILITY_DEFAULT; + + ret = default_binds_local_p_1 (fn, flag_pic); + + DECL_VISIBILITY (fn) = vis; + + return ret; +} + static void arm_add_gc_roots (void) { @@ -7563,7 +7599,9 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg, rtx pic_reg, || (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig) && (SYMBOL_REF_DECL (orig) - ? !DECL_WEAK (SYMBOL_REF_DECL (orig)) : 1))) + ? !DECL_WEAK (SYMBOL_REF_DECL (orig)) : 1) + && (!SYMBOL_REF_FUNCTION_P (orig) + || arm_fdpic_local_funcdesc_p (orig)))) && NEED_GOT_RELOC && arm_pic_data_is_text_relative) insn = arm_pic_static_addr (orig, reg); @@ -23231,7 +23269,9 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) || (GET_CODE (x) == SYMBOL_REF && (!SYMBOL_REF_LOCAL_P (x) || (SYMBOL_REF_DECL (x) - ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0)))) + ? DECL_WEAK (SYMBOL_REF_DECL (x)) : 0) + || (SYMBOL_REF_FUNCTION_P (x) + && !arm_fdpic_local_funcdesc_p (x))))) { if (TARGET_FDPIC && SYMBOL_REF_FUNCTION_P (x)) fputs ("(GOTFUNCDESC)", asm_out_file); From patchwork Wed May 15 12:39:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164284 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp604664oca; Wed, 15 May 2019 05:43:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoO1IjX5mDE9vBMxyKI0X8iWsMxcb2qgZPtqt8c6Zam1SporhHACkNK7HgOwInXTDIuh9u X-Received: by 2002:a63:295:: with SMTP id 143mr43969810pgc.279.1557924215039; Wed, 15 May 2019 05:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924215; cv=none; d=google.com; s=arc-20160816; b=kUniJjr1joOKmEnMH3DURfWClmG1Z+THcpN3KYZvk2CbFpS8tueUFj+635WF/G5T59 zI2yX7N5hp1PxhMCe5IDDSJ+cgzewjenAtpsz1r5IMuuEKhwZsWfYrbvbiFdSg0pFI5i djg57bdlarI3/HRXDt8/4ETDvLT1p7UpuzSk6NqoSmM0pxItnHbTdomGzXbwBiTeXbDC fWsYmfpZ0cGqfm6eBX+8MO5hDSiyp0pJDq+OOGSjkjRaqSVJR/t2sXV854dRq9r+87X8 Y/8pNEEt5gwFy5qwTZRoBMHNRwxkQ2QlyMrnYwnmjsUBu/1TtINH+RgTX24JB2gdKDTo 1tYw== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=mkJGRxfputyorwi17x5WItmLqdAkr1cCUKi17OafFGY=; b=qRqTIIZh4rtWzvkGbt9hu394okFsD61ci7b5lpQa5FCROnSQLJTQPYoYbQgw8GP28Z l+bc7KVs7gsAjqLO6Dy52xEV1CsRWSIKd5QMfpNPy3EaG3Q2g7rc8Fl/kiAZrscy1ybi B7rcuGHP9VQ8kqAg+W2G1Vn+btwpffxPhAeoxUCDqluRRVZOBrsuMqyF+LxnkwEw5pst oSkh4YSDfqBJm32iV2uAVnd2BPBeOO3REJqrxNzTSUBZcMURN7e7zKRKLCu772ZJHpDT wqDAYGUakIMPrN8uzorppZIoVv2/kQcx2dHDDc7yNPt9LtoGn4PbtU5DONlRzUOt5hcc 09xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hrlDV9Ok; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=t7v+AJfA; spf=pass (google.com: domain of gcc-patches-return-500773-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500773-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 90si1731592plb.86.2019.05.15.05.43.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:43:35 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500773-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=hrlDV9Ok; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=t7v+AJfA; spf=pass (google.com: domain of gcc-patches-return-500773-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500773-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=GDH KFcsLCIz1wusL3fEo9vEctPhpseep57pknzfcEjLQmU4lQQ1q9QJznnVLZo68d/x o3K//M2GbsvXrvf1NByeSx4lw3eLMy4AG7ehX8MnV5uGLPRNcffB0o+01K8OLK97 oL52ApY396mWHPOOm2fpcZcMehFJhZKuZmQqhKyM= 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=z5POBv2KG kNeJezqH3gs8B/T6Qc=; b=hrlDV9Ok++mcCErUip6p7BS0qn53FyMcH8ko/2Y5e KQcvTSK5UqmBpdjZYkxhTOwYaGvmTZQXfsR2ebXxo1KPK/cytnmx3t4TRv+k1KrC XL20se1DbtIRf0fPNZitbn9wNR/V3qCWHEykYOOijeKUaNyZafO5L3iEiUyBbAZA nU= Received: (qmail 121158 invoked by alias); 15 May 2019 12:43:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 120908 invoked by uid 89); 15 May 2019 12:43:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.7 required=5.0 tests=AWL, 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.1 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; Wed, 15 May 2019 12:43:19 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCgjDc007236 for ; Wed, 15 May 2019 14:43:17 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=mkJGRxfputyorwi17x5WItmLqdAkr1cCUKi17OafFGY=; b=t7v+AJfAbGNJsYZuCoF3My1npxSm0xt2lQdSfnnnNf4oMkw+PlQQKCNgktp5hBYLgSy9 X1JO2OhotMsXRGYLGFIwKGuRfusB5tnusKMG6L9qPn7/WqeeCZeQ4lYfe6IS0ABkRSkh WS/Q7Fq2ETCsM/WD4TaV6TNI8P0BP68PUKaSVLBI4c0cR1m+LNGgTXMlUYoKKd4EHoyk Ft4LGrH5wv5fLaS29L3oI9nD9FOshvMaZLVCLfvGfJFZK+ablxnROeYZYMG8TRqO38eN fP6M5ayYkWA+rLikhWJLRAMqoG84u30PK9wyPCu9U6GXXMDCeoiyKZ960Psk65BFuWVv ug== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sdkv00gxu-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:43:17 +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 A57D43D for ; Wed, 15 May 2019 12:43:16 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 896F1275B for ; Wed, 15 May 2019 12:43:16 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:43:15 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 09/21] [ARM] FDPIC: Add support for taking address of nested function Date: Wed, 15 May 2019 14:39:34 +0200 Message-ID: <20190515124006.25840-10-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes In FDPIC mode, the trampoline generated to support pointers to nested functions looks like: .word trampoline address .word trampoline GOT address ldr r12, [pc, #8] ldr r9, [pc, #8] ldr pc, [pc, #8] .word static chain value .word GOT address .word function's address because in FDPIC function pointers are actually pointers to function descriptors, we have to actually generate a function descriptor for the trampoline. 2019-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: Idc4d5f629ae4f8d79bdf9623517481d524a0c144 -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 40e3f3b..99d13bf 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3976,13 +3976,50 @@ arm_warn_func_return (tree decl) .word static chain value .word function's address XXX FIXME: When the trampoline returns, r8 will be clobbered. */ +/* In FDPIC mode, the trampoline looks like: + .word trampoline address + .word trampoline GOT address + ldr r12, [pc, #8] ; #4 for Thumb2 + ldr r9, [pc, #8] ; #4 for Thumb2 + ldr pc, [pc, #8] ; #4 for Thumb2 + .word static chain value + .word GOT address + .word function's address +*/ static void arm_asm_trampoline_template (FILE *f) { fprintf (f, "\t.syntax unified\n"); - if (TARGET_ARM) + if (TARGET_FDPIC) + { + /* The first two words are a function descriptor pointing to the + trampoline code just below. */ + if (TARGET_ARM) + fprintf (f, "\t.arm\n"); + else if (TARGET_THUMB2) + fprintf (f, "\t.thumb\n"); + else + /* Only ARM and Thumb-2 are supported. */ + gcc_unreachable (); + + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + /* Trampoline code which sets the static chain register but also + PIC register before jumping into real code. */ + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + STATIC_CHAIN_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + PIC_OFFSET_TABLE_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + asm_fprintf (f, "\tldr\t%r, [%r, #%d]\n", + PC_REGNUM, PC_REGNUM, + TARGET_THUMB2 ? 8 : 4); + assemble_aligned_integer (UNITS_PER_WORD, const0_rtx); + } + else if (TARGET_ARM) { fprintf (f, "\t.arm\n"); asm_fprintf (f, "\tldr\t%r, [%r, #0]\n", STATIC_CHAIN_REGNUM, PC_REGNUM); @@ -4023,12 +4060,40 @@ arm_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) emit_block_move (m_tramp, assemble_trampoline_template (), GEN_INT (TRAMPOLINE_SIZE), BLOCK_OP_NORMAL); - mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 8 : 12); - emit_move_insn (mem, chain_value); + if (TARGET_FDPIC) + { + rtx funcdesc = XEXP (DECL_RTL (fndecl), 0); + rtx fnaddr = gen_rtx_MEM (Pmode, funcdesc); + rtx gotaddr = gen_rtx_MEM (Pmode, plus_constant (Pmode, funcdesc, 4)); + /* The function start address is at offset 8, but in Thumb mode + we want bit 0 set to 1 to indicate Thumb-ness, hence 9 + below. */ + rtx trampoline_code_start + = plus_constant (Pmode, XEXP (m_tramp, 0), TARGET_THUMB2 ? 9 : 8); + + /* Write initial funcdesc which points to the trampoline. */ + mem = adjust_address (m_tramp, SImode, 0); + emit_move_insn (mem, trampoline_code_start); + mem = adjust_address (m_tramp, SImode, 4); + emit_move_insn (mem, gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM)); + /* Setup static chain. */ + mem = adjust_address (m_tramp, SImode, 20); + emit_move_insn (mem, chain_value); + /* GOT + real function entry point. */ + mem = adjust_address (m_tramp, SImode, 24); + emit_move_insn (mem, gotaddr); + mem = adjust_address (m_tramp, SImode, 28); + emit_move_insn (mem, fnaddr); + } + else + { + mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 8 : 12); + emit_move_insn (mem, chain_value); - mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 12 : 16); - fnaddr = XEXP (DECL_RTL (fndecl), 0); - emit_move_insn (mem, fnaddr); + mem = adjust_address (m_tramp, SImode, TARGET_32BIT ? 12 : 16); + fnaddr = XEXP (DECL_RTL (fndecl), 0); + emit_move_insn (mem, fnaddr); + } a_tramp = XEXP (m_tramp, 0); emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), @@ -4042,7 +4107,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 45c0e2b..f80df63 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1602,7 +1602,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 Wed May 15 12:39:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164285 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp604930oca; Wed, 15 May 2019 05:43:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzq9TUggLon0uDBpasi3nmNxgPjyaoP7sAYymtlBd+o6sx9vXPJM6oqaDrw3fkOoztxERwE X-Received: by 2002:aa7:860a:: with SMTP id p10mr29523184pfn.214.1557924233734; Wed, 15 May 2019 05:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924233; cv=none; d=google.com; s=arc-20160816; b=xGTlxDV8ZyjzUZy0egqaGr7pdD2BkExboE9xE3CvagEXK07wna1io0SSnLF4xW6CRs vla0Qu86vbEoin9spDWuPosy7TUXZVQb6jk/gUOpP+9Vyb8u1gT2EWI+VbG4wR2bespK fOzYlcTWelQcc/GfKTSk4uuTdZTPGBlGLZDXgpOMko7MXqocwsu8be0e9Ii/TGxir0Gs zVNhic0cFjXuJBxNJv0qQm9ebClrOJ3pUYVCDS4UqNBOXyMbdDefWBhekHOtmoz8kc5p 7Iay5pCuyzCuNslM+qaC8+Qw7ULFPsORnxsEkgHn6J6A3Arj9hoJvQ7rqt1Lkv/zpbqd n6kg== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=VRuTYyOwqoeJu/vBes/uDThRdG56t+RxSMFTWbL9RrY=; b=K2lC6L9BIrIeIz3UO7fJs/VfLk3UHfMLPZ0X5HKuIO20I4NbUMat1ti/Wq4RPmovin Fmdtdlh6zzY1+wFFt3NXP3eX7/cTrPFymKL2s9E9dmFO7J9/WWXkkpcExqivZqnWzIK1 0/zkCIXvbJTUFBlZmWh15a9jfaKvgEdJNiaghFP6lThzgy5VW0d8YrBG3lbpxU/bMkmC aYKEZgUeKQFqFN+vg8gCXwu9quHRZdcuvJwGc4lLs1I5GwoQY1vL8Rjd+RNgxDXuEl7n 8XqHlkDWSJfB3WNaAHjv6x3TxmKo/WVemz5d4kWbpfmvZD1n+E6/qfCziDcUIuUXXxic TFEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lcSbTUEX; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=wS0weTvJ; spf=pass (google.com: domain of gcc-patches-return-500774-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500774-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 s16si1684389plr.292.2019.05.15.05.43.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:43:53 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500774-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=lcSbTUEX; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=wS0weTvJ; spf=pass (google.com: domain of gcc-patches-return-500774-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500774-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=iP/ /FcJBCMQr+Ib2T8Q5At/bljdhC3yPERx4hBx4NCHCuxnJ/HQB74rXWbT5QUrLY7k GghUATtvP02q5sZh2cqOp5tK1EDYgJHXmFWKuf4zaRCXsf6xxJtPx16ghzkU3sfz GzIMgzePas9YJyDuMYAaSLDEUHOzo8T4LIufoPYc= 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=9MwHnwWjh Q2LVujgo3xXELXIR34=; b=lcSbTUEXQo7L8G8YUS9wbnKQ7h23egqraCmPtgGEU Hb3OeBJ+Cu1FXKmiNhx3tNLz6ONjvCrJE45zGeZZTzKT0gjmt4Q3oFb1ygUlWh3I JClFaZAvbmq1fdDUmS36qQT519dpsRzMxjmDioBTxzbkoxwwAIL0VJczCpnj4k4M B8= Received: (qmail 5196 invoked by alias); 15 May 2019 12:43:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 4760 invoked by uid 89); 15 May 2019 12:43:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.8 required=5.0 tests=AWL, 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.1 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; Wed, 15 May 2019 12:43:39 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCgG4n014526 for ; Wed, 15 May 2019 14:43:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=VRuTYyOwqoeJu/vBes/uDThRdG56t+RxSMFTWbL9RrY=; b=wS0weTvJx4nFI+/fmh0NzNZXy/N936Y7WibK+VU/wXPryP8N7NOV+NgnOpFU3VaESJAW +oyh+4vamay4H/Ue5CWM7/HCyex4/vo8l68nX08O9VB3Fln3IfYpxJxFC1cu6XXzUnaQ ikw0ed7Fy2RdZUpQogmqcK/j2JFjzGKHFJqhz7x4WYl7D0iDAvWuYBi7h1YqBg3xMFqj wXt0eL/FcxCrWvMdC6d2DJPajiAqxNIh/TDLVTloWSpGj+KXNbPFHuRgGyZYHVqZxGeP dThPduG7GXKQeN9jt8E8r9XuygQaVWcbrbJB7QSBACXEurit2sL9Gbew2vUYde3sfcGh 9Q== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sdn9g0t2h-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:43: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 E322031 for ; Wed, 15 May 2019 12:43:36 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CED2F275B for ; Wed, 15 May 2019 12:43:36 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:43:36 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 10/21] [ARM] FDPIC: Implement TLS support. Date: Wed, 15 May 2019 14:39:35 +0200 Message-ID: <20190515124006.25840-11-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Support additional relocations: TLS_GD32_FDPIC, TLS_LDM32_FDPIC, and TLS_IE32_FDPIC. We do not support the GNU2 TLS dialect. 2019-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.c (tls_reloc): Add TLS_GD32_FDPIC, TLS_LDM32_FDPIC and TLS_IE32_FDPIC. (arm_call_tls_get_addr): Add FDPIC support. (legitimize_tls_address): Likewise. (arm_emit_tls_decoration): Likewise. Change-Id: I4ea5034ff654540c4658d0a79fb92f70550cdf4a -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 99d13bf..5fc7a20 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2379,9 +2379,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 */ }; @@ -8760,20 +8763,34 @@ arm_call_tls_get_addr (rtx x, rtx reg, rtx *valuep, int reloc) gcc_assert (reloc != TLS_DESCSEQ); start_sequence (); - labelno = GEN_INT (pic_labelno++); - label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - label = gen_rtx_CONST (VOIDmode, label); + if (TARGET_FDPIC) + { + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (reloc)), + UNSPEC_TLS); + } + else + { + labelno = GEN_INT (pic_labelno++); + label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + label = gen_rtx_CONST (VOIDmode, label); - sum = gen_rtx_UNSPEC (Pmode, - gen_rtvec (4, x, GEN_INT (reloc), label, - GEN_INT (TARGET_ARM ? 8 : 4)), - UNSPEC_TLS); + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (4, x, GEN_INT (reloc), label, + GEN_INT (TARGET_ARM ? 8 : 4)), + UNSPEC_TLS); + } reg = load_tls_operand (sum, reg); - if (TARGET_ARM) - emit_insn (gen_pic_add_dot_plus_eight (reg, reg, labelno)); + if (TARGET_FDPIC) + { + emit_insn (gen_addsi3 (reg, reg, gen_rtx_REG (Pmode, FDPIC_REGNUM))); + } else - emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); + if (TARGET_ARM) + emit_insn (gen_pic_add_dot_plus_eight (reg, reg, labelno)); + else + emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); *valuep = emit_library_call_value (get_tls_get_addr (), NULL_RTX, LCT_PURE, /* LCT_CONST? */ @@ -8808,6 +8825,7 @@ arm_tls_descseq_addr (rtx x, rtx reg) return reg; } + rtx legitimize_tls_address (rtx x, rtx reg) { @@ -8820,6 +8838,9 @@ legitimize_tls_address (rtx x, rtx reg) case TLS_MODEL_GLOBAL_DYNAMIC: if (TARGET_GNU2_TLS) { + if (TARGET_FDPIC) + gcc_unreachable(); + reg = arm_tls_descseq_addr (x, reg); tp = arm_load_tp (NULL_RTX); @@ -8829,7 +8850,10 @@ legitimize_tls_address (rtx x, rtx reg) else { /* Original scheme */ - insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32); + if (TARGET_FDPIC) + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32_FDPIC); + else + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_GD32); dest = gen_reg_rtx (Pmode); emit_libcall_block (insns, dest, ret, x); } @@ -8838,6 +8862,9 @@ legitimize_tls_address (rtx x, rtx reg) case TLS_MODEL_LOCAL_DYNAMIC: if (TARGET_GNU2_TLS) { + if (TARGET_FDPIC) + gcc_unreachable(); + reg = arm_tls_descseq_addr (x, reg); tp = arm_load_tp (NULL_RTX); @@ -8846,7 +8873,10 @@ legitimize_tls_address (rtx x, rtx reg) } else { - insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32); + if (TARGET_FDPIC) + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32_FDPIC); + else + insns = arm_call_tls_get_addr (x, reg, &ret, TLS_LDM32); /* Attach a unique REG_EQUIV, to allow the RTL optimizers to share the LDM result with other LD model accesses. */ @@ -8865,23 +8895,35 @@ legitimize_tls_address (rtx x, rtx reg) return dest; case TLS_MODEL_INITIAL_EXEC: - labelno = GEN_INT (pic_labelno++); - label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); - label = gen_rtx_CONST (VOIDmode, label); - sum = gen_rtx_UNSPEC (Pmode, - gen_rtvec (4, x, GEN_INT (TLS_IE32), label, - GEN_INT (TARGET_ARM ? 8 : 4)), - UNSPEC_TLS); - reg = load_tls_operand (sum, reg); - - if (TARGET_ARM) - emit_insn (gen_tls_load_dot_plus_eight (reg, reg, labelno)); - else if (TARGET_THUMB2) - emit_insn (gen_tls_load_dot_plus_four (reg, NULL, reg, labelno)); + if (TARGET_FDPIC) + { + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (2, x, GEN_INT (TLS_IE32_FDPIC)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + emit_insn (gen_addsi3 (reg, reg, gen_rtx_REG (Pmode, FDPIC_REGNUM))); + emit_move_insn (reg, gen_rtx_MEM (Pmode, reg)); + } else { - emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); - emit_move_insn (reg, gen_const_mem (SImode, reg)); + labelno = GEN_INT (pic_labelno++); + label = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, labelno), UNSPEC_PIC_LABEL); + label = gen_rtx_CONST (VOIDmode, label); + sum = gen_rtx_UNSPEC (Pmode, + gen_rtvec (4, x, GEN_INT (TLS_IE32), label, + GEN_INT (TARGET_ARM ? 8 : 4)), + UNSPEC_TLS); + reg = load_tls_operand (sum, reg); + + if (TARGET_ARM) + emit_insn (gen_tls_load_dot_plus_eight (reg, reg, labelno)); + else if (TARGET_THUMB2) + emit_insn (gen_tls_load_dot_plus_four (reg, NULL, reg, labelno)); + else + { + emit_insn (gen_pic_add_dot_plus_four (reg, reg, labelno)); + emit_move_insn (reg, gen_const_mem (SImode, reg)); + } } tp = arm_load_tp (NULL_RTX); @@ -28218,15 +28260,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 Wed May 15 12:39:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164286 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp605278oca; Wed, 15 May 2019 05:44:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8sSX0BYu6Xp1e4zvj9yD9vAAj1h82FYIg9k/j4CnGGWViTA8gQvjrxqjE10DZn6p73XDu X-Received: by 2002:a17:902:3fa5:: with SMTP id a34mr16610292pld.297.1557924255260; Wed, 15 May 2019 05:44:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924255; cv=none; d=google.com; s=arc-20160816; b=E68+dHJ6Ebl7NtAbVIdYZkpLKJlr1TmmOOTXX9Y6PB3WwmyN6TMrncUJc3jdoTNDhk zScZMffyDVngYGB6jRHqA4qJcT/HSq1Kx/gc5Ly2Xz6aB0R7KnOLWFHywkRPdXGsGqY0 MGdsV+oCZysS3dde/i3lvcYdosGO65QwGHb/N+MjQxYZ1qkQtKofNROXZnTexqPRse+G 0em9vYFxf2loQaicOSaUGUawV74NKCv5cZNq5UBOyFruUsQSS4QnwIQzPbh1I08OmTMD jNyypObxh4lGMJcxpmzFowQ+kbZ7V0BMfpywYDFoOzKTDiALmE3ezV/QxN/EMMdb5YN7 cC9A== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=3QYfaLowoqStw7AWlrpZ0mZqaCNgcEbLrrvwCDA7T6w=; b=KD25I4Humea5nsHdn0n8KKEx7vzcojPNJXK+c6tqqerg7bVB7mNqjJnveMAJPlyDlc 8TZhCTt+Dz+9xVQYP6LGSEx4fjInOdLTI9nTEi+Z7nWVa9BzMhnfzrnDHrescvyfnLFO 7TIBpLHMQ/ilOJZ3ZcL8ecIw9sB8vknK6VNCDjSgB9YlxtFmTvVskjPAqwdXapwMfXZT oF1tPEY5wi9IEOp1TIjpuzrCTlWjYlQzOZqS5a0qz3CdnpKsfmHM5VSsE/wpW43bJeoa x4XZ1Y31Iu3HWYugdj8sGTEFb5GHhBlMXLN+VS0lEPpiKy8TP/pNVuGzlwT5wCfQQjg3 zb+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Hjwjnder; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=YvEDJalT; spf=pass (google.com: domain of gcc-patches-return-500775-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500775-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 u68si1852380pgc.72.2019.05.15.05.44.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:44:15 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500775-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=Hjwjnder; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=YvEDJalT; spf=pass (google.com: domain of gcc-patches-return-500775-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500775-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=syH wRHk1V6NLa55oFTw4BF0czShC+jPIHKZ044y6YVpmWexT/QsfZjHBpP+Glhg/mj8 c6IsoAHBXczsjtqWcvwNoSQqtOmXB0Ce6U1P3sxaMubFwZrJWZSLe0V3r2kEuKHd ajUlYIqZTukSeiv78iOv/c+frSjRvHrBzasMI3P4= 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=SIZzBiMI0 CkyzW2Ft40WeavlXbk=; b=HjwjnderbytoupX/W68wveOzpfehv5Ke3v/6OnrIK WZ8VKyynljjaEF3r8VYH1Jg+/6/f6qs9ktdxcjBE+6KVAkQ5kzdtL09PiTlv0w3b HFxaZ2NYM5M2crtRCOdbrLL/YzUfcqELzLc6wlMz5dSQKBSJD1moo4mhoyx2yQj0 IA= Received: (qmail 34250 invoked by alias); 15 May 2019 12:44:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 33580 invoked by uid 89); 15 May 2019 12:44:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.0 required=5.0 tests=AWL, 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.1 spammy=UD:sdt.h, sdt.h, sdth, 2226 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; Wed, 15 May 2019 12:44:00 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCfhQs022105 for ; Wed, 15 May 2019 14:43:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=3QYfaLowoqStw7AWlrpZ0mZqaCNgcEbLrrvwCDA7T6w=; b=YvEDJalTxbpIzr13R+Trsoh0NBRHJPnKznDx45CmCwccDUJRscwBlb7u++JaXBierB+U WMkg1YCtEnXxEp7IYWv7VwZDG0rhmSEEw1Tnq2kiRU0BNrTKo5XuJvc3bhHVdXeT1yBC rfSt+6uZW37Sj8Rbjf4FgR9J6X58E/nF2ogXGol7oPKOFP7DyW12+q02CH4D4Xj7+IlZ wt5QH3S7Jjjzc3UBYzwvMvfssN7SkmI6GSPdiimB1q62gWTijeXJ4xj0h37EqaJQvd/P EJzrrRwVePvHMe9Y9fxF8JLSnumEbiZOZSFUYHs1pJqjXdRkjLyHgA1GnHGZtrWTie+/ Ew== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sek5ajrkw-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:43:57 +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 6517C34 for ; Wed, 15 May 2019 12:43:57 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 50C90275E for ; Wed, 15 May 2019 12:43:57 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:43:56 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 11/21] [ARM] FDPIC: Add support to unwind FDPIC signal frame Date: Wed, 15 May 2019 14:39:36 +0200 Message-ID: <20190515124006.25840-12-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes 2019-XX-XX Christophe Lyon Mickaël Guêné libgcc/ * unwind-arm-common.inc (ARM_SET_R7_RT_SIGRETURN) (THUMB2_SET_R7_RT_SIGRETURN, FDPIC_LDR_R12_WITH_FUNCDESC) (FDPIC_LDR_R9_WITH_GOT, FDPIC_LDR_PC_WITH_RESTORER) (FDPIC_FUNCDESC_OFFSET, ARM_NEW_RT_SIGFRAME_UCONTEXT) (ARM_UCONTEXT_SIGCONTEXT, ARM_SIGCONTEXT_R0, FDPIC_T2_LDR_R12_WITH_FUNCDESC) (FDPIC_T2_LDR_R9_WITH_GOT, FDPIC_T2_LDR_PC_WITH_RESTORER): New. (__gnu_personality_sigframe_fdpic): New. (get_eit_entry): Add FDPIC signal frame support. Change-Id: I7f9527cc50665dd1a731b7badf71c319fb38bf57 -- 2.6.3 diff --git a/libgcc/unwind-arm-common.inc b/libgcc/unwind-arm-common.inc index 0bacc11..c9a82b7 100644 --- a/libgcc/unwind-arm-common.inc +++ b/libgcc/unwind-arm-common.inc @@ -30,6 +30,26 @@ #include #endif +#if __FDPIC__ +/* Load r7 with rt_sigreturn value. */ +#define ARM_SET_R7_RT_SIGRETURN 0xe3a070ad /* mov r7, #0xad */ +#define THUMB2_SET_R7_RT_SIGRETURN 0x07adf04f /* mov.w r7, #0xad */ + +/* FDPIC jump to restorer sequence. */ +#define FDPIC_LDR_R12_WITH_FUNCDESC 0xe59fc004 /* ldr r12, [pc, #4] */ +#define FDPIC_LDR_R9_WITH_GOT 0xe59c9004 /* ldr r9, [r12, #4] */ +#define FDPIC_LDR_PC_WITH_RESTORER 0xe59cf000 /* ldr pc, [r12] */ +#define FDPIC_T2_LDR_R12_WITH_FUNCDESC 0xc008f8df /* ldr.w r12, [pc, #8] */ +#define FDPIC_T2_LDR_R9_WITH_GOT 0x9004f8dc /* ldr.w r9, [r12, #4] */ +#define FDPIC_T2_LDR_PC_WITH_RESTORER 0xf000f8dc /* ldr.w pc, [r12] */ +#define FDPIC_FUNCDESC_OFFSET 12 + +/* Signal frame offsets. */ +#define ARM_NEW_RT_SIGFRAME_UCONTEXT 0x80 +#define ARM_UCONTEXT_SIGCONTEXT 0x14 +#define ARM_SIGCONTEXT_R0 0xc +#endif + /* We add a prototype for abort here to avoid creating a dependency on target headers. */ extern void abort (void); @@ -199,6 +219,45 @@ search_EIT_table (const __EIT_entry * table, int nrec, _uw return_address) } } +#if __FDPIC__ +/* VFP is not restored, but this is sufficient to allow unwinding. */ +static _Unwind_Reason_Code +__gnu_personality_sigframe_fdpic (_Unwind_State state, + _Unwind_Control_Block *ucbp, + _Unwind_Context *context) +{ + unsigned int sp; + unsigned int pc; + unsigned int funcdesc; + unsigned int handler; + unsigned int first_handler_instruction; + int i; + + _Unwind_VRS_Get (context, _UVRSC_CORE, R_SP, _UVRSD_UINT32, &sp); + _Unwind_VRS_Get (context, _UVRSC_CORE, R_PC, _UVRSD_UINT32, &pc); + + funcdesc = *(unsigned int *)((pc & ~1) + FDPIC_FUNCDESC_OFFSET); + handler = *(unsigned int *)(funcdesc); + first_handler_instruction = *(unsigned int *)(handler & ~1); + + /* Adjust SP to point to the start of registers according to + signal type. */ + if (first_handler_instruction == ARM_SET_R7_RT_SIGRETURN + || first_handler_instruction == THUMB2_SET_R7_RT_SIGRETURN) + sp += ARM_NEW_RT_SIGFRAME_UCONTEXT + + ARM_UCONTEXT_SIGCONTEXT + + ARM_SIGCONTEXT_R0; + else + sp += ARM_UCONTEXT_SIGCONTEXT + + ARM_SIGCONTEXT_R0; + /* Restore regs saved on stack by the kernel. */ + for (i = 0; i < 16; i++) + _Unwind_VRS_Set (context, _UVRSC_CORE, i, _UVRSD_UINT32, sp + 4 * i); + + return _URC_CONTINUE_UNWIND; +} +#endif + /* Find the exception index table eintry for the given address. Fill in the relevant fields of the UCB. Returns _URC_FAILURE if an error occurred, _URC_OK on success. */ @@ -222,6 +281,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) &nrec); if (!eitp) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_FAILURE; } @@ -236,6 +316,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) if (!eitp) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_FAILURE; } @@ -244,6 +345,27 @@ get_eit_entry (_Unwind_Control_Block *ucbp, _uw return_address) /* Can this frame be unwound at all? */ if (eitp->content == EXIDX_CANTUNWIND) { +#if __FDPIC__ + /* If we are unwinding a signal handler then perhaps we have + reached a trampoline. Try to detect jump to restorer + sequence. */ + _uw *pc = (_uw *)((return_address+2) & ~1); + if ((pc[0] == FDPIC_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_LDR_R9_WITH_GOT + && pc[2] == FDPIC_LDR_PC_WITH_RESTORER) + || (pc[0] == FDPIC_T2_LDR_R12_WITH_FUNCDESC + && pc[1] == FDPIC_T2_LDR_R9_WITH_GOT + && pc[2] == FDPIC_T2_LDR_PC_WITH_RESTORER)) + { + struct funcdesc_t *funcdesc + = (struct funcdesc_t *) &__gnu_personality_sigframe_fdpic; + + UCB_PR_ADDR (ucbp) = funcdesc->ptr; + UCB_PR_GOT (ucbp) = funcdesc->got; + + return _URC_OK; + } +#endif UCB_PR_ADDR (ucbp) = 0; return _URC_END_OF_STACK; } From patchwork Wed May 15 12:39:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164287 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp605616oca; Wed, 15 May 2019 05:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZq7720HBtbmmm2qpRwqAxsxov6+FMVacNI2MYKn/Pbrl6lsRUYGQOHjXN8sQ8jVBO1PcN X-Received: by 2002:a63:c64c:: with SMTP id x12mr43806633pgg.379.1557924274969; Wed, 15 May 2019 05:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924274; cv=none; d=google.com; s=arc-20160816; b=z6+RL6MFbTLOYpRzlA+0DHTKchpWN+ISTxnIC63vfb4jenIlEtRbGVNOzTFYIjetzp oHZK2cL1/9hpvZat6wwYrtFebBigMg3dRO6/fkN0ygPeQsfrCb8XJZtVR9BJuNA5U9KO 4Wva9r9y7vPHbSLR3EaE05l+Byt3mIcizunzH/x7EY2PSx6Z+oFFs3cRlFuAW1AjUXrp jvXjS0575zPs+brzAMNeUyeqbRXmej8cZBhKZPIkCWTOlhWIf52u25HXN5+lf6bQ0IR5 27O59PbTqzpIuoWnHIlumC+chXA+Bkmqvb0kx0BfT2fc+nGLpxoFGLgaSmO3u9atKCQd sYdg== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=5vfvCIyle0VbCWOQhsim34krrpvizqGVN/gRkdLFHl8=; b=r0Yl7aIgpvpNhQ6n/9e3FPUckUb5GbVddKAmuCVH3F/vs0zc3ysWKqDz+OYgwAK80J 4YItNNZvr9FtrJp0PxeBOOvjxX56dv3HRSLaDebReBouPmsz8vFtrTEeTlgylg7n7m2H AwmQa/JlLmT6AxKc8aXrI1PiywOOePoIDFungxZ7htuVl4yARvrjuNZD/vJ+O8aYEH/6 EuGobTePSAtqHCe0N7phMb6KGtVcv34WLegLrfQyQVFrPsrlDrrW7J58cllWjqWfYnF2 F/stKD72lCf0AHN9vi1Z4RtpnXFGCnoDDkRFUJ5paDZPJ+TUROQoVAfc0zidd4Me/6LJ Cb8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=v1HGuRrp; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=loVJ70ua; spf=pass (google.com: domain of gcc-patches-return-500776-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500776-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 p11si1794224pgm.551.2019.05.15.05.44.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:44:34 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500776-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=v1HGuRrp; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=loVJ70ua; spf=pass (google.com: domain of gcc-patches-return-500776-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500776-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=Y+z 7YrTu/8+8zjOlx0RT6e5MPCsHt9AbpCHTp8SRTi6Um/SrZLHmiZfFbzP75dTo5V+ CjeJkkZSK8MTXpUEAk7HgJxNK5XAFgK7YuhMje42Z2o04LBIBT9o6iCDvIfxb/O+ LWQUaZ0T3ctV9WiwmpOBHxTQwQN2mESBdlivAxV4= 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=b3mLX048i 0bjNr80IpRLIxFI9io=; b=v1HGuRrppvZOfdmtK2zqSQ9sDn0C9oU0plGbpoQVM gELlUzlRLuwUdWlREmTSv8ABpDLdkqlubuXyWNrj+/MDueu8hYtvUQZ5/j8IJ60h sbQDe9ucXkR9q7aS9aP9plEeUS56OuA2Mwcmz4OnwN569ZgGOgarh/evh0KbOw93 yA= Received: (qmail 62757 invoked by alias); 15 May 2019 12:44:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 61744 invoked by uid 89); 15 May 2019 12:44:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=AWL, 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.1 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; Wed, 15 May 2019 12:44:20 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCgRg9014582 for ; Wed, 15 May 2019 14:44:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=5vfvCIyle0VbCWOQhsim34krrpvizqGVN/gRkdLFHl8=; b=loVJ70uaUvwVWQwVWC/Kw/ZyXAaMlvTTEB8RC1FlnIJYWzekWrTi3MmYfPHOkZcbhbp3 2kQHO8niQptmH82Xpl0KmVdR1XmzcS31vFHAvNXjB+SU+ILU6RotJ5L63zAPuHOnwRJC PYcVjqZuI7YzKjtebVg5oDcyCjYfwujKj6Sx9kl4SrxiaA0Z87SAMkG1TOTUNIPksOQM etqYV6JDQ3Mf+4Dd9kfWuM25RvkyN7pgUDfELEIpJzVs21mGmW/x+aw6VCT62zwBmGEQ IIwAQVc6RQCAsDMkJGG/nvOvhtFB/RFK5l/j3T8PReNhs9kMm4lK3ihtJ1py3mUv3OqI oQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sdn9g0t6p-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:44:18 +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 0E84D3A for ; Wed, 15 May 2019 12:44:17 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8907E2762 for ; Wed, 15 May 2019 12:44:17 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:44:16 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 12/21] [ARM] FDPIC: Restore r9 after we call __aeabi_read_tp Date: Wed, 15 May 2019 14:39:37 +0200 Message-ID: <20190515124006.25840-13-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes We call __aeabi_read_tp() to get the thread pointer. Since this is a function call, we have to restore the FDPIC register afterwards. 2019-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: I1f6dfaee6260ecb453270f4971b3c5124317a186 -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 5fc7a20..26f29c7 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -8732,7 +8732,25 @@ arm_load_tp (rtx target) rtx tmp; - emit_insn (gen_load_tp_soft ()); + if (TARGET_FDPIC) + { + rtx par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (3)); + rtx fdpic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + rtx initial_fdpic_reg = get_hard_reg_initial_val (Pmode, FDPIC_REGNUM); + + emit_insn (gen_load_tp_soft_fdpic ()); + + /* Restore r9. */ + XVECEXP (par, 0, 0) = gen_rtx_UNSPEC (VOIDmode, + gen_rtvec (2, fdpic_reg, + initial_fdpic_reg), + UNSPEC_PIC_RESTORE); + XVECEXP (par, 0, 1) = gen_rtx_USE (VOIDmode, initial_fdpic_reg); + XVECEXP (par, 0, 2) = gen_rtx_CLOBBER (VOIDmode, fdpic_reg); + emit_insn (par); + } + else + emit_insn (gen_load_tp_soft ()); tmp = gen_rtx_REG (SImode, R0_REGNUM); emit_move_insn (target, tmp); diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 9036255..0edcb1d 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -11759,12 +11759,25 @@ ) ;; Doesn't clobber R1-R3. Must use r0 for the first operand. +(define_insn "load_tp_soft_fdpic" + [(set (reg:SI 0) (unspec:SI [(const_int 0)] UNSPEC_TLS)) + (clobber (reg:SI 9)) + (clobber (reg:SI LR_REGNUM)) + (clobber (reg:SI IP_REGNUM)) + (clobber (reg:CC CC_REGNUM))] + "TARGET_SOFT_TP && TARGET_FDPIC" + "bl\\t__aeabi_read_tp\\t@ load_tp_soft" + [(set_attr "conds" "clob") + (set_attr "type" "branch")] +) + +;; Doesn't clobber R1-R3. Must use r0 for the first operand. (define_insn "load_tp_soft" [(set (reg:SI 0) (unspec:SI [(const_int 0)] UNSPEC_TLS)) (clobber (reg:SI LR_REGNUM)) (clobber (reg:SI IP_REGNUM)) (clobber (reg:CC CC_REGNUM))] - "TARGET_SOFT_TP" + "TARGET_SOFT_TP && !TARGET_FDPIC" "bl\\t__aeabi_read_tp\\t@ load_tp_soft" [(set_attr "conds" "clob") (set_attr "type" "branch")] From patchwork Wed May 15 12:39:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164288 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp606036oca; Wed, 15 May 2019 05:45:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxorxd7nn/7ymkO8NVdMr79KulHTXfKg74Cy73tDfAoJl2XDpwk6GrfW7NZOLphLZ3SFzw7 X-Received: by 2002:a65:6656:: with SMTP id z22mr43667187pgv.333.1557924300038; Wed, 15 May 2019 05:45:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924300; cv=none; d=google.com; s=arc-20160816; b=ElUuEO0A6vvqCKBRVwgN+/grdLLyGcSJKpXGTofQ4ARrU1c5NC0efKr7/O9kpVyYR3 sLrikxTo5mYHhawjCIQ/WkrePN6jCBfcjLJe5b4sp8a2KKcrybCdh71swxmxcwhQvFLN EgY/ioCbxygelcbTszcKmeYk1hkr3/9OcofCBggjn2IPppGGQnAqhXnz+1TlwI8xdrVx v5pYuq0h4yExDj82esJUEFhpeZGMFngmiOEJfOX944nHggleoS7BVCsvN0E4prpKUZgb pqKbMO/Kj876QTNoK06beWK50MpYQ/OsWU1xMiXwGg4RvOST7zq1iTcIDRe9pR9tZ6Pv HfPQ== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=H1jZapv2WhcVQfBCxV/7hQs0GZZ9dET1LJnUNzUzBJQ=; b=lpI3iqRXFrij+xeq13om1efGbyYBdXToss7BTd1K1XluYYhGO6NwtV6M9Evuk59WVU PdPpX8jxDnEGgPY1uSA0Gks3M7hRWb1Bxr0XRIsIbaUBVhOLzQQ0gzZ+cpoAhmaUtyUL Aeg3Y4WvmVFQOiEdxAS+CG8pnIZ+KBijKxpAIb8VaSlSRtlNB7zYEObSA6IzQGBepski O456BPs+dNjmO6iOhBS0GSJma53A/dmqJjmtGZUcxQRyJxsMvjw378rfqm5agc2ifUD8 1QI+Lo/3ZJKM7mIOq/fpJhw9la6AiGMJGwfvoxsf+n3fNI6yAl4PiKkRvl4B1orfp5TN T+eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=QijOnJPR; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=SzX42X1f; spf=pass (google.com: domain of gcc-patches-return-500777-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500777-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 w126si2088362pfw.53.2019.05.15.05.44.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:45:00 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500777-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=QijOnJPR; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=SzX42X1f; spf=pass (google.com: domain of gcc-patches-return-500777-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500777-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=KbP 1CuLyvg4tZD1YtGTm6z5u4eTNVsFQPnQ4kK0agVWDbK+1WNa+3PuPi0QktefAQ4T DJZX0X7LCfqqeBY0A3DnmnIk5A5th+lkTLz6gp0XINJPi+jMltOzHRQnKdqSNUiw MiAo/xxDIdc8iT5iyEPKwWr21OyPJV6sSRcNonxE= 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=FGtXdYw12 uJ8RZ2dLvOY4oVlN6g=; b=QijOnJPR6/H97QV9EiJEso1ujlXeAooDLy777J4U3 RvszEskIJAVOQTp+6ZWBzV1A2M2M+dE9tE0GRmImbKWcOB80XBBQQPIyWjeevcsj O35jNpu8E5TLqBol0Qkvx0WDITIdGaRm4LoN/kz5ZmBmz4MrecMUCVUzB3EoZlhE LU= Received: (qmail 114505 invoked by alias); 15 May 2019 12:44:47 -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 92625 invoked by uid 89); 15 May 2019 12:44:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.2 required=5.0 tests=AWL, 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.1 spammy=HX-Languages-Length:1096 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; Wed, 15 May 2019 12:44:40 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCg5Xi010209 for ; Wed, 15 May 2019 14:44:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=H1jZapv2WhcVQfBCxV/7hQs0GZZ9dET1LJnUNzUzBJQ=; b=SzX42X1fLO/L/s2UuO5ALZ/QPG8bl/Ttk9Lmuta1E9wxR+OFedZxtihwsfjionnF0AYS ifz3yD7+wk3cNdY4P3tYmWt0Hg1tccj2fh78a4wVmfnovCuuB6Fa0r1DA00dL+cdK2Hl NkxH0Z0jrh/NoMxAMPtUwjDKa7UFw06Xfqjk/kgIMhB10NAmE7RvP0Q1vCz02kVZpNQy bDhyC4GRY9btJBRvVZFB9B1Cs6xVaeaOfzrzd3Nm8V0YfKn0pFUDHU0++vp7lSCZJ84T +dQ2cVPOTpbg9LLbfKF6HIzBhTNzPHLRzXX2jB+sq6dkYRJROR8RT5ueyhVotJGLqjpW vQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sg0an6bh6-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:44:38 +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 CE36631 for ; Wed, 15 May 2019 12:44:37 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BEC042761 for ; Wed, 15 May 2019 12:44:37 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:44:37 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 13/21] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture Date: Wed, 15 May 2019 14:39:38 +0200 Message-ID: <20190515124006.25840-14-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Without this, when we are unwinding across a signal frame we can jump to an even address which leads to an exception. This is needed in __gnu_persnality_sigframe_fdpic() when restoring the PC from the signal frame since the PC saved by the kernel has the LSB bit set to zero. 2019-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 9ba73e7..ba47150 100644 --- a/libgcc/config/arm/unwind-arm.c +++ b/libgcc/config/arm/unwind-arm.c @@ -199,6 +199,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 Wed May 15 12:39:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164289 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp606328oca; Wed, 15 May 2019 05:45:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5UlB/BCl82cQM3x6MBgTZabBYs55PxspNnUKkU+jKXnDtFAHcMZr/G8fJ257Q4PtvxA3w X-Received: by 2002:a63:d408:: with SMTP id a8mr43331960pgh.184.1557924318759; Wed, 15 May 2019 05:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924318; cv=none; d=google.com; s=arc-20160816; b=Ak6U8YpAjQaniFY2+aYC3XovO8uTn08Qm+jfsSir4UZldM8U92iwJUj8+nVXfG7gaX Eh5Cjv9EUWOob+T7G2ke5/ksLswkLTZnlf11qRN7CvbdOhAZUTWtmeC3s0fktked1E9P 885275b+9XTaaWYVc9TKnYzADyTDg4ucDq8k6Vt0DZJRNVjI4/sZZanBXI4mDTH+aNYp FIgupH42heS5t1VYAYye9tIYwKBX/aAd09RM3JuIy64RgTvgcU9bqVmgy+90mfdYcvCA 2FOrVvG5ofImDW3IgV6Mej4nHheEACNO305kdeWsHdcaMYZ/HHFIHHTX5MjrY3fzadvA pMLw== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=Sc4Lrh6FgSywCe8yJCDv86OekHAZ/99PmPitmfiYFDY=; b=AVBR/zNoeAQWhZj7x91yOybQBiZhbNIptQfNC805eB/OKs8n7ASJP4hy3mGxMcxfHl Y7EjKOCZb7ODLraUu5r5E8VS9RzXwzYW/hXMICo2JKdwLvc6c94+zFc5kpusjkckz6Fp Dmn6qmYXAqYPtQhUd2YN7OtmoFMp+RkoqNwfQCv6UiHxTfEOywcRG1S32PATcL9xvqO9 GzbvFwdVX21INfpvnNElKPM9mRyEdnodeFBZe+u142Dtk5nrvAMXJHbx0cYHOrLN7z1C 9KQpHOfkbZhnI4uz6lNJxKpYXkCHR5lVEzTHIuj+LCQhuYmdBAdp8Ge7n7eyxCY7iQb1 EPEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=IgAtDY6R; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=JQVy6Xk3; spf=pass (google.com: domain of gcc-patches-return-500778-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500778-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 k1si1744465pgq.219.2019.05.15.05.45.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:45:18 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500778-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=IgAtDY6R; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=JQVy6Xk3; spf=pass (google.com: domain of gcc-patches-return-500778-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500778-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=ANC IZFl6VOfL+XS7lqnHTlLa8YM/Uf7divGMwej24aexyIehMpF+mjwPmiYCpZLcAPL 37iJ8GgxONMX67uq/T2cMOcEH7goDkxgUTMHgZokYp1nKfsldH6WuONX7/kGxb9l i4JjfOqQC03DS2JbHmfBoyXZ9YrRVvwn09TrZeWE= 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=si5JxHkV4 IjFOqaqU0axtIfrdKA=; b=IgAtDY6Rzl8TWcnCgkDt9Ovx7L1VgIIyN9ADX+PW0 d6TtiJ37zHvvRZ9q5Z+svcWng2tNarAKw5bboh81AvD9F1Gix7DIHjC+ZS9YKvhK YxgI12ZN9GHOjB6idjUxNAvioh8OIrd6eU8JjprtO5j0smKeCVWkipfJArOkY/L1 1w= Received: (qmail 126100 invoked by alias); 15 May 2019 12:45:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 123637 invoked by uid 89); 15 May 2019 12:45:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.3 required=5.0 tests=AWL, 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.1 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; Wed, 15 May 2019 12:45:01 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCgjDx007236 for ; Wed, 15 May 2019 14:44:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=Sc4Lrh6FgSywCe8yJCDv86OekHAZ/99PmPitmfiYFDY=; b=JQVy6Xk3SZ542ss62oRlR3txzKsgrQWygnswfUjHF/5ZlpVYIh56csWb58lLriBVzAt6 WIiKaUcXInKTtJSOjoso936KZ7NAF1VSOcSmKvRZC3AEk+/ZEMlbofLlDDokWiYgwdpB PnxUCjS0YdYYXyXHOaaPpFcpLi8IQUuKlbpx2ihh9R3UMReorqS3XShKeqD3l4XTV78r IiCtzpcO+Bu7leDxUn+ohL2akbrP1VzIwSBeSoUBg2yM+RytG2CNpBjabY6Nujl8/jjT fDngy18YQm4TbNj5nfV9ZKDV2aWdGAc4JsWZ4tB9IONv2d7FDLBtEHKbYVLIzc1ijnBW Og== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sdkv00h8e-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:44:58 +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 30F2434 for ; Wed, 15 May 2019 12:44:58 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 110BD2761 for ; Wed, 15 May 2019 12:44:58 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:44:57 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 14/21] [ARM][testsuite] FDPIC: Skip unsupported tests Date: Wed, 15 May 2019 14:39:39 +0200 Message-ID: <20190515124006.25840-15-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Several tests cannot work on ARM-FDPIC for various reasons: skip them, or skip some directives. gcc.dg/20020312-2.c: Skip since it forces -fno-pic. gcc.target/arm/: * Skip since r9 is clobbered by assembly code: 20051215-1.c mmx-1.c pr61948.c pr77933-1.c pr77933-2.c * Skip since the test forces armv5te which is not supported by FDPIC: pr40887.c pr19599.c * Skip since FDPIC disables sibcall to external functions: sibcall-1.c tail-long-call vfp-longcall-apcs * Skip size check since it's different for FDPIC: ivopts-2.c ivopts-3.c ivopts-4.c ivopts-5.c pr43597.c pr43920-2.c * Disable assembler scanning invalid for FDPIC: pr45701-1.c pr45701-2.c stack-red-zone.c * gnu2 TLS dialect is not supported by FDPIC: tlscall.c * Test relies on symbols not generated in FDPIC: data-rel-2.c data-rel-3.c 2019-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 c584d35..3df99d9 100644 --- a/gcc/testsuite/gcc.dg/20020312-2.c +++ b/gcc/testsuite/gcc.dg/20020312-2.c @@ -9,6 +9,7 @@ /* { dg-options "-O -fno-pic" } */ /* { dg-additional-options "-no-pie" { target pie_enabled } } */ /* { dg-require-effective-target nonlocal_goto } */ +/* { dg-skip-if "" { arm*-*-uclinuxfdpiceabi } "*" "" } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.target/arm/20051215-1.c b/gcc/testsuite/gcc.target/arm/20051215-1.c index 0519dc7..cc07693 100644 --- a/gcc/testsuite/gcc.target/arm/20051215-1.c +++ b/gcc/testsuite/gcc.target/arm/20051215-1.c @@ -3,6 +3,7 @@ the call would need an output reload. */ /* { dg-do run } */ /* { dg-options "-O2 -fno-omit-frame-pointer" } */ +/* { dg-skip-if "r9 is reserved in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ extern void abort (void); typedef void (*callback) (void); diff --git a/gcc/testsuite/gcc.target/arm/data-rel-2.c b/gcc/testsuite/gcc.target/arm/data-rel-2.c index 6ba47d6..7d37a8c 100644 --- a/gcc/testsuite/gcc.target/arm/data-rel-2.c +++ b/gcc/testsuite/gcc.target/arm/data-rel-2.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "Not supported in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-options "-fPIC -mno-pic-data-is-text-relative -mno-single-pic-base" } */ /* { dg-final { scan-assembler-not "j-\\(.LPIC" } } */ /* { dg-final { scan-assembler "_GLOBAL_OFFSET_TABLE_-\\(.LPIC" } } */ diff --git a/gcc/testsuite/gcc.target/arm/data-rel-3.c b/gcc/testsuite/gcc.target/arm/data-rel-3.c index 2ce1e66..534c6c4 100644 --- a/gcc/testsuite/gcc.target/arm/data-rel-3.c +++ b/gcc/testsuite/gcc.target/arm/data-rel-3.c @@ -1,3 +1,4 @@ +/* { dg-skip-if "Not supported in FDPIC" { arm*-*-uclinuxfdpiceabi } "*" "" } */ /* { dg-options "-fPIC -mpic-data-is-text-relative" } */ /* { dg-final { scan-assembler "j-\\(.LPIC" } } */ /* { dg-final { scan-assembler-not "_GLOBAL_OFFSET_TABLE_-\\(.LPIC" } } */ diff --git a/gcc/testsuite/gcc.target/arm/ivopts-2.c b/gcc/testsuite/gcc.target/arm/ivopts-2.c index afe91aa..f1d5edb 100644 --- a/gcc/testsuite/gcc.target/arm/ivopts-2.c +++ b/gcc/testsuite/gcc.target/arm/ivopts-2.c @@ -14,4 +14,4 @@ tr4 (short array[], int n) /* { dg-final { scan-tree-dump-times "PHI X-Patchwork-Id: 164290 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp606825oca; Wed, 15 May 2019 05:45:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxChRIOqx/JviEc+LfpeQi6tEzFyDKr3X0IoDYXItlN3mp/5pKFjpXRlRZBgyd3JyVvI1NX X-Received: by 2002:a63:f54c:: with SMTP id e12mr44109981pgk.62.1557924346303; Wed, 15 May 2019 05:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924346; cv=none; d=google.com; s=arc-20160816; b=KKidJH6a9G0mXXHk9etIBGq4Ku5cuWvL2B+EEfPGjaG9WGo8N0hLjceSEHSdK57UvI hroOOMhv2DsgctZ+Ehk0ukQwjB9XOVFZ1RkOCeqmXTQ3TtLFPSlIqckCwcvGMH6mamf3 DVnVApO92hAK1XHw8CA/QdSGyG2g8UxnLtLt8Bs9WiYpi2TKL5kSCs6c7GZiadt8yywR DhUiUycZZYLIm5ePqZXYWqhe5JH8nHH8sGx7KqB30N6OBsxkIuaDlLXEuH3zCvHhZctf unIwXjk3EjVR4xqIRKtDZDBImouVjHxlfFQQb3tHNzji+NYhagumbPk6gN3rnzdntZFQ WFKQ== 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:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=kahJ+KpkzCNlv9KyqLkSds2W5XnpboqQU70EQdZ32wQ=; b=ZPPiyxJotYT+86W/zs5Dk41Vv8U5S5snBuvXZQifx5qKx+cZhoR9VlPmAOTUnT1xQM u1nT6M9s+RiR37H4PXhM0MU8C/KJCyU2roRlSC8cEztsRs4+zFCZg6mzzkNDEhmMr95a kx+QhUGhYXLkb4sUI6hUxz1bR0elfL254ImZf/A2wSjVvbwgBxQKWpXEMlDrtLBxB+lF vlsvfCC7nbBt30RBTkehCExjL+vKS4KCeRUKSu7UhNyy8K+ihrSZx6uRXCykMgfONwvw DFcHek4FH5ozc/mA3/HuDR4DjOcSFHk9JimUBiSKR1Lj657/DQXf8zwHJTYmbiRONQ48 ft8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=prTq3okH; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=W1CJM6DC; spf=pass (google.com: domain of gcc-patches-return-500779-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500779-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 b62si1792781pga.51.2019.05.15.05.45.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:45:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500779-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=prTq3okH; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=W1CJM6DC; spf=pass (google.com: domain of gcc-patches-return-500779-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500779-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=ssD 9zr1BxieU4dkfJvoRftWS4tuWd71n7PHhSQdLtwwjZ7tPh9MmQs2PhYpdLVClIEK VKRndaOQVhd4tOLC1cmKoxnfxORHPUgwPRJ6bWOOvSER5Nw0htoROS0giTV+s+fr 0mqB6f9WZX9gg2yjguBGygTAEupO08a7YxjxynmM= 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=+HhvRUS1F DVamAfzpcJUrehwHNY=; b=prTq3okHhVCzmdDSOaeqPr7/wnaEmMHK5C0y2vO8o tR0r+rcUhSIJl/VLLrfKH3kV78DVJyE94ntGh/Rwcacdsg/KrATGinCaHA6QSAsm BKRBDN4ZTwfvaN/W1uM6ts3ahH0CheyXNWBz+JAxAy+NVR5fCGrbFdoxmixx+dYC Z4= Received: (qmail 39740 invoked by alias); 15 May 2019 12:45:32 -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 28989 invoked by uid 89); 15 May 2019 12:45:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.4 required=5.0 tests=AWL, 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.1 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; Wed, 15 May 2019 12:45:24 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCggZY007108 for ; Wed, 15 May 2019 14:45:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=kahJ+KpkzCNlv9KyqLkSds2W5XnpboqQU70EQdZ32wQ=; b=W1CJM6DCjiesPnVE9zTO+L7GGzgU6eRXxX6/faO2CKkqXzNrZiqlYGp5tW+x7mlRvzxi EFQg19tyIMW+4IbBxNpyoFjxsC5mfdxr08g3twAumNugZx3iyXAPBHKa0PJ7VELqFgfb GPVOZC8ZXM3DLsHve9offG75DaKtDgnQTgkXIxgEWKRUGpBf9p7Q6xXVACfz84HTe1gy Mf59K1OqflSF94kwj+UjgDbx26FYNgsSUSiUV3GqhD3QLQZMJ3N+KUxT2AhKioH+BOTD xL32q7VDdb4go5ayoZqWT/k59FRCdaxqxLIAgxQEqVr4sBtJNmER0Fr4HT42I5SNc0GC GQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sdkv00ha9-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:45:19 +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 6005931 for ; Wed, 15 May 2019 12:45:18 +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 412F32414 for ; Wed, 15 May 2019 12:45:18 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:45:17 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 15/21] [ARM][testsuite] FDPIC: Adjust scan-assembler patterns. Date: Wed, 15 May 2019 14:39:40 +0200 Message-ID: <20190515124006.25840-16-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes In FDPIC mode, r9 is saved in addition to other registers, so update the expected patterns accordingly. 2019-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 Wed May 15 12:39:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164291 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp607034oca; Wed, 15 May 2019 05:45:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhztH2hknTM0zs6zv844tmB6NxJN0slCBwxqxC9pjLZslT36dr1REbStB52stP8XSL1MGN X-Received: by 2002:a17:902:868c:: with SMTP id g12mr26290889plo.323.1557924359176; Wed, 15 May 2019 05:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924359; cv=none; d=google.com; s=arc-20160816; b=g8CDw621+fS/7cKSb+h7gHPmD0cTJOw3NZbLWaHb5yq4ORbXP+NdJG6Y/JUdd8YY5B vcyFgX0gitAfxt+4dbt0UkcxdIx/M+a8F8PR7AS9xiH1edhe6+svWbSCWRBf0B0binbM FQxFGPeANXY5dMBrYsTPBknQTqUsQ/nph7O9ei/NaRV4X54vAbB7vK3Zx9b2KktFcwHZ yGyOeK+rMtCT8750SaJ7I1qWdFXxP/Nge+IT9rWVcanfyp+fNpKikRYpWIUBnhtvAs3k xbmbFFS6irots3/3IoopMnMYwCez4Cbtq4u3xe8bxlXH180T6SeUFkj1oPMeve6ZDCF2 diEQ== 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 :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=TsFiw0VVOnQIZsCJm8I7eHxf1Qs3dnutxTktdyIVuKY=; b=h3jte1fkqFGL7Ps3nSSoiZSt0FpXUnr0jYcy54Q2VuJ/tgrtGJYSNO8N8v6MXxK8bd cNyv2p9MTJIHtY4pC+9AMVoTBGB1Ws49c/bhwuchWms/czk9vrGSSoFueWSvsil2RR4x n2M+q09ScUM91WBfW0/ByEVg9Gpp6RgvjKsTiKKpShYp7sG/YOCBRauJOfchinna35T7 8DZRpeC8Wx8fpbDHU8YTaZSBHifJ4XIwhXcJ9h8tV+8QXqTSJj7FgKo2UFpJzkyily1C JnUlCVDfrP3yw+ryovK6xMinhdVmbmkY5rFv6RtGEEpd6nFapD2nK2iwvCv89EeGoFOx h8Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mhEsKacK; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=TvCYnsMj; spf=pass (google.com: domain of gcc-patches-return-500780-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500780-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 g17si2077566pfb.29.2019.05.15.05.45.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:45:59 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500780-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=mhEsKacK; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=TvCYnsMj; spf=pass (google.com: domain of gcc-patches-return-500780-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500780-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=Zzw+N+/14tj9xCvpx5SaNZIf1qnX/ 5OmOZ/ZNfZ7so08a7gYD2JwLGGd4Dn42AGt8MX7hB4ZKEEgPub5T1eOgIFy0r33M NviZq1ya4aPmUUkvtTljxB7tqM6kLygo1OIk0lAYTuf18LqlLPO1ghfiLUonzneT YVVCy3b8Q93FbY= 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=8OIX8AIbmA7c7GyATM/42gjCTjY=; b=mhE sKacK4YaukHpddUCrAcQQARNaaBxI6sazOJHS/B+V8PBxNAWfe9jZhtJjwKdtiYE swqp4iO8VoC8fh8y/ORJou2qX5AM3pkuyhz340qJml/jGb9qIcQC81ypGFoDSl+o S9SgsSo/9Cs4SarKNaUkszyf/hqiI0Qtb799ItCs= Received: (qmail 45595 invoked by alias); 15 May 2019 12:45: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 44397 invoked by uid 89); 15 May 2019 12:45:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.5 required=5.0 tests=AWL, 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.1 spammy=gdwarf2, gdwarf-2, *-*-solaris2.* 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; Wed, 15 May 2019 12:45:43 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCggZb007108 for ; Wed, 15 May 2019 14:45:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=TsFiw0VVOnQIZsCJm8I7eHxf1Qs3dnutxTktdyIVuKY=; b=TvCYnsMjtphKrTqZu3X7laaJuAaFf+CWsiHdOFAyLMsqi1vChYt0B6xZ6FIX5UY5NjnF q92o3bgq4XqgF8siTHeonGfXkqc2TVUONGuBBxoX76Bw5b66RU834YpBXoYCAxazEyUs eGczQCCEIdMfbZqLTcE3oBsH5I37Nl/9EV+hmJ5j6ovlVhjNa5Fx63XW6+sJQBi1vVb7 nEKKXd9ATyzY8WqcrJ4XE6k8jF5KUzFPBeJVNAG+G4/BcpAhx3o/WLFtTjxrt0g92MMt Pzmu1zYGrgggmTINYwJsuLQ27s1dpqfFIPpXTZD/lpWv8+0LaQQbdLD43mlVFVtHbyPL IQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sdkv00hch-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:45:39 +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 CC2AC34 for ; Wed, 15 May 2019 12:45:38 +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 6FE1324C5 for ; Wed, 15 May 2019 12:45:38 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:45:37 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 16/21] [ARM][testsuite] FDPIC: Skip tests that don't work in PIC mode Date: Wed, 15 May 2019 14:39:41 +0200 Message-ID: <20190515124006.25840-17-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Some tests fail on arm*-*-uclinuxfdpiceabi because it generates PIC code and they don't support it: skip them. They also fail on arm*-linux* when forcing -fPIC. 2019-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 Wed May 15 12:39:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164292 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp607356oca; Wed, 15 May 2019 05:46:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjgHaK9fkkvdeUXfryGXIN0QhH3fP9b/qb6hSvVdlYsdkvGATAmKQvdTvGqK1VnkfjPc7w X-Received: by 2002:a17:902:f24:: with SMTP id 33mr43390234ply.33.1557924379751; Wed, 15 May 2019 05:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924379; cv=none; d=google.com; s=arc-20160816; b=Ss7pDM58nHvbYkdcUZ4Cx2sd7psy7oGXkW5NSFpzGYPqdjY0zneUB6fALOpDd4hXJ/ E+G6ElkULYVCRfmJM5gTAnL5iryXLGoQMcuzjHygYFuplS6rxsvrHlj+WcgZyS4661MS 6tl8f5k7UfLh02kg4wnMBpv9uDEzhiBmjHLqUQcX0PokKCL1BSH3zKdyLpC25CI9toev Nmrc6nEikeOb/1A6yd6hB70V7LG6xBwCFAaTwW8kvug0BMyXQLFqgGWndoTMw1dY+sw9 v5b0HX0PJu0HPFUFMo4lT9p/e/J/YuYzTZ5oogQWzXOP6YMaCGgBTrv9U1BeKYtsfaFr /a5g== 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 :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=JL8xuBL0h/ohLifTyyj0JjgaCpPQ1yqbq7qiQYB7SX0=; b=zIEfzO0C0nGbACm8ER59Eu332/7fn45v+2aljND2hpakWM6gh7gOu+Csndfa0YYgrs 3f2qCvAkeRUywm/xlKa6TdUMsmgdEPN+hb5aQO6u/obD5nJC57qTk3BYGVo1v3ySbm/8 uIR6F9zH0azznK7I+qC5oEzRoBFgtiIVj5GvQCQSh6sRg5hR4M+rWb6D1soRCu0aFYFX HlzHAJEZ09kJnqFAVpWigGGSPiJA7TdRwXxAXFXsvq7mcwM+50v/KPT+vAHVt1Nvidsp wInI+8Sz/95GswLF/xAJsBsf0FSsdykrKSTu+I7XRlVfX/74bf134wRAOQcSsgxgmvJP PdDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=VyISXHwM; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=Zfsj9dl2; spf=pass (google.com: domain of gcc-patches-return-500781-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500781-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 j23si1801338pgg.541.2019.05.15.05.46.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:46:19 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500781-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=VyISXHwM; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=Zfsj9dl2; spf=pass (google.com: domain of gcc-patches-return-500781-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500781-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=g+M1MVXnZU3p0amrNCDGr0kdnRg71 x7XyBJ9I7emAab9VloGlWrcguK+B/vOcL77p07CZFRQ3l3RVRomLRm4XiBoJ5mBb V0hQdm9wY7ceIEXyQZv2c/xAZUCL3uNeSiJHHdCTGHyGQoccSHMAquJOthdkKWBZ i+jiCK4djxR8zQ= 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=JSwNmbNBKtqQyq7KyacKToYZORY=; b=VyI SXHwM00BFVb+y2iN4odta0fkyMMoVFqWWH93tPLdaysbpSBI3kWhVm+JHrH34XHw Gf1vUo22Vm/4SOlQVcgtk1+c3IhUV4dqqnjl22aV2UacdH99gr6xmzOmhKmeCroZ r5TapNDXjs0NIhE6BRzowKm4k2TL765P+GRbCnwE= Received: (qmail 76197 invoked by alias); 15 May 2019 12:46:06 -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 75112 invoked by uid 89); 15 May 2019 12:46:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.7 required=5.0 tests=AWL, 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.1 spammy=realtime, Performing X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 May 2019 12:46:01 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCg52V010214 for ; Wed, 15 May 2019 14:45:59 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=JL8xuBL0h/ohLifTyyj0JjgaCpPQ1yqbq7qiQYB7SX0=; b=Zfsj9dl2yaJx/+AYWsL++3YkWitkhnTvOZFYiiEGPWKwLxr91B3N8n1NA+HrKUY2Hf3W LFQUhPvuZLq/sBuMdpNQqd8g0LeNC/lQ9i7wt4MVsrPDwrLTVXlfS05Nmc1ZqV/leAlY GmW4VmWW8+DbGerLygiQ2AZI7MEZMhNBvQTJOEZL4vBDLl8qIZ4LFfe4z5OP3OQy07sz 7qxbTBkONonwb1HJ9KTq2tpt7jYGhIqtE0g57Ijr0GK+jzVLYl78+ycGRNBmHeIXwuzK dLXAMJ9qJKbez80ufIwArqtWhyvwmTBoB2RYamzaJhsQqjR7EGG7GxmNoqq+T3EFxaBQ fA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sg0an6brn-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:45:59 +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 D1D8031 for ; Wed, 15 May 2019 12:45:58 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B19702764 for ; Wed, 15 May 2019 12:45:58 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:45:57 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 17/21] [ARM][testsuite] FDPIC: Handle *-*-uclinux* Date: Wed, 15 May 2019 14:39:42 +0200 Message-ID: <20190515124006.25840-18-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Add *-*-uclinux* to tests that work on this target. 2019-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 8a2de48..029afb0 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* } } */ /* FIXME The following additional option should be removed after the fix for radr://19802258. /* { dg-xfail-run-if "PR60563 radr://19802258" { *-*-darwin* } } */ /* { dg-require-effective-target sync_long_long_runtime } */ 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 1af63ea..9fc8658 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" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through signal frames diff --git a/gcc/testsuite/gcc.dg/cleanup-11.c b/gcc/testsuite/gcc.dg/cleanup-11.c index c1f19fe..6b499d4 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" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through realtime signal diff --git a/gcc/testsuite/gcc.dg/cleanup-8.c b/gcc/testsuite/gcc.dg/cleanup-8.c index 45abdb2..87f4186 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" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through signal diff --git a/gcc/testsuite/gcc.dg/cleanup-9.c b/gcc/testsuite/gcc.dg/cleanup-9.c index 98dc268..d34ce12 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" } */ /* { dg-require-effective-target exceptions } */ /* Verify that cleanups work with exception handling through realtime diff --git a/gcc/testsuite/gcc.dg/fdata-sections-1.c b/gcc/testsuite/gcc.dg/fdata-sections-1.c index 51686b9..e8a6639 100644 --- a/gcc/testsuite/gcc.dg/fdata-sections-1.c +++ b/gcc/testsuite/gcc.dg/fdata-sections-1.c @@ -1,7 +1,7 @@ /* PR middle-end/15486 */ /* Origin: Jonathan Larmour */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-fdata-sections" } */ int x; diff --git a/gcc/testsuite/gcc.dg/fdata-sections-2.c b/gcc/testsuite/gcc.dg/fdata-sections-2.c index dda90ba7..48d44a2 100644 --- a/gcc/testsuite/gcc.dg/fdata-sections-2.c +++ b/gcc/testsuite/gcc.dg/fdata-sections-2.c @@ -4,7 +4,7 @@ /* This checks that string constants are put in per-function rodata sections, so that they can be garbage collected. */ -/* { dg-do compile { target *-*-linux* } } */ +/* { dg-do compile { target *-*-linux* *-*-uclinux* } } */ /* { dg-options "-O -ffunction-sections -fdata-sections" } */ const char *f1(void) { return "falderalde"; } diff --git a/gcc/testsuite/gcc.dg/pr39323-1.c b/gcc/testsuite/gcc.dg/pr39323-1.c index 7a7fd63..d84009c 100644 --- a/gcc/testsuite/gcc.dg/pr39323-1.c +++ b/gcc/testsuite/gcc.dg/pr39323-1.c @@ -1,5 +1,5 @@ /* PR c/39323 - MAX_OFILE_ALIGNMENT in elfos.h is too big */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ int foo __attribute__ ((aligned(1 << 29))) = 20; /* { dg-error "requested alignment" } */ typedef int __attribute__ ((aligned(1 << 29))) int29; /* { dg-error "requested alignment" } */ diff --git a/gcc/testsuite/gcc.dg/pr39323-2.c b/gcc/testsuite/gcc.dg/pr39323-2.c index a870729..6b6cb2e 100644 --- a/gcc/testsuite/gcc.dg/pr39323-2.c +++ b/gcc/testsuite/gcc.dg/pr39323-2.c @@ -1,5 +1,5 @@ /* PR c/39323 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ int bar __attribute__ ((aligned(1 << 28))) = 20; diff --git a/gcc/testsuite/gcc.dg/pr39323-3.c b/gcc/testsuite/gcc.dg/pr39323-3.c index b452d3c..2e2c1a2 100644 --- a/gcc/testsuite/gcc.dg/pr39323-3.c +++ b/gcc/testsuite/gcc.dg/pr39323-3.c @@ -1,5 +1,5 @@ /* PR c/39323 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ typedef int __attribute__ ((aligned(1 << 28))) int28; int28 foo = 20; diff --git a/gcc/testsuite/gcc.dg/pr65780-1.c b/gcc/testsuite/gcc.dg/pr65780-1.c index b586211..5e3226e 100644 --- a/gcc/testsuite/gcc.dg/pr65780-1.c +++ b/gcc/testsuite/gcc.dg/pr65780-1.c @@ -1,5 +1,5 @@ /* PR target/65780 */ -/* { dg-do link { target *-*-linux* *-*-gnu* } } */ +/* { dg-do link { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ int optopt; diff --git a/gcc/testsuite/gcc.dg/pr65780-2.c b/gcc/testsuite/gcc.dg/pr65780-2.c index bff3323..932cbe1 100644 --- a/gcc/testsuite/gcc.dg/pr65780-2.c +++ b/gcc/testsuite/gcc.dg/pr65780-2.c @@ -1,5 +1,5 @@ /* PR target/65780 */ -/* { dg-do link { target *-*-linux* *-*-gnu* } } */ +/* { dg-do link { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-require-effective-target pie } */ /* { dg-options "-O2 -fpie" } */ diff --git a/gcc/testsuite/gcc.dg/pr67338.c b/gcc/testsuite/gcc.dg/pr67338.c index 0fdc302..7bfbef2 100644 --- a/gcc/testsuite/gcc.dg/pr67338.c +++ b/gcc/testsuite/gcc.dg/pr67338.c @@ -1,4 +1,4 @@ /* PR c/67338 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ struct S { __attribute__((aligned (1 << 28))) double a; }; diff --git a/gcc/testsuite/gcc.dg/pr78185.c b/gcc/testsuite/gcc.dg/pr78185.c index 405f748..d7781b2 100644 --- a/gcc/testsuite/gcc.dg/pr78185.c +++ b/gcc/testsuite/gcc.dg/pr78185.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O" } */ #include diff --git a/gcc/testsuite/gcc.dg/pr83100-1.c b/gcc/testsuite/gcc.dg/pr83100-1.c index 233c1f6..ccfb8c6 100644 --- a/gcc/testsuite/gcc.dg/pr83100-1.c +++ b/gcc/testsuite/gcc.dg/pr83100-1.c @@ -1,5 +1,5 @@ /* PR target/83100 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fcommon -fdata-sections" } */ const int a; diff --git a/gcc/testsuite/gcc.dg/pr83100-4.c b/gcc/testsuite/gcc.dg/pr83100-4.c index bb26735..2f83247 100644 --- a/gcc/testsuite/gcc.dg/pr83100-4.c +++ b/gcc/testsuite/gcc.dg/pr83100-4.c @@ -1,5 +1,5 @@ /* PR target/83100 */ -/* { dg-do compile { target *-*-linux* *-*-gnu* } } */ +/* { dg-do compile { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fno-common -fdata-sections" } */ const int a; diff --git a/gcc/testsuite/gcc.dg/strlenopt-12g.c b/gcc/testsuite/gcc.dg/strlenopt-12g.c index f1dec1f..fb0eeb2 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-12g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-12g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-14g.c b/gcc/testsuite/gcc.dg/strlenopt-14g.c index 62a83bf..8bce645 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-14g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-14g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy and mempcpy functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ /* Bionic targets don't have mempcpy */ /* { dg-require-effective-target non_bionic } */ diff --git a/gcc/testsuite/gcc.dg/strlenopt-14gf.c b/gcc/testsuite/gcc.dg/strlenopt-14gf.c index 8b126fc..cc9092b 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-14gf.c +++ b/gcc/testsuite/gcc.dg/strlenopt-14gf.c @@ -1,6 +1,6 @@ /* This test needs runtime that provides stpcpy, mempcpy and __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ /* Bionic targets don't have mempcpy */ /* { dg-require-effective-target non_bionic } */ diff --git a/gcc/testsuite/gcc.dg/strlenopt-16g.c b/gcc/testsuite/gcc.dg/strlenopt-16g.c index 0cf8410..8b8f0d6 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-16g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-16g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-17g.c b/gcc/testsuite/gcc.dg/strlenopt-17g.c index 184e530..0d5f559 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-17g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-17g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-18g.c b/gcc/testsuite/gcc.dg/strlenopt-18g.c index f734675..e3706d2 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-18g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-18g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-1f.c b/gcc/testsuite/gcc.dg/strlenopt-1f.c index 856774d..bb320ab 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-1f.c +++ b/gcc/testsuite/gcc.dg/strlenopt-1f.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinu* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define FORTIFY_SOURCE 2 diff --git a/gcc/testsuite/gcc.dg/strlenopt-22g.c b/gcc/testsuite/gcc.dg/strlenopt-22g.c index 9c5d020..348903f 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-22g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-22g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-2f.c b/gcc/testsuite/gcc.dg/strlenopt-2f.c index 1e915da..f61a8ba 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-2f.c +++ b/gcc/testsuite/gcc.dg/strlenopt-2f.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define FORTIFY_SOURCE 2 diff --git a/gcc/testsuite/gcc.dg/strlenopt-31g.c b/gcc/testsuite/gcc.dg/strlenopt-31g.c index 45cc29c..3588b06 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-31g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-31g.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-33g.c b/gcc/testsuite/gcc.dg/strlenopt-33g.c index 7d24d2b..8566782 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-33g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-33g.c @@ -1,4 +1,4 @@ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-4g.c b/gcc/testsuite/gcc.dg/strlenopt-4g.c index 879d566..c6a2d6f 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-4g.c +++ b/gcc/testsuite/gcc.dg/strlenopt-4g.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy function. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strlenopt-4gf.c b/gcc/testsuite/gcc.dg/strlenopt-4gf.c index 7f261b7..2783c3b 100644 --- a/gcc/testsuite/gcc.dg/strlenopt-4gf.c +++ b/gcc/testsuite/gcc.dg/strlenopt-4gf.c @@ -1,5 +1,5 @@ /* This test needs runtime that provides stpcpy and __*_chk functions. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ #define USE_GNU diff --git a/gcc/testsuite/gcc.dg/strncmp-2.c b/gcc/testsuite/gcc.dg/strncmp-2.c index f5555ba..6818b30 100644 --- a/gcc/testsuite/gcc.dg/strncmp-2.c +++ b/gcc/testsuite/gcc.dg/strncmp-2.c @@ -1,5 +1,5 @@ /* Test strncmp builtin expansion for compilation and proper execution. */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-options "-O2" } */ /* { dg-require-effective-target ptr32plus } */ diff --git a/gcc/testsuite/gcc.dg/struct-ret-3.c b/gcc/testsuite/gcc.dg/struct-ret-3.c index 4083bb4..4c0a0e6 100644 --- a/gcc/testsuite/gcc.dg/struct-ret-3.c +++ b/gcc/testsuite/gcc.dg/struct-ret-3.c @@ -1,7 +1,7 @@ /* PR middle-end/31309 */ /* Origin: Peeter Joot */ -/* { dg-do run { target *-*-linux* *-*-gnu* } } */ +/* { dg-do run { target *-*-linux* *-*-gnu* *-*-uclinux* } } */ /* { dg-add-options stack_size } */ #include diff --git a/gcc/testsuite/gcc.dg/torture/pr69760.c b/gcc/testsuite/gcc.dg/torture/pr69760.c index 8f24608..53733c7 100644 --- a/gcc/testsuite/gcc.dg/torture/pr69760.c +++ b/gcc/testsuite/gcc.dg/torture/pr69760.c @@ -1,5 +1,5 @@ /* PR tree-optimization/69760 */ -/* { dg-do run { target { { *-*-linux* *-*-gnu* } && mmap } } } */ +/* { dg-do run { target { { *-*-linux* *-*-gnu* *-*-uclinux* } && mmap } } } */ /* { dg-options "-O2" } */ #include diff --git a/gcc/testsuite/gcc.target/arm/div64-unwinding.c b/gcc/testsuite/gcc.target/arm/div64-unwinding.c index 7f112ee..0944281 100644 --- a/gcc/testsuite/gcc.target/arm/div64-unwinding.c +++ b/gcc/testsuite/gcc.target/arm/div64-unwinding.c @@ -1,6 +1,6 @@ /* Performing a 64-bit division should not pull in the unwinder. */ -/* { dg-do run { target { ! *-*-linux* } } } */ +/* { dg-do run { target { { ! *-*-linux* } && { ! *-*-uclinux* } } } } */ /* { dg-options "-O0" } */ #include diff --git a/gcc/testsuite/gcc.target/arm/pr66912.c b/gcc/testsuite/gcc.target/arm/pr66912.c index 27e4c45..7e6294c 100644 --- a/gcc/testsuite/gcc.target/arm/pr66912.c +++ b/gcc/testsuite/gcc.target/arm/pr66912.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target *-*-linux* } } */ +/* { dg-do compile { target *-*-linux* arm*-*-uclinuxfdpiceabi } } */ /* { dg-options "-O2 -fpic" } */ __attribute__((visibility("protected"))) diff --git a/gcc/testsuite/gcc.target/arm/stack-checking.c b/gcc/testsuite/gcc.target/arm/stack-checking.c index 4b53bed..9d1d2b0 100644 --- a/gcc/testsuite/gcc.target/arm/stack-checking.c +++ b/gcc/testsuite/gcc.target/arm/stack-checking.c @@ -1,4 +1,4 @@ -/* { dg-do run { target { *-*-linux* } } } */ +/* { dg-do run { target { *-*-linux* *-*-uclinux* } } } */ /* { dg-require-stack-check "" } */ /* { dg-options "-fstack-check" } */ diff --git a/gcc/testsuite/gcc.target/arm/synchronize.c b/gcc/testsuite/gcc.target/arm/synchronize.c index 7ef10e2..912f407 100644 --- a/gcc/testsuite/gcc.target/arm/synchronize.c +++ b/gcc/testsuite/gcc.target/arm/synchronize.c @@ -1,4 +1,4 @@ -/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-* } } } */ +/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-* arm*-*-uclinux* } } } */ void *foo (void) { diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 4bb7da2..60d68f4 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1189,6 +1189,7 @@ proc check_effective_target_pie { } { || [istarget *-*-dragonfly*] || [istarget *-*-freebsd*] || [istarget *-*-linux*] + || [istarget arm*-*-uclinuxfdpiceabi] || [istarget *-*-gnu*] || [istarget *-*-amdhsa]} { return 1; @@ -6752,6 +6753,7 @@ proc check_effective_target_sync_long_long_runtime { } { } "" }]) || [istarget aarch64*-*-*] + || [istarget arm*-*-uclinuxfdpiceabi] || ([istarget arm*-*-linux-*] && [check_runtime sync_longlong_runtime { #include @@ -6812,6 +6814,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*] @@ -6836,6 +6839,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 Wed May 15 12:39:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164293 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp607636oca; Wed, 15 May 2019 05:46:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5zrbEgsH9IJCA3UwnQK9HjG32+3/+oeToxa+X42rRtW3PNlhbbe5c/gdrkOabGncreXFl X-Received: by 2002:a65:4105:: with SMTP id w5mr43653329pgp.260.1557924398951; Wed, 15 May 2019 05:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924398; cv=none; d=google.com; s=arc-20160816; b=Gcbd2ofQJRMuxDshviU8F5vlgBbAkyc1Ge9e4FhYpA6/2v3XihgO0WrqsTGKYpaKy8 51DFUx+STSGc0u/wpANQ/Png6BCiY/YOa2mdEsQoDWR0IR/1/zavn6S7udmNJY/b60If LZax+kbEubjUfTNDwNT3T36EkxNQjl90nOViyJLmURg8rDtjcSN4sbjUJUpuXGmMzQjq nWH6/m00EB6A1QsCWfwHYt9/lJgLlStgs1ykHnEcfB1eEeZmzQUuNSo1bv9RQTh1vyR0 0PD6ZjPLvTC5tF3Qew0ifN6e6iNwNCm102vjCSmkjAVxP5pLJU+MOoHe4R3aofKin4fA wjZw== 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 :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=XO3QssRJVumBF4PjXIV9TPLnDdMSRE8vzoG9lsIUjeA=; b=ywJWzwB79c6ap1s35GkBLfQumVyxoj2uyLnfBm1LNaeGzqRlizLc9zIob/1tnysie2 twezqANZQQDTIU1vwj/P8/XiE+YIjaUVVyNTYEFLDFXyE4p5lDiyy3HLpy5+NcuI4ASC NtJiuMTisFIDajP+4jdmkm3WpD+kIojb9sgKm+gM19lLVR5RCfYVoNstK+rjfN1CLuHR CFVfGw6MUfW/e+Y+7LIJXN1x6FEaZ4C+ZqTTXyNLaBRWeu83nse/Y39RwhUPU2pD0Tvx T7nc++jknp7KV1mGC85F2JkIRORf3riJyg0Nepu7wA042NMKlPuDeg6kGhstX7Zxc7Sc SwuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=MTuKIL2l; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=l5w15XD9; spf=pass (google.com: domain of gcc-patches-return-500782-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500782-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 l1si1768992pgi.344.2019.05.15.05.46.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500782-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=MTuKIL2l; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=l5w15XD9; spf=pass (google.com: domain of gcc-patches-return-500782-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500782-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=Wes4sWs0X/JMuXWUoo++QOr/1csVG Q6qr5/pIdGETZYrrZ8HawkWG+THx5Sdm8/rwDTR7Pq1/VUw/FZbguC2fOycgrFBp GQZzS6Blza1tYHxQM7kzxn+IwHWgm5LVp4JnJEaIReCgVdin1Szod/46IAOvTURo VyiQKxXjUVsIeE= 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=jdc/9YdmE2CE3RCVM3ZrMlrpSLk=; b=MTu KIL2lwhaRjvU88TWppOeFAbDBoLbNXyjiXPtMlz0gU3oODF0qP2R+T+1xv43jRbE 8FujUuBOzvb2h9LHW777Fq6bZ3wV4BNlsCVsYVY2qifKfQQmKUWO+47SW43QCmHp SmTAOYcBqQ7uTVxhCml6CgSOrTkgYz9wkInkdZh4= Received: (qmail 88636 invoked by alias); 15 May 2019 12:46: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 87488 invoked by uid 89); 15 May 2019 12:46:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.8 required=5.0 tests=AWL, 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.1 spammy=ab 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; Wed, 15 May 2019 12:46:21 +0000 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCk5ka012878 for ; Wed, 15 May 2019 14:46:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=XO3QssRJVumBF4PjXIV9TPLnDdMSRE8vzoG9lsIUjeA=; b=l5w15XD9cOHRVKNwFiwrUILfdfV8bSXAsWBhsffHCibeu5z6buD2CQRle72bkeJR4CN/ PwfzlsJr+E+1hXJbE/BiE6giR7S/FpQdS2Qm9BpGCisvECcERhDpApX+bt8D5lNt15Hs 2RCBBxFeeOTxHE0nIc/uRntttB4qHGsVJMlc4CwUtbjCNSrjYD3kwSolvK0/xLHc4r49 31JFLSFeTC6+Lq1wfBQI6iWwhLgys0UuPh0ojJDaa0mzeBAAh8QOxGVzMxaEDWzYxlb4 W2PIhWKsgZ9PjRZatma8RtSfFcWwWNm2Ziw868SybK/gdO/Q+orKyIQfdMh0igEb2gVJ Zg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sg0an6btv-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:46:19 +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 08F5A31 for ; Wed, 15 May 2019 12:46:19 +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 E24D92769 for ; Wed, 15 May 2019 12:46:18 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:46:18 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 18/21] [ARM][testsuite] FDPIC: Enable tests on pie_enabled targets Date: Wed, 15 May 2019 14:39:43 +0200 Message-ID: <20190515124006.25840-19-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Some tests have the "nonpic" guard, but pass on arm*-*-uclinuxfdpiceabi because it is in PIE mode by default. Rather than adding this target to all these tests, add the "pie_enabled" effective target. 2019-XX-XX Christophe Lyon gcc/testsuite/ * g++.dg/cpp0x/noexcept03.C: Add pie_enabled. * g++.dg/ipa/devirt-c-7.C: Likewise. * g++.dg/ipa/ivinline-1.C: Likewise. * g++.dg/ipa/ivinline-2.C: Likewise. * g++.dg/ipa/ivinline-3.C: Likewise. * g++.dg/ipa/ivinline-4.C: Likewise. * g++.dg/ipa/ivinline-5.C: Likewise. * g++.dg/ipa/ivinline-7.C: Likewise. * g++.dg/ipa/ivinline-8.C: Likewise. * g++.dg/ipa/ivinline-9.C: Likewise. * g++.dg/tls/pr79288.C: Likewise. * gcc.dg/addr_equal-1.c: Likewise. * gcc.dg/const-1.c: Likewise. * gcc.dg/ipa/pure-const-1.c: Likewise. * gcc.dg/noreturn-8.c: Likewise. * gcc.dg/pr33826.c: Likewise. * gcc.dg/torture/ipa-pta-1.c: Likewise. * gcc.dg/tree-ssa/alias-2.c: Likewise. * gcc.dg/tree-ssa/ipa-split-5.c: Likewise. * gcc.dg/tree-ssa/loadpre6.c: Likewise. * gcc.dg/uninit-19.c: Likewise. Change-Id: I1a0d836b892c23891f739fccdc467d0f354ab82c -- 2.6.3 diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C index 2d37867..906a44d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/noexcept03.C +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept03.C @@ -1,6 +1,6 @@ // Runtime test for noexcept-specification. // { dg-options "-Wnoexcept" } -// { dg-do run { target nonpic } } +// { dg-do run { target { nonpic || pie_enabled } } } // { dg-require-effective-target c++11 } #include diff --git a/gcc/testsuite/g++.dg/ipa/devirt-c-7.C b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C index 2e76cbe..efb65c2 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-c-7.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-c-7.C @@ -1,7 +1,6 @@ /* Verify that ipa-cp will not get confused by placement new constructing an object within another one when looking for dynamic type change . */ -/* { dg-do run } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -Wno-attributes" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-1.C b/gcc/testsuite/g++.dg/ipa/ivinline-1.C index 9b10d20..2d988bc 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-1.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-1.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls are inlined even without early inlining. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-2.C b/gcc/testsuite/g++.dg/ipa/ivinline-2.C index 21cd46f..d978638 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-2.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-2.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls using this pointer are inlined even without early inlining.. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-3.C b/gcc/testsuite/g++.dg/ipa/ivinline-3.C index 1e24644..f756a16 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-3.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-3.C @@ -1,6 +1,6 @@ /* Verify that simple virtual calls on an object refrence are inlined even without early inlining. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-4.C b/gcc/testsuite/g++.dg/ipa/ivinline-4.C index cf0d980..5fbd3ef 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-4.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-4.C @@ -1,7 +1,7 @@ /* Verify that simple virtual calls are inlined even without early inlining, even when a typecast to an ancestor is involved along the way. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-5.C b/gcc/testsuite/g++.dg/ipa/ivinline-5.C index f15ebf2..6c19907 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-5.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-5.C @@ -1,6 +1,6 @@ /* Verify that virtual call inlining does not pick a wrong method when there is a user defined ancestor in an object. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-7.C b/gcc/testsuite/g++.dg/ipa/ivinline-7.C index a7b41e7..fd6aba6 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-7.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-7.C @@ -1,7 +1,7 @@ /* Verify that simple virtual calls are inlined even without early inlining, even when a typecast to an ancestor is involved along the way and that ancestor is not the first one with virtual functions. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-8.C b/gcc/testsuite/g++.dg/ipa/ivinline-8.C index 5c3299f..bc81abf 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-8.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-8.C @@ -1,6 +1,6 @@ /* Verify that virtual calls are inlined (ithout early inlining) even when their caller is itself indirectly inlined. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/ipa/ivinline-9.C b/gcc/testsuite/g++.dg/ipa/ivinline-9.C index 41b2381..0917f15 100644 --- a/gcc/testsuite/g++.dg/ipa/ivinline-9.C +++ b/gcc/testsuite/g++.dg/ipa/ivinline-9.C @@ -2,7 +2,7 @@ inlining, even when a typecast to an ancestor is involved along the way and that ancestor itself has an ancestor wich is not the primary base class. */ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp" } */ extern "C" void abort (void); diff --git a/gcc/testsuite/g++.dg/tls/pr79288.C b/gcc/testsuite/g++.dg/tls/pr79288.C index 9f488df..da6751f 100644 --- a/gcc/testsuite/g++.dg/tls/pr79288.C +++ b/gcc/testsuite/g++.dg/tls/pr79288.C @@ -1,5 +1,5 @@ // PR c++/79288 -// { dg-do compile { target nonpic } } +// { dg-do compile { target { nonpic || pie_enabled } } } // { dg-require-effective-target tls } // { dg-options "-O2" } // { dg-final { scan-assembler-not "@tpoff" { target i?86-*-* x86_64-*-* } } } diff --git a/gcc/testsuite/gcc.dg/addr_equal-1.c b/gcc/testsuite/gcc.dg/addr_equal-1.c index 18b0dc9..35fa010 100644 --- a/gcc/testsuite/gcc.dg/addr_equal-1.c +++ b/gcc/testsuite/gcc.dg/addr_equal-1.c @@ -1,5 +1,4 @@ -/* { dg-do run } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-require-weak "" } */ /* { dg-require-alias "" } */ /* { dg-options "-O2 -fdelete-null-pointer-checks" } */ diff --git a/gcc/testsuite/gcc.dg/const-1.c b/gcc/testsuite/gcc.dg/const-1.c index a5b2b16..aa20aad 100644 --- a/gcc/testsuite/gcc.dg/const-1.c +++ b/gcc/testsuite/gcc.dg/const-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -Wsuggest-attribute=const" } */ extern int extern_const(int a) __attribute__ ((const)); diff --git a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c index 06b415e..dd58457 100644 --- a/gcc/testsuite/gcc.dg/ipa/pure-const-1.c +++ b/gcc/testsuite/gcc.dg/ipa/pure-const-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const -fdump-tree-optimized -fno-early-inlining -fgnu89-inline" } */ void abort (void); int error_code; diff --git a/gcc/testsuite/gcc.dg/noreturn-8.c b/gcc/testsuite/gcc.dg/noreturn-8.c index 294800b..ce41cab 100644 --- a/gcc/testsuite/gcc.dg/noreturn-8.c +++ b/gcc/testsuite/gcc.dg/noreturn-8.c @@ -1,4 +1,4 @@ -/* { dg-do run { target nonpic } } */ +/* { dg-do run { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2" } */ void exit (int); void noreturn_autodetection_failed (); diff --git a/gcc/testsuite/gcc.dg/pr33826.c b/gcc/testsuite/gcc.dg/pr33826.c index df83915..d222774 100644 --- a/gcc/testsuite/gcc.dg/pr33826.c +++ b/gcc/testsuite/gcc.dg/pr33826.c @@ -1,8 +1,7 @@ /* Regression test for PR middle-end/33826 */ /* Verify that recursive functions cannot be pure or const. */ -/* { dg-do compile } */ -/* { dg-require-effective-target nonpic } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O1 -fdump-tree-local-pure-const1 -fdump-ipa-pure-const" } */ int recurse1 (int); diff --git a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c index 1bf4997..30156a3 100644 --- a/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c +++ b/gcc/testsuite/gcc.dg/torture/ipa-pta-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { nonpic } } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-fipa-pta -fdump-ipa-pta2 -fno-ipa-icf" } */ /* { dg-skip-if "" { *-*-* } { "-O0" "-fno-fat-lto-objects" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c index e10a25d..f9d2dd4 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/alias-2.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { nonpic } } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -fdump-tree-optimized" } */ static int a; int f; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c index 2d713d6..3b5a94f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-5.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O3 -fdump-tree-fnsplit -fdump-tree-optimized --param=builtin-expect-probability=100" } */ struct a {int a,b;}; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c index 028becd..b4e9296 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre6.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target nonpic } } */ +/* { dg-do compile { target { nonpic || pie_enabled } } } */ /* { dg-options "-O2 -fdump-tree-pre-stats -fdump-tree-fre1" } */ #include From patchwork Wed May 15 12:39:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164294 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp607938oca; Wed, 15 May 2019 05:46:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyeW4JCirzf2+Vo1z0P9puQM1mTa2KBp9N6ayeqYIKOZ6pLWPj1aCJf09pHqnu3pBls0N3 X-Received: by 2002:a17:902:bf07:: with SMTP id bi7mr5782681plb.248.1557924417479; Wed, 15 May 2019 05:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924417; cv=none; d=google.com; s=arc-20160816; b=gJtEE4Wp5q4jnB/c8vshTsj0KTmoZOGLiFuXgWCkZAzEPa7oQMo+KvOI0EBlX9nK0T PqwABpXjWhzhUCEkLvvUpLWPKOaA96/jTAwacIcBfEiDJoHwdHiIfHW5AWtlD6CRcdXk 5Fj7B6mqQQsjVkPkGRG+kTlOzb9QI7NIxd/GyWK1xyDts5L1QPG89+gATsIiZBxTiSlj J1nA/4oafDWZl66pNq9ZXP3ma2MwVNnPuyzzxZ7LHrigy4rcS/oJCf1PmJAwIyPjYkCg 8r88KXzgzG6PoNe4AVJGgQ4Mz9R1vyrQ8nUaLuvhSUmjIDjRlh1Nf6OTEY+GCDdheNVJ dlQw== 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 :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=oxaeelXZQeFml/tnymVkRKytofczQ8pJgRvpT9GqFHM=; b=UzDXQutEl+0++bkruLY2P82Jtd4cRwJbBF/C8kL2aqKWsXQwsLu7ccqJYKJCO6WFNo gte9FYyW8BqW1XMmNg9P0znOeNgAIRS3HQhJayVZiQ5EP9Nz29cYkbl8P/d02Fq4O1jn 3Xag/duQmauQOIseKdIsFV0K1Io8SkcTwF9QSqCNloZQY0jcSX3+WbN7+wrz+dx2f4jO 2pu/rCnVfpWdj9lr0UQxuS7VsFvFiFzWe0lzNn1wB2jaa5SLzbOgebOGzo8cMaD55di7 mYpxG8Km3cmQVvZUPz3Ql6QcWBX/y/1rfSHHgqTLzIVsdyIhhZOBdUGICwC5NU+Vxxcq Wxuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=IJDXC8vW; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=ooibSDbD; spf=pass (google.com: domain of gcc-patches-return-500783-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500783-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 o188si1733521pgo.489.2019.05.15.05.46.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:46:57 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500783-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=IJDXC8vW; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=ooibSDbD; spf=pass (google.com: domain of gcc-patches-return-500783-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500783-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=kJQ6fYuRdRK9juNDCoJ2W3DTbocMO wxZdHYUklhhnMe5cnseVuw/dVUuUY4sOJxlC6LkJOinI+NAZMaM2dVtrFCbKV/C5 ZU/o5gWTDtKUVmnUYFwg1yp5Hw58lFokInVzZi/ObuUftk7wdNcPp6fspcka2aKv X9gZ57m2dVvCXk= 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=xmeIIaXITpdMmHxd18pJJC+RyoU=; b=IJD XC8vWZehKBzbo+nXtJcJblP3qJKD1zVsWdhxtWYXXF+ab/PHNLJoXoH/R1lYDVzj B3AMQqDkfjkpAIbjuQ75Y2qY1fy3lPzeiqxgPUTvvLba7d2crvvB3SQEIyx5TJHs dj6TgCUrUZFxRt/7JIIwzJ8ySWQJ9aywuYx1cLJc= Received: (qmail 106442 invoked by alias); 15 May 2019 12:46:43 -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 105936 invoked by uid 89); 15 May 2019 12:46:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.9 required=5.0 tests=AWL, 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.1 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; Wed, 15 May 2019 12:46:41 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCfhOm022108 for ; Wed, 15 May 2019 14:46:39 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=oxaeelXZQeFml/tnymVkRKytofczQ8pJgRvpT9GqFHM=; b=ooibSDbDKnC4ynXvrXycpVEYs7bYQgQH3/pwXW8baNij7VgiJIMcywsiZkpsvBlUdJFT JBaEP7FrF8n/1k7vWGKc0njN7poZYIj7szrPn+t5SmMRwv0C5fgZKsmE/W60hk56M7nq ZOOPQIeAeXQM94YLuHjExasdxX5tJNkmwwU3QiDj9hCkok882b8dmwk/XV1/uKJ+Gv3H qtbImetEX0h2VPmE4CCSuUu4pSkBgO+IEGzgATgEtt6ZOqb61iRWqG/b5og3lgyCBveX rxxhi8V24od9O/bPNLQr3H8K5WVbrhcQ+AhJWV8npxcL9alqnPvjxUZqqNbX4nbrUtoB tA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sek5ajs2p-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:46:39 +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 317E731 for ; Wed, 15 May 2019 12:46:39 +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 214E72769 for ; Wed, 15 May 2019 12:46:39 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:46:38 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 19/21] [ARM][testsuite] FDPIC: Adjust pr43698.c to avoid clash with uclibc. Date: Wed, 15 May 2019 14:39:44 +0200 Message-ID: <20190515124006.25840-20-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes uclibc defines bswap_32, so use a different name in this test. 2019-XX-XX Christophe Lyon gcc/testsuite/ * gcc.target/arm/pr43698.c (bswap_32): Rename as my_bswap_32. Change-Id: I2591bd911030814331cabf97ee5cf6cf8124b4f3 -- 2.6.3 diff --git a/gcc/testsuite/gcc.target/arm/pr43698.c b/gcc/testsuite/gcc.target/arm/pr43698.c index 1fc497c..3b5dad0 100644 --- a/gcc/testsuite/gcc.target/arm/pr43698.c +++ b/gcc/testsuite/gcc.target/arm/pr43698.c @@ -6,7 +6,7 @@ char do_reverse_endian = 0; -# define bswap_32(x) \ +# define my_bswap_32(x) \ ((((x) & 0xff000000) >> 24) | \ (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | \ @@ -16,7 +16,7 @@ char do_reverse_endian = 0; (__extension__ ({ \ uint64_t __res; \ if (!do_reverse_endian) { __res = (X); \ - } else if (sizeof(X) == 4) { __res = bswap_32((X)); \ + } else if (sizeof(X) == 4) { __res = my_bswap_32((X)); \ } \ __res; \ })) From patchwork Wed May 15 12:39:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164295 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp608295oca; Wed, 15 May 2019 05:47:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAm/3FqbWU4NUrrDYVXxV4PWHlCbv9PqE9ZJyJd6KmfpC+xwIwuh0cqnts9btFI1eTAj4j X-Received: by 2002:a62:86c4:: with SMTP id x187mr46325595pfd.34.1557924438462; Wed, 15 May 2019 05:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924438; cv=none; d=google.com; s=arc-20160816; b=ZCnjNcyUA1HSb153fcXtxQBZKKBwX4yBlzKV6nZmFOc9f8XpnrCuWBPaDZq3HT2xxV 9kqVf7sICi62kDPAMKY06v42JY4jiueyjKzQeBWbYGRGLUds/39zFssRFNZdiqofkEWV lIWZG37o4DdAZ+Bdr7sjEExMDHpiQzALwEL2FsHnpkCeJI2f6RnMKgoVuksshGaYEbU4 fmXa8e9B67+1urZNBN+0nfClmaoHkKY05a4rDI2oZHaovDKdVJMfpjXF32wtWYpg5TsU QtlO6f+eLepGCyog7fWgkCfksOnZxhcH+eqNCF9tRCESUe7ZGkjyWXqhbSRtcv642W/s UmMg== 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 :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=ZRRIzcBXNVbYyhd152Q6w+3bQ4+IQFmwBlIJ09SNm6I=; b=pFglK5BsgTXRF7+EDdYpwGJXmD5u458/O8IFQJ5oci1Qd7+ZaqPLPXf1AkvKxMZP6S FXpG6svTFchqRDw0CJEV8BRH+zZwpR7GdsBATC0LWAl5FUFrxequM02T9Nugw+FIm9nS 2VAu6y3WS7zw/h8LcRwCy3lBMviyPBbGYYKlGcNEXiylTbBYg97HujHLuZtKnPm/pGnZ 9Sab97m7g7F7PaItNp3Yi4SVDzcPwCsyN9OmIHXtnaRnvZspLit0gkyuIug3cx5Ny5vb NNfYTkXk+t76yYPmzjYS/YTe7K2qLL749rd32pNzJEQXD9+A/6Is/FYCYM1h/SqiwCbL YtNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=F5RK8xlx; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=Ftx9iH9u; spf=pass (google.com: domain of gcc-patches-return-500784-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500784-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 d23si1852764pgv.513.2019.05.15.05.47.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:47:18 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500784-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=F5RK8xlx; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=Ftx9iH9u; spf=pass (google.com: domain of gcc-patches-return-500784-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500784-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=LnHuGdgiH2hJP3Z1P3zsuhtjFDM3/ xSBsIr8FyXGh3HyRUkV44d4WoOQc5ZDOKbu1O2rjNdVprHmyRx5Yd7658MuLT2PZ oPmcRhKw9DG/9eTSizfdlPNHSaq+//zY70MiTaqrNVC3me1lJ3Qk9ejjT6LwNEDS CuipCupEAJv8uk= 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=bZIL9t0YjgdKlDXH2YMncy5CxNk=; b=F5R K8xlx8XmES33Rbg646jqoVMUoiNcuZtx7vbk5R40nge4GPIAGMJfjm8zM5J3/KFa dLJsKtYCLvGvFLYg2hyTyMQ6RnU6yyKeHSZC32D7xq232WzYk6a1r9V1G1XxFK7u s7dI3coTg5lijZzHDn84l4nFS7wrtgZsgCmCAVV8= Received: (qmail 19245 invoked by alias); 15 May 2019 12:47:06 -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 18238 invoked by uid 89); 15 May 2019 12:47:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.0 required=5.0 tests=AWL, 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.1 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; Wed, 15 May 2019 12:47:02 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCfqSd022149 for ; Wed, 15 May 2019 14:47:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=ZRRIzcBXNVbYyhd152Q6w+3bQ4+IQFmwBlIJ09SNm6I=; b=Ftx9iH9u4q1vFLhV3z6HPCuOeVVnH9rFWNR3eDibgwdtlby18UPqVWc2b3nz3RGX1LtO 4xDZCuwPN9mdACE96luIWSePhtl033HFleXpgWCDyAnUhzronUd3UTEJUDO3kxiz+SK+ 7PI2TulKVRxhJTI/SRmtXwwGgwuebj4AfX20bxBGGR96psxId/7IlRlxuLxQhRbZkK+g 9rAReY/DCaPz8YV3t6Rgki4aQzNwRD+Z3jfjLuYUknuNJgy1NRXMONZfu3F69Xe/I7pR mJXH3IYBDyHuqAjNP7unPsT/rv0Jy9bKehz5ErQaLxRRJAXjuhLl1TC8wUjIEwzQLDB6 Tg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sek5ajs58-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:47:00 +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 7DAC531 for ; Wed, 15 May 2019 12:46:59 +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 6153E276F for ; Wed, 15 May 2019 12:46:59 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:46:58 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 20/21] [ARM][testsuite] FDPIC: Skip tests using architectures unsupported by FDPIC Date: Wed, 15 May 2019 14:39:45 +0200 Message-ID: <20190515124006.25840-21-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes Since FDPIC currently supports arm and thumb-2 modes only, these tests fail because they enforce an architecture version that doesn't match these restrictions. This patch introduces new values for the arm_arch effective-target (v4t_thumb, v5t_thumb, v5te_thumb, v6_thumb, v6k_thumb, v6z_thumb) as needed, and adds them to the relevant tests. It also adds the corresponding non-thumb effective-target to the tests that were missing it. 2019-XX-XX Christophe Lyon * lib/target-supports.exp (check_effective_target_arm_arch_FUNC_ok): Add v4t_thumb, v5t_thumb, v5te_thumb, v6_thumb, v6k_thumb, v6z_thumb. * gcc.target/arm/armv6-unaligned-load-ice.c: Add arm_arch effective-target. * gcc.target/arm/attr-unaligned-load-ice.c: Likewise. * gcc.target/arm/attr_arm-err.c: Likewise. * gcc.target/arm/ftest-armv4-arm.c: Likewise. * gcc.target/arm/ftest-armv4t-arm.c: Likewise. * gcc.target/arm/ftest-armv4t-thumb.c: Likewise. * gcc.target/arm/ftest-armv5t-arm.c: Likewise. * gcc.target/arm/ftest-armv5t-thumb.c: Likewise. * gcc.target/arm/ftest-armv5te-arm.c: Likewise. * gcc.target/arm/ftest-armv5te-thumb.c: Likewise. * gcc.target/arm/ftest-armv6-arm.c: Likewise. * gcc.target/arm/ftest-armv6-thumb.c: Likewise. * gcc.target/arm/ftest-armv6k-arm.c: Likewise. * gcc.target/arm/ftest-armv6k-thumb.c: Likewise. * gcc.target/arm/ftest-armv6m-thumb.c: Likewise. * gcc.target/arm/ftest-armv6t2-arm.c: Likewise. * gcc.target/arm/ftest-armv6t2-thumb.c: Likewise. * gcc.target/arm/ftest-armv6z-arm.c: Likewise. * gcc.target/arm/ftest-armv6z-thumb.c: Likewise. * gcc.target/arm/g2.c: Likewise. * gcc.target/arm/macro_defs1.c: Likewise. * gcc.target/arm/pr59858.c: Likewise. * gcc.target/arm/pr65647-2.c: Likewise. * gcc.target/arm/pr79058.c: Likewise. * gcc.target/arm/pr83712.c: Likewise. * gcc.target/arm/pragma_arch_switch_2.c: Likewise. * gcc.target/arm/scd42-1.c: Likewise. * gcc.target/arm/scd42-2.c: Likewise. * gcc.target/arm/scd42-3.c: Likewise. * gcc.c-torture/compile/pr82096.c: Fix arm_arch effective-target. Change-Id: I0845b262b241026561cc52a19ff8bb1659675e49 -- 2.6.3 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr82096.c b/gcc/testsuite/gcc.c-torture/compile/pr82096.c index d144b70..4e695cd 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr82096.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr82096.c @@ -1,4 +1,4 @@ -/* { dg-require-effective-target arm_arch_v5t_ok { target arm*-*-* } } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok { target arm*-*-* } } */ /* { dg-skip-if "Do not combine float-abi values" { arm*-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ /* { dg-additional-options "-march=armv5t -mthumb -mfloat-abi=soft" { target arm*-*-* } } */ diff --git a/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c b/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c index 88528f1..886a012 100644 --- a/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c +++ b/gcc/testsuite/gcc.target/arm/armv6-unaligned-load-ice.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_thumb_ok } */ /* { dg-options "-mthumb -Os -mfloat-abi=softfp" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c b/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c index e1ed1c1..2eeb522 100644 --- a/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c +++ b/gcc/testsuite/gcc.target/arm/attr-unaligned-load-ice.c @@ -2,6 +2,7 @@ Verify that unaligned_access is correctly with attribute target. */ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ +/* { dg-require-effective-target arm_arch_v6_ok } */ /* { dg-options "-Os -mfloat-abi=softfp -mtp=soft" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/attr_arm-err.c b/gcc/testsuite/gcc.target/arm/attr_arm-err.c index 630c06a..d410056 100644 --- a/gcc/testsuite/gcc.target/arm/attr_arm-err.c +++ b/gcc/testsuite/gcc.target/arm/attr_arm-err.c @@ -2,6 +2,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_arm_ok } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-add-options arm_arch_v6m } */ int __attribute__((target("arm"))) diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c index 4b48ef8..447a8ec 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v4 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c index 016506f..05db533 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4t-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4t_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v4t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c index 9ef944e..78878f7 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv4t-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v4t_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v4t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c index a9403e9..bea25d09 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5t-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5t_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v5t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c index f3ad07e..b25d17d 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5t-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5t" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v5t } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c index f98c01a..7b37c7f 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5te-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5te" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v5te } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c index 5d71787..27a64a2 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv5te-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv5te" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v5te } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c index 88a5089..bfab765 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c index 90ef9d2..15a6d75 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c index 8de021a..721c9f9 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6k-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c index c2fc270..b3b6ecf 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6k-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6k" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6k_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6k } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c index ee075e2..27f71be 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6m-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6m } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c index 83b4bc4..259d2b5 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6t2" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6t2_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6t2 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c index 1a1cbc5..e624ec5 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6t2-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6t2" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6t2_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6t2 } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c b/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c index e2df0d4..66380bf 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6z-arm.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6z" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6z_ok } */ /* { dg-options "-marm" } */ /* { dg-add-options arm_arch_v6z } */ diff --git a/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c b/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c index e4b94ef..23a4fcd 100644 --- a/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c +++ b/gcc/testsuite/gcc.target/arm/ftest-armv6z-thumb.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6z" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6z_thumb_ok } */ /* { dg-options "-mthumb" } */ /* { dg-add-options arm_arch_v6z } */ diff --git a/gcc/testsuite/gcc.target/arm/g2.c b/gcc/testsuite/gcc.target/arm/g2.c index e368017..da68c8b 100644 --- a/gcc/testsuite/gcc.target/arm/g2.c +++ b/gcc/testsuite/gcc.target/arm/g2.c @@ -4,6 +4,7 @@ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-require-effective-target arm32 } */ /* Brett Gaines' test case. */ diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c index 4cc9ae6..655ba93 100644 --- a/gcc/testsuite/gcc.target/arm/macro_defs1.c +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ +/* { dg-require-effective-target arm_arch_v6m_ok } */ /* { dg-options "-march=armv6-m -mthumb" } */ #ifdef __ARM_NEON_FP diff --git a/gcc/testsuite/gcc.target/arm/pr59858.c b/gcc/testsuite/gcc.target/arm/pr59858.c index a944b9a..bcfd5d5 100644 --- a/gcc/testsuite/gcc.target/arm/pr59858.c +++ b/gcc/testsuite/gcc.target/arm/pr59858.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-march=armv5te -fno-builtin -mfloat-abi=soft -mthumb -fno-stack-protector -Os -fno-tree-loop-optimize -fno-tree-dominator-opts -fPIC -w" } */ /* { dg-skip-if "Incompatible command line options: -mfloat-abi=soft -mfloat-abi=hard" { *-*-* } { "-mfloat-abi=hard" } { "" } } */ +/* { dg-require-effective-target arm_arch_v5te_thumb_ok } */ typedef enum { REG_ENOSYS = -1, diff --git a/gcc/testsuite/gcc.target/arm/pr65647-2.c b/gcc/testsuite/gcc.target/arm/pr65647-2.c index f2985f8..3d9e75f 100644 --- a/gcc/testsuite/gcc.target/arm/pr65647-2.c +++ b/gcc/testsuite/gcc.target/arm/pr65647-2.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target arm_arch_v6_ok } */ /* { dg-options "-O3 -marm -march=armv6 -std=c99" } */ typedef struct { diff --git a/gcc/testsuite/gcc.target/arm/pr79058.c b/gcc/testsuite/gcc.target/arm/pr79058.c index 54a1d8a..7d078ac 100644 --- a/gcc/testsuite/gcc.target/arm/pr79058.c +++ b/gcc/testsuite/gcc.target/arm/pr79058.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_arm_ok } */ +/* { dg-require-effective-target arm_arch_v4_ok } */ /* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" } { "-mcpu=arm7tdmi" } } */ /* { dg-options "-Os -mbig-endian -marm -mcpu=arm7tdmi" } */ diff --git a/gcc/testsuite/gcc.target/arm/pr83712.c b/gcc/testsuite/gcc.target/arm/pr83712.c index 8ed8cdf..4902ec9 100644 --- a/gcc/testsuite/gcc.target/arm/pr83712.c +++ b/gcc/testsuite/gcc.target/arm/pr83712.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target arm_arch_v5t_thumb_ok } */ /* { dg-options "-mfloat-abi=softfp -mthumb -march=armv5t -O2" } */ #pragma GCC optimize ("-O2") diff --git a/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c b/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c index b6211f9..c3361e7 100644 --- a/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c +++ b/gcc/testsuite/gcc.target/arm/pragma_arch_switch_2.c @@ -2,6 +2,7 @@ /* { dg-skip-if "instruction not valid on thumb" { *-*-* } { "-mthumb" } { "" } } */ /* { dg-do assemble } */ /* { dg-require-effective-target arm_arm_ok } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-additional-options "-Wall -O2 -march=armv5te -std=gnu99 -marm" } */ #pragma GCC target ("arch=armv6") diff --git a/gcc/testsuite/gcc.target/arm/scd42-1.c b/gcc/testsuite/gcc.target/arm/scd42-1.c index be60e64..2b8fc0b 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-1.c +++ b/gcc/testsuite/gcc.target/arm/scd42-1.c @@ -3,6 +3,7 @@ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-mcpu=xscale -O -mfloat-abi=softfp" } */ unsigned load1(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/gcc.target/arm/scd42-2.c b/gcc/testsuite/gcc.target/arm/scd42-2.c index 6d9e5e1..4181a75 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-2.c +++ b/gcc/testsuite/gcc.target/arm/scd42-2.c @@ -4,6 +4,7 @@ /* { dg-skip-if "Test is specific to the Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "Test is specific to ARM mode" { arm*-*-* } { "-mthumb" } { "" } } */ /* { dg-require-effective-target arm32 } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-mcpu=xscale -O -marm" } */ unsigned load2(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/gcc.target/arm/scd42-3.c b/gcc/testsuite/gcc.target/arm/scd42-3.c index e566cb2..0afd121 100644 --- a/gcc/testsuite/gcc.target/arm/scd42-3.c +++ b/gcc/testsuite/gcc.target/arm/scd42-3.c @@ -3,6 +3,7 @@ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-march=*" } { "-march=xscale" } } */ /* { dg-skip-if "Test is specific to Xscale" { arm*-*-* } { "-mcpu=*" } { "-mcpu=xscale" } } */ /* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */ +/* { dg-require-effective-target arm_arch_v5te_ok } */ /* { dg-options "-mcpu=xscale -O -mfloat-abi=softfp" } */ unsigned load4(void) __attribute__ ((naked)); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 60d68f4..3f091c5 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -4104,12 +4104,18 @@ proc check_effective_target_arm_fp16_hw { } { foreach { armfunc armflag armdefs } { v4 "-march=armv4 -marm" __ARM_ARCH_4__ v4t "-march=armv4t" __ARM_ARCH_4T__ + v4t_thumb "-march=armv4t -mthumb" __ARM_ARCH_4T__ v5t "-march=armv5t" __ARM_ARCH_5T__ + v5t_thumb "-march=armv5t -mthumb" __ARM_ARCH_5T__ v5te "-march=armv5te" __ARM_ARCH_5TE__ + v5te_thumb "-march=armv5te -mthumb" __ARM_ARCH_5TE__ v6 "-march=armv6" __ARM_ARCH_6__ + v6_thumb "-march=armv6 -mthumb" __ARM_ARCH_6__ v6k "-march=armv6k" __ARM_ARCH_6K__ + v6k_thumb "-march=armv6k -mthumb" __ARM_ARCH_6K__ v6t2 "-march=armv6t2" __ARM_ARCH_6T2__ v6z "-march=armv6z" __ARM_ARCH_6Z__ + v6z_thumb "-march=armv6z -mthumb" __ARM_ARCH_6Z__ v6m "-march=armv6-m -mthumb -mfloat-abi=soft" __ARM_ARCH_6M__ v7a "-march=armv7-a" __ARM_ARCH_7A__ v7r "-march=armv7-r" __ARM_ARCH_7R__ From patchwork Wed May 15 12:39:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164296 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp608597oca; Wed, 15 May 2019 05:47:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPOMBO0zvhDCW+XYid1XaCb2OUtuDZM9qjjkcWytzOGhQHPtJw/uwgbZoRplWRfghGO5Oo X-Received: by 2002:a63:5720:: with SMTP id l32mr45304562pgb.438.1557924456462; Wed, 15 May 2019 05:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924456; cv=none; d=google.com; s=arc-20160816; b=he1e2JVnYaXHIiNQCY3Q+bH6xRX//T/hFne4gTH/VA+WJ8UDWAGc7uow3qwo2WbQFa yFZpCVK2RceA7MclsfIvlEdZvntLBt6l/aEs5V/PPhpz12itL5V8d/fgwviGx6v7RV+B 6uhYyTYITm/DkPtQNiXj3YOVZFqe1S/vdte3g5MK4R2T2HKCVnh+sA7sNf0RdSeUOHM3 7FjCvGrAsxO8mrUwxJ20bX/mmyS3iEaVVNgmUGk5ehjix8uTmMVzQibzpnV8v83X7fS9 fhJcbZAVrFTr0TAU/SxfZdi54Dv7H7uJMHyg2Y7w5Jd5TxqHCjx0zJmNU9KSl27LvxiY 9+zQ== 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 :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=nMjSFMYkXgkXTBXZvozi5iWLm9aB1woXLNg7VQ8VJUU=; b=Zxg4ka1cd9QsqnTfUnn2fup1+7n64Z2UomxNbg51TOgX/GhGIYbeMHa2AvAf796EXD uuE8n6vVrplHLcSbWxVflRbqsCfrOOek0VjNU2xCz5f2FisJvP+BRJF0WD4szUcdZIwC hOFVbihkBvlNv9POZekCP2TNoiM6qYz/RyX0RkfFrRBqF2+N2BpRc0aBtkC55WiFH8pL cpZPbGSb0Mpg78Gf13vtnSnrF/ucX5b8l0ieZWxo7ZvnikcUdzpEM5vZcIy3ZZaaaZVD Gv11hCYO6QEz1YToQrtxvj4XL1o/Tk/Di+fyYFIpyj3XiI7JH9ZSnqopW4O2rIpdhici d5/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="CEljr/Gj"; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=KBUcVHF+; spf=pass (google.com: domain of gcc-patches-return-500785-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500785-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 n3si1726702pgp.587.2019.05.15.05.47.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:47:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500785-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="CEljr/Gj"; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=KBUcVHF+; spf=pass (google.com: domain of gcc-patches-return-500785-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500785-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=ITfdOksK5THsOPZp9EcV8DVQVG3Wa PiK23H9I5rq/YWNQ673m/YDTpjPB9k/hRJyF83RNi8g0NLC/mCOAcvBlEyVsDDIR lH2JjLxo79Ofk2o3yAZEzY8lKzkyVHZWwfFiQLOMhl+82N6BHvBDFyzyGOJxSlKf J1Mxhhh9eXuYl4= 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=sq0qw+Kvs3Rqg39tqXiCgs3Bgzk=; b=CEl jr/Gjb6eUu5VSKai3V+xRK2xeoT4/Rx2ivhDScDdwdopvV7LRDf/Ycg4/aB8Z9+j XTdiwIMXHx/EDe2eBt7ixAJuX+W0frUxhh2Rfyx2Gddi3PiiU1G7p3cm1MLrzIp8 CS6DU7y1doyxac0Hd1d0xmpf0LpQgyulgorP6AFo= Received: (qmail 48083 invoked by alias); 15 May 2019 12:47: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 47115 invoked by uid 89); 15 May 2019 12:47:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.1 required=5.0 tests=AWL, 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.1 spammy=HX-Languages-Length:1442 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; Wed, 15 May 2019 12:47:22 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCgjYP007231 for ; Wed, 15 May 2019 14:47:20 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=nMjSFMYkXgkXTBXZvozi5iWLm9aB1woXLNg7VQ8VJUU=; b=KBUcVHF+KCLBEdjDLFEJ3/hTLpp9oQuMkSHSocner0T9b3sWrLqz2ZLBHW16qYp+K4wZ 1DFMIzbDMZuxfYI7JDg3KNIZ9k6P6QJofnJEqpxHgefUZEG8er11gY+c6A4wt2rbuAIi 4MaDLpjVT+hA592TRRKM/BoNCO3kCFjwnBujSNrW3ryZLpeZYG1iKwBwk6qzZ/V5fVTq RYE97c7nIh/IInA+BWFF3BLs1Vuc77leZRjaX65lFpykIhkmyNMJiaKwPrIAU3RzPrFK /wxCtleeU1ipG+Q+KaosmnEmWWhtTV8WirNQPI8NMIRdCE0tfqNhIPoFC7qYVj8k/FCf wA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2sdkv00hnu-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:47:20 +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 A36E33F for ; Wed, 15 May 2019 12:47:19 +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 93CEB2771 for ; Wed, 15 May 2019 12:47:19 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 15 May 2019 14:47:18 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 21/21] [ARM] FDPIC: Handle stack-protector combined patterns Date: Wed, 15 May 2019 14:39:46 +0200 Message-ID: <20190515124006.25840-22-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes The recent stack_protect_combined_set_insn and stack_protect_combined_test_insn force recomputing of GOT base, but need to take into account that in FDPIC mode, the PIC register is fixed by the ABI (r9). 2019-XX-XX Christophe Lyon * config/arm/arm.md (stack_protect_combined_set_insn): Handle FDPIC mode. (stack_protect_combined_test_insn): Likewise. Change-Id: Ib243fab0791fc883ca7b1c1205af1e0893f3e8c5 -- 2.6.3 diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 0edcb1d..5a4dd00 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -8869,8 +8869,19 @@ { if (flag_pic) { + rtx pic_reg; + + if (TARGET_FDPIC) + { + pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + } + else + { + pic_reg = operands[3]; + } + /* Forces recomputing of GOT base now. */ - legitimize_pic_address (operands[1], SImode, operands[2], operands[3], + legitimize_pic_address (operands[1], SImode, operands[2], pic_reg, true /*compute_now*/); } else @@ -8943,8 +8954,19 @@ if (flag_pic) { + rtx pic_reg; + + if (TARGET_FDPIC) + { + pic_reg = gen_rtx_REG (Pmode, FDPIC_REGNUM); + } + else + { + pic_reg = operands[4]; + } + /* Forces recomputing of GOT base now. */ - legitimize_pic_address (operands[1], SImode, operands[3], operands[4], + legitimize_pic_address (operands[1], SImode, operands[3], pic_reg, true /*compute_now*/); } else