Message ID | cc111d36-cb4b-6638-331c-11b99e5e899c@gmail.com |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e252:0:0:0:0:0 with SMTP id bl18csp964979wrb; Wed, 20 Jul 2022 07:07:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tIGU5RWImVpuiD4M0DczTYMABoTYIK9WNxJgv8kwW/9nRbL6dP+xUMsvFiW5gZaXlwgEHn X-Received: by 2002:a17:907:7245:b0:72f:39e7:1207 with SMTP id ds5-20020a170907724500b0072f39e71207mr13229548ejc.201.1658326056914; Wed, 20 Jul 2022 07:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658326056; cv=none; d=google.com; s=arc-20160816; b=XxWDUpuQGqw3wfjG3X3AVibRsY7Df1MTjsNS1pTaywqMQyVDlhSTCuYQjk0YPmkCXj QXhNUlCZmPU2Yjf5En5qBezegm6usXLYFv/PJz4sZkd+VbhbmwonTzFreC4HHFf4OY+z nAqS6efxSR0Hl3GRhsQoAqxFrc5cQAn2rO6BiolWC/C9KQ3VPU0v8KZ4VhQmpRtXAJ7k mF+NbiyPbmYFMatuqOYR8VyhtActOgto86dCZXDV2Go+6XdPQRnFmw39UXVN6SBBdEy7 90u8CgtJMV2x8nxe1K/gScDjTmbJ82kUR9cl/jSXLSgU0WKxTRCBtx97f3f0ABi1k1+q yplw== 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:subject:to :content-language:user-agent:mime-version:date:message-id :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=mv4R50dmNu8hJ5p2Qb7jMmBmbz6o7+R4bMoUbUcS6wg=; b=C+kknbCC9gPiZUdJdN8T6q73FiPJe7Yq9PUTYZ8LtQS2CS9bKUM0WfRZ5tm6mO6WA7 CYGaVajszNlGiQHDbeaocVY466AcRhaT/sdNBPi68tV/mlEpjsF7plxtWLaHERjDggLl T4li0Us8358nxFZwpsllndZeKmI3I4UNRwThp5DSeDeiZPcm+uiPy9RsitbpRir2sVnr JZfoPkNkmLtrEwxi7+yKUvOYgVMVImI/c+krCNzq2KS4qjTthpanJtuBIWOSS2lX8pTK sRX+iVRwStktjEpLynxTeoXDyDNeIuBVwBfSLUIvqvv/KU1jiFY9RrJmNtNg8rzHhW0U 8Gdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ggIaZ0Sm; 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 sc9-20020a1709078a0900b0072b95d4453esi384068ejc.137.2022.07.20.07.07.36 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 07:07: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=ggIaZ0Sm; 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 9A5453857C7D for <ouuuleilei@gmail.com>; Wed, 20 Jul 2022 14:07:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A5453857C7D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1658326050; bh=mv4R50dmNu8hJ5p2Qb7jMmBmbz6o7+R4bMoUbUcS6wg=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ggIaZ0SmevxgQZvBGsu2K0adT0NAlz35VRzGcI6+Lr+UYXCB0qu2aPlemmNFfuCXT kPcPJe2rzTyQVLFyY5Z92KEbJ7PvFg6vZdM1smjQ0WQUREjOSJ9BmoQwZv06WHA9TF x/AVbUhJnxPJK9K82SVfUy1f7MJS2dB0sPYp70LY= 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-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1738880903265297898?= X-GMAIL-MSGID: =?utf-8?q?1738880903265297898?= |
Series |
[V2] arm: add -static-pie support
|
|
Commit Message
Li, Pan2 via Gcc-patches
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