Message ID | cc111d36-cb4b-6638-331c-11b99e5e899c@gmail.com |
---|---|
State | Under Review |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D5A0D3858009 for <patchwork@sourceware.org>; Wed, 20 Jul 2022 14:07:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5A0D3858009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1658326036; bh=mv4R50dmNu8hJ5p2Qb7jMmBmbz6o7+R4bMoUbUcS6wg=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=eWnY3a0rg+eaUUJBkM5oOv48DAe2KrZ1Iae/Mccp1x0grZ/WXogOO6+m8heTlXVLG l8VqT3C6h2XpVhMxmJN94SrcV4/b9IE/uwKYU3Cb4JA3QO95M6NFj8e/KKDPrIY2Z6 Po/tlJ0y7VzULurhgXHnId8lx9ueeW0raMbgKiFU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id ADFE33858D37 for <gcc-patches@gcc.gnu.org>; Wed, 20 Jul 2022 14:06:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ADFE33858D37 Received: by mail-ot1-x334.google.com with SMTP id a14-20020a0568300b8e00b0061c4e3eb52aso14208123otv.3 for <gcc-patches@gcc.gnu.org>; Wed, 20 Jul 2022 07:06:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:from:subject; bh=mv4R50dmNu8hJ5p2Qb7jMmBmbz6o7+R4bMoUbUcS6wg=; b=jNcCOBq4yL6+GSBwsAVhZqZ5JgpdgD2WjnpNz/OWBu0GW7kxmVEaW8H4qqRR0Hdetf Bo2k5Uu86mtvgoZt3PEs7AZutOF4GxDncz6edw02d/fCI0ZhrOG93reZx/VlF4kZ1gbA kM5SSfvzA/JZjrpHMp/W6M2ZsozA3GpgjqBDntBWs33m8tROWnpjv6JckVFWF8OfoYX0 5UayXzGU/S/4BiXGmYRVo+ChaJfSlxUZZOOblN66uUvO+3ZwjsOespn9vo5x5HPw71+c 5b+8zJKq9H+3wukeU7OZTSAW9tI4NMcENnigKzccjq9iv9pbzjmUwohIa6FxAo8e66/X MyNg== X-Gm-Message-State: AJIora/Km7ZgFrS6jNuPKxTA/tGTu4iLoWRR+sXcKo+qutr61FZfw8SC 6Eq4hqyS6zUuvYLzSha1ZSn/aAkvXKcPwg== X-Google-Smtp-Source: AGRyM1soyFhEw06fxcoQpDA5EY4sCi21cCoSGbYt1yARVdeojZ7PCXYKPGZyUuTtUTNXS9yQuRUchg== X-Received: by 2002:a05:6830:2b0c:b0:61c:a516:2150 with SMTP id l12-20020a0568302b0c00b0061ca5162150mr6012699otv.255.1658325997449; Wed, 20 Jul 2022 07:06:37 -0700 (PDT) Received: from [10.0.0.73] (96-82-249-149-static.hfc.comcastbusiness.net. [96.82.249.149]) by smtp.gmail.com with ESMTPSA id a15-20020a056870618f00b00101cdb417f1sm9056870oah.22.2022.07.20.07.06.36 for <gcc-patches@gcc.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Jul 2022 07:06:36 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------qchqO7wMg0U22Oqy0TwdlrPq" Message-ID: <cc111d36-cb4b-6638-331c-11b99e5e899c@gmail.com> Date: Wed, 20 Jul 2022 08:06:35 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.0.2 Content-Language: en-US To: gcc-patches@gcc.gnu.org Subject: [PATCH V2] arm: add -static-pie support X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Lance Fredrickson via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Lance Fredrickson <lancethepants@gmail.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
[V2] arm: add -static-pie support
|
|
Commit Message
Lance Fredrickson
July 20, 2022, 2:06 p.m. UTC
This patch adds -static-pie support for the arm architecture. aarch64 had the appropriate code for handling -static-pie, so this just mirrors the code found there. Tested with uclibc-ng and musl c-standard libraries to produce static-pie binaries. Re-submitted with minor spell check fix. From 4e122adfea2a6247f2da0c094f3203cbdf2a578c Mon Sep 17 00:00:00 2001 From: lancethepants <lancethepants@gmail.com> Date: Tue, 19 Jul 2022 14:21:05 -0600 Subject: [PATCH V2] arm: add -static-pie support The commit mirrors code from aarch64 to handle -static-pie. Tested with uclibc-ng and musl c-standard libraries. Signed-off-by: Lance Fredrickson <lancethepants@gmail.com> --- gcc/config/arm/linux-elf.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Comments
Just a follow up trying to get some eyes on my static-pie patch submission for arm. Feedback welcome. https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598610.html thanks, Lance Fredrickson
Hi Lance, Thanks for your contribution - looks like your first one to GCC ? The patch looks good to me, though it should probably go through a full test suite run on arm-linux-gnueabihf and get a ChangeLog - see here for more https://gcc.gnu.org/contribute.html#patches. This is probably small enough to go under the 10 line rule but since you've used Signed-off-by in your patch, is that indicating you are contributing under DCO rules - https://gcc.gnu.org/contribute.html#legal ? regards Ramana On Thu, Aug 4, 2022 at 5:48 PM Lance Fredrickson via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > Just a follow up trying to get some eyes on my static-pie patch > submission for arm. > Feedback welcome. > https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598610.html > > thanks, > Lance Fredrickson
Yes, this is a 1st submission. Yes, I guess I was going for DCO rules. I will look at running the test suite. Does this need to be done on the target? because my arm target is a measly dual core 1ghz embedded chip and low ram. Netgear R7000 router actually. regards Lance On 8/10/2022 2:30 PM, Ramana Radhakrishnan wrote: > Hi Lance, > > Thanks for your contribution - looks like your first one to GCC ? > > The patch looks good to me, though it should probably go through a > full test suite run on arm-linux-gnueabihf and get a ChangeLog - see > here for more https://gcc.gnu.org/contribute.html#patches. > > This is probably small enough to go under the 10 line rule but since > you've used Signed-off-by in your patch, is that indicating you are > contributing under DCO rules - > https://gcc.gnu.org/contribute.html#legal ? > > regards > Ramana > > > On Thu, Aug 4, 2022 at 5:48 PM Lance Fredrickson via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: >> Just a follow up trying to get some eyes on my static-pie patch >> submission for arm. >> Feedback welcome. >> https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598610.html >> >> thanks, >> Lance Fredrickson
Lance Fredrickson via Gcc-patches <gcc-patches@gcc.gnu.org> writes: > Yes, this is a 1st submission. > Yes, I guess I was going for DCO rules. > I will look at running the test suite. Does this need to be done on > the target? because my arm target is a measly dual core 1ghz embedded > chip and low ram. Netgear R7000 router actually. Hi Lance, you should be able to use qemu to run arm-linux-gnueabihf binaries and as a consequance the testsuite if you prefer. BR Andrea
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h index df3da67c4f0..70f71b051a3 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -66,9 +66,10 @@ %{static:-Bstatic} \ %{shared:-shared} \ %{symbolic:-Bsymbolic} \ - %{!static: \ + %{!static:%{!static-pie: \ %{rdynamic:-export-dynamic} \ - %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \ + %{!shared:-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}} \ + %{static-pie:-Bstatic -pie --no-dynamic-linker -z text} \ -X \ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ SUBTARGET_EXTRA_LINK_SPEC