From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 0E6CD3858C2C for ; Sun, 25 Sep 2022 15:50:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0E6CD3858C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x42b.google.com with SMTP id w2so4551086pfb.0 for ; Sun, 25 Sep 2022 08:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date; bh=3edafKKBdsGqZEfy56jIX5NIaGRXYbVwdnv3JcSH6l4=; b=qMbgale0pzn9IlisghjAvSz+yNCVvtJJXJICvLSYf82eaMfEUDNDTB/yteMR6ey2zq 8+tY3A/X1gn9DTvy6OaywKbk99UByw3WZZeQaTIJXqUF/kYNuiYIky2A6/YZxh/LXOXo U4VQVz7O5Ze+jPzyK52+JN47rb1aJKaYjqxSz27hprCtWlJ8Dt9aVOEY/5w4STd0mV30 itpl2UVPrvuGFBf4HTyKFJahrB3PPdmcoeLrhZRMLe0MdwcA7RIDKOYNeuRkBmGqd5/D 3y+NXZ06tSJ3pgh+Iqdhrk6f3a3E6rv843s48FtW5qLLfQ1DF69q/pDJ9YnZWrQUlpNA SMZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date; bh=3edafKKBdsGqZEfy56jIX5NIaGRXYbVwdnv3JcSH6l4=; b=czIGrGRgmoxG1VmxeQ3HbQYv57XYiBFJsOCZo4Uz4ZQwBzFAoQ7ymv6VXCGy3yYeyP cj9EfaisRgsYBa3c5oCsUZhPpY965Lsmfe+5MOeGuzuaUHM8qjMFN3c0HH9F1+taXDAM VvAsNIp0rVYm0zcJtzh+EdOkQUtc/GJJpzA5tEWFjI0IjESqbrcEqNAMCz7GR8MjaZrF iNXl7aLYB8PqLCKz6vEk8TxM4G6MbPoXUZDWezG5uy3gfaw1gk/JC3tQcqonSwSyUxXA DVGK7AgoMXLeuXMOqJJQHNMpaUtAqWWmF3qAuNAsPql9RgaJjd4grlAz6XJPCf2us3ta kTGQ== X-Gm-Message-State: ACrzQf1GxQpc483mA09qVIbFT8PnRO4Gy0iRw93NktMHoeGJIw/mqWO/ nPzRaxUEVf86DIr2TM1pmm951Zsd24N2r0IWIsdkz9P1 X-Google-Smtp-Source: AMsMyM6CB4LkLwbTK+7cznFWRYNciq4Nsgklo/kWYbsOEPfKhmEBwz9pqTnsR1YGSSNg2HUs0cASDeFoWMcAl35vQHs= X-Received: by 2002:a63:a18:0:b0:439:8dd3:c3a8 with SMTP id 24-20020a630a18000000b004398dd3c3a8mr16080980pgk.220.1664121010627; Sun, 25 Sep 2022 08:50:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: linted Date: Sun, 25 Sep 2022 11:49:46 -0400 Message-ID: Subject: Re: [PATCH] mips: Add appropriate linker flags when compiling with -static-pie To: gcc-patches@gcc.gnu.org Content-Type: multipart/alternative; boundary="000000000000b3aa4a05e9825dcc" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000b3aa4a05e9825dcc Content-Type: text/plain; charset="UTF-8" Hello, I'm just checking to see if anyone has had a chance to look at this. Thank you On Wed, Sep 14, 2022 at 2:09 PM linted wrote: > Hello, > > This patch fixes missing flags when compiling with -static-pie on mips. I > made these modifications based on the previously submitted static pie patch > for arm as well as the working code for aarch64. > > I tested with a host of mips-elf and checked with mips-sim. This patch was > also tested and used with uclibc-ng to generate static pie elfs. > > This is my first patch for gcc, so please let me know if there is anything > I missed. > > > > Signed-off-by: linted > --- > gcc/config/mips/gnu-user.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h > index 6aad7192e69..b1c665b7f37 100644 > --- a/gcc/config/mips/gnu-user.h > +++ b/gcc/config/mips/gnu-user.h > @@ -56,11 +56,12 @@ along with GCC; see the file COPYING3. If not see > #define GNU_USER_TARGET_LINK_SPEC "\ > %{G*} %{EB} %{EL} %{mips*} %{shared} \ > %{!shared: \ > - %{!static: \ > + %{!static:%{!static-pie: \ > %{rdynamic:-export-dynamic} \ > %{mabi=n32: -dynamic-linker " GNU_USER_DYNAMIC_LINKERN32 "} \ > %{mabi=64: -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "} \ > - %{mabi=32: -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \ > + %{mabi=32: -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}}} \ > + %{static-pie:-Bstatic -pie --no-dynamic-linker -z text} \ > %{static}} \ > %{mabi=n32:-m" GNU_USER_LINK_EMULATIONN32 "} \ > %{mabi=64:-m" GNU_USER_LINK_EMULATION64 "} \ > -- > 2.34.1 > > > --000000000000b3aa4a05e9825dcc--