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