From patchwork Sat May 6 11:55:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 90736 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1006588vqo; Sat, 6 May 2023 04:56:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xttH5PSLV0SvCjWEeGTJVmswkIZF/VJEv/2QaUlK3XA+gOEJhoBsV0vpHZ+2Zz/oqmVuY X-Received: by 2002:aa7:c0d7:0:b0:50b:d53d:7ceb with SMTP id j23-20020aa7c0d7000000b0050bd53d7cebmr3107863edp.40.1683374196611; Sat, 06 May 2023 04:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683374196; cv=none; d=google.com; s=arc-20160816; b=0OYsBAFR6B3ucH7CyW3G4RvEeGEzB55hkMEFuAxQvaKkj1/zfqH42KCGWTMR7apO0y HEHJ05scZhtZN8s+1NXRqgf+cv/sxaNcXoOtJMKQ5geDgtnDja1MO44wSISMEUfbsCe3 LP/g1nR8drRPWrTKEqrRWYmQTKlRVUEDtKiBmSksekCA6nTx7Cfoa9j/qL+5bntCOuf4 vIZA6ov7NBIBrUSd0aKoj4D4+fHZXyDgrU94DJR+u1IXY8EtnJ+YukqYU1gmMEluOz+1 DqGsOgLYXctt24QJGzZxGUpIcLFuKJJe859gcTZS79PX20538SCCbYjGHhTTMDW/H5rN M0WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:user-agent :organization:content-disposition:mime-version:mail-followup-to :message-id:subject:cc:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=5Wef0kU0y6/e8BEQfSt2nSV2S+plqnwDeW8s40MXsC4=; b=ZOvAI8Hh3W2JKeDMThJDBRwjsO6wRaGh9W035D+Bfn6TpQzyNywFP0IPdp0njRmo+4 6OeSv7IVLw6Y+skm+YINyopl6/Dh87VtPMnKdECK1H4xMKufLbuQql94Ndm1cw2p4Ibl WItV7HTjyDBCANET07rC+xxqa7yPag0gLmNNV6SHWsNJwJR0uKyjitlcB8onVEjhxs8S UoAiIqSrO1qyx26rm+FDmidzdKyisyvxuS57mn0unQjmm89O6QJaKdlUzilXYgACroYc Fr+NQhY9ZGCYWRsEFS+CSCwsZIZxfjHUlgB4A3g7k4ay9sgkJVVo5GVQtZr69/iFKFAI 1r9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ZovVRbHA; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id i17-20020a056402055100b00506bce1794esi6111462edx.526.2023.05.06.04.56.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 May 2023 04:56:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ZovVRbHA; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 436A13857703 for ; Sat, 6 May 2023 11:56:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 436A13857703 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683374195; bh=5Wef0kU0y6/e8BEQfSt2nSV2S+plqnwDeW8s40MXsC4=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ZovVRbHAjaT/6daXWn5+ONWz8sHn7mSRHkoEbs4WQhGLlZ3fhsuESu3IIM2NRKAYc YhNLeGsZm5GsPjC2YQl2EOKaLA8OFZcU6hmRBcSsjBqol8z3JL7HzpNkWsZv8PNZrs q0+QHUtUE1ARed1ouzcvoFs5nsvZqQJ9IRN/OBW0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id 467663858D28 for ; Sat, 6 May 2023 11:55:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 467663858D28 Received: from lfbn-bor-1-1163-184.w92-158.abo.wanadoo.fr ([92.158.138.184] helo=begin) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvGVt-0003Dt-Re; Sat, 06 May 2023 07:55:52 -0400 Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1pvGVs-009ZBZ-1S; Sat, 06 May 2023 13:55:44 +0200 Date: Sat, 6 May 2023 13:55:44 +0200 To: gcc-patches@gcc.gnu.org, Thomas Schwinge Cc: bug-hurd@gnu.org Subject: [PATCH] hurd: Ad default-pie and static-pie support Message-ID: <20230506115544.y5hzmvwlgoup22ct@begin> Mail-Followup-To: gcc-patches@gcc.gnu.org, Thomas Schwinge , bug-hurd@gnu.org MIME-Version: 1.0 Content-Disposition: inline Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Samuel Thibault via Gcc-patches From: Samuel Thibault Reply-To: Samuel Thibault Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765145781504069428?= X-GMAIL-MSGID: =?utf-8?q?1765145781504069428?= This fixes the Hurd spec in the default-pie case, and adds static-pie support. gcc/ChangeLog: * gcc/config/i386/gnu.h: Use PIE_SPEC, add static-pie case. * gcc/config/i386/gnu64.h: Use PIE_SPEC, add static-pie case. diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h index 8dc6d9ee4e3..e776144f96c 100644 --- a/gcc/config/i386/gnu.h +++ b/gcc/config/i386/gnu.h @@ -27,12 +27,12 @@ along with GCC. If not, see . #undef STARTFILE_SPEC #if defined HAVE_LD_PIE #define STARTFILE_SPEC \ - "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \ - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" + "%{!shared: %{pg|p|profile:%{static-pie:grcrt0.o%s;static:gcrt0.o%s;:gcrt1.o%s};static-pie:rcrt0.o%s;static:crt0.o%s;" PIE_SPEC ":Scrt1.o%s;:crt1.o%s}} \ + crti.o%s %{static:crtbeginT.o%s;shared|static-pie|" PIE_SPEC ":crtbeginS.o%s;:crtbegin.o%s}" #else #define STARTFILE_SPEC \ "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};static:crt0.o%s;:crt1.o%s}} \ - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" + crti.o%s %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}" #endif #ifdef TARGET_LIBC_PROVIDES_SSP diff --git a/gcc/config/i386/gnu64.h b/gcc/config/i386/gnu64.h index a411f0e802a..332372fa067 100644 --- a/gcc/config/i386/gnu64.h +++ b/gcc/config/i386/gnu64.h @@ -31,10 +31,10 @@ along with GCC. If not, see . #undef STARTFILE_SPEC #if defined HAVE_LD_PIE #define STARTFILE_SPEC \ - "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \ - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" + "%{!shared: %{pg|p|profile:%{static-pie:grcrt0.o%s;static:gcrt0.o%s;:gcrt1.o%s};static-pie:rcrt0.o%s;static:crt0.o%s;" PIE_SPEC ":Scrt1.o%s;:crt1.o%s}} \ + crti.o%s %{static:crtbeginT.o%s;shared|static-pie|" PIE_SPEC ":crtbeginS.o%s;:crtbegin.o%s}" #else #define STARTFILE_SPEC \ "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};static:crt0.o%s;:crt1.o%s}} \ - crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" + crti.o%s %{static:crtbeginT.o%s;shared|static-pie|" PIE_SPEC ":crtbeginS.o%s;:crtbegin.o%s}" #endif