From patchwork Mon Sep 9 15:45:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173410 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4541620ilq; Mon, 9 Sep 2019 08:53:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqysYuoZP3b5o8hwsp+is8jcPcLd+CqYX+r/PCzaxdAbqicY7+hXfHna0l0zEZ1lKJgk+01k X-Received: by 2002:a17:906:770d:: with SMTP id q13mr15056051ejm.260.1568044380497; Mon, 09 Sep 2019 08:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044380; cv=none; d=google.com; s=arc-20160816; b=An4MtGduY8tks7WXyxnDUr4IF+PN73IxvqArdQaWK/TiZ/FDfgWEeLRL6dWpAMSpOP 3J2Rd3rqqy57zeIBZQP1iEBAIikuFhht4jUHUD9yz7r3EQjy5y3/yN/imXW1T+CUfZ2U 6tKi+7kteapjeAdb67MGg9lvfo48aLckUR3QvBbCUWMOTkdBI44GZT/g4beTy6eimnQW Gxi1HF20Nhv+Qa+pH5dJ2LBlXZlsc8MYmsgEp4DDX2wTAjXpajlmihE0fBWxaG5JCtcE wydUEWfZ7sWHUk3DiRQd7SVtNvztZV538rsJswdtiCRuIzIqrD/IuFdorFyipUV2IH9f x3mw== 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=s8gMizsfcaRYbJor83rbYF1yUMEEU/FD4/NHXhPGA5E=; b=yGojMvd19ppG099Ym5CjlxY55Pu3cL0EkCKJqo5wUxly7lFgLEJ78/fEAHyqpCc0GU Le8AhvwIar61Jhlzh0Vkql5pQzzbX5hloOfhqw9MfkU05l974QbL1u22W4VtgeAz6lur UCVBvdwhCzic7+sJK2441m05ugDB9WFt+njC5zIFUiC0TIWh8oP2GBgmHlZ2WPHcXPCy Dv5xy5Vnemhlmz3m/umkhHkYQ9kygT3HmbE0PvX47XiloaTh99JEIAr2BSGWz6aNKZ7U D8M6TuszMwn3ZIucNay3isUt75bwMXe0mkN5N0DWfuClJZKm8Sq9NQx025xBOSMrsmDm GOPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Dg0G8DxP; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=nJWkYjsn; spf=pass (google.com: domain of gcc-patches-return-508664-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508664-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 w17si7489367ejf.362.2019.09.09.08.52.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:53:00 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508664-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=Dg0G8DxP; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=nJWkYjsn; spf=pass (google.com: domain of gcc-patches-return-508664-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508664-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=diuzE1A4m4mG06hK9PcgWW9fthGlS fzrvJXJKEsktO6WVtkCUYjQjM7DI1f86jZnv6HTKuy1HZQ5Q3vvlZO0biV4x6sAu hJxTo3q43L1Y1IjEa9VbMx233+8Js5RkVG1Cwuezr6pfxSSD8dOt67VgAnUuNCCm Ua/D/U/YtTxHx8= 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=3UDFXV9pbbMnwGZHEj7qzPcPMBU=; b=Dg0 G8DxPGqR68jLpgbBsPoJu3T55plvoUWQr5jTiNJ3m9vH6T2c+awITarTEImnFk92 sFEq77xX+HyRoOH70T1r1xDMsCmF/Ko/YbybpIS57XCRIB8MwskcHxdnjAoyauuK ahFLcEdU+pFUXzapxoPKZ9cO1WHedmm197rlZCFo= Received: (qmail 15722 invoked by alias); 9 Sep 2019 15:52:45 -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 15695 invoked by uid 89); 9 Sep 2019 15:52:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.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=Forces 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; Mon, 09 Sep 2019 15:52:43 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FpDVT005008 for ; Mon, 9 Sep 2019 17:52:41 +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=s8gMizsfcaRYbJor83rbYF1yUMEEU/FD4/NHXhPGA5E=; b=nJWkYjsngi+8iD49Can17VlhjLgIFhkfnrg90+CN1FunjweNAqrkhFZZEfIQo0dmAd2w ZfKy4WKBo6FDmtjMuwU46pSdgFPdFdQfoJeeBfQRvJNf0tEFB4zqmiCytPdTQuye5XjO Z3R6A81mvR0/ePY9zmLuG3sxB4+XlDuc2riGGSKFR8bXyUnfcuaYPrwri9wITicDOIAw mR+jcTKSh9+pFahAxyBIQ5CP8pZU/0ySVU060zEoT40RrIhqNjE15mwVIFVZrS8fWW+E ZpzmpH2J4DfO6V8hUXCb6OYtTeouFgdSc9AC7n06AP7hMGnDVSYRIlAI3L8HArwFryRX 0w== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2uv212em2u-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:52:41 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id EB42624 for ; Mon, 9 Sep 2019 15:52:37 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 60A432B0DEF for ; Mon, 9 Sep 2019 17:52:37 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:52:37 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 21/24] [ARM] FDPIC: Handle stack-protector combined patterns Date: Mon, 9 Sep 2019 17:45:03 +0200 Message-ID: <20190909154526.11630-22-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon 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 gcc/ * config/arm/arm.md (stack_protect_combined_set_insn): Handle FDPIC mode. (stack_protect_combined_test_insn): Likewise. Change-Id: I0e47cf30cfe0dc401f43bd728aaae07bffa4c9cc -- 2.6.3 diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 918271d..6513c2d 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -8270,8 +8270,15 @@ { 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 @@ -8346,8 +8353,15 @@ 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