can't find file to patch at input line 122 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From patchwork Wed May 12 03:28:35 2021 |Content-Type: text/plain; charset="utf-8" |MIME-Version: 1.0 |Content-Transfer-Encoding: 7bit |X-Patchwork-Submitter: =?utf-8?b?RsSBbmctcnXDrCBTw7JuZw==?= | |X-Patchwork-Id: 43379 |Return-Path: |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 A18CD3844041; | Wed, 12 May 2021 03:28:45 +0000 (GMT) |DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A18CD3844041 |DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; | s=default; t=1620790125; | bh=ekDgQsOiTZr660bRcG4FeZeKKAjVgqUR5Th7OuCXz98=; | h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: | List-Help:List-Subscribe:From:Reply-To:Cc:From; | b=Z8PT2FTZ/mhwwwe9INk1qEM5ID8jOe3ME6yGIZxTyWvbc/sVEik9UFTsPkopHMbif | Fx0oUyqjZYzrfRnK2N7WTapvKNqhDcsNbhV4G4epeITRc3y8ehAKjavq6enmhwULWt | tUBDC0lYIYS6fnjnWuuRv1s6mjbDUcyskv0wqKiA= |X-Original-To: libc-alpha@sourceware.org |Delivered-To: libc-alpha@sourceware.org |Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com | [IPv6:2607:f8b0:4864:20::449]) | by sourceware.org (Postfix) with ESMTPS id 7D12C38460A3 | for ; Wed, 12 May 2021 03:28:39 +0000 (GMT) |DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7D12C38460A3 |Received: by mail-pf1-x449.google.com with SMTP id | s5-20020aa78d450000b02902ace63a7e93so8522903pfe.8 | for ; Tue, 11 May 2021 20:28:39 -0700 (PDT) |X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; | d=1e100.net; s=20161025; | h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; | bh=ekDgQsOiTZr660bRcG4FeZeKKAjVgqUR5Th7OuCXz98=; | b=P5PFIcCapZKDdBXAWViwPWiS7BfDM3gS8DPLMlmAQZNrxMlJu1cCs+Uy8KYSMhqhc3 | nWzzNBSt2IF/1XJEFD+kgkCblEDum19baAGypiHxBFYcQ8t7nvM0unOTvCQBxCMMel86 | zA7QFvVVjYswKVbhmlDHmLoPsThvSxIYzLGjzu7R2ofgIVeKEmwD9VvJo3cqf70QjuZZ | 6aQ3LmFnn+yy/wXqQG6UmMdscVkNLnWsUVW5CPphJFI9d6/VaDxJtmIkLYzK5vW4bFbb | sI4RCrQ+1uns/vHy2skhQjU+I3Y+wfWyJAUB65AIV6z7F96vWTMUKzntV1n0wFBz9fky | tQow== |X-Gm-Message-State: AOAM533Zq7cJLtQN6Y4wEgEmmzXbWto+GROqiaJZbq2O1+NP2E/BkFLE | mPNOM2SUGwfx/Iu7OcyvIGf/24sFIvdVOLnfsRc5JwHFir4xckKEdrMYo3Ber8vXIYSHDd6G+Qp | QyaWlyNFAoZFrQKBh0+qfBEVGBC+Eu/NMMHv19vOAlBaiUFhtCuTOS/p65QsawVC9sghn |X-Google-Smtp-Source: | ABdhPJyVe5W4qlvF+UbxiOwkkqnu6gJ3Vc6Dh7qPLFP+4Gyveb0wxWXbYf1uBQ1yYqFaaW+TDHMF7qMj+0va |X-Received: from maskray1.svl.corp.google.com | ([2620:15c:2ce:200:2b7e:7aa6:3858:3fc8]) | (user=maskray job=sendgmr) by 2002:a17:90a:6345:: with SMTP id | v5mr8899522pjs.139.1620790118316; Tue, 11 May 2021 20:28:38 -0700 (PDT) |Date: Tue, 11 May 2021 20:28:35 -0700 |Message-Id: <20210512032835.1611312-1-maskray@google.com> |Mime-Version: 1.0 |X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog |Subject: [PATCH] x86-64: Remove HAVE_LD_PIE_COPYRELOC |To: libc-alpha@sourceware.org, Jan Hubicka , | Florian Weimer , "H.J. Lu" |X-Spam-Status: No, score=-18.8 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, | DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, | KAM_SHORT, | KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, | USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 |X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on | server2.sourceware.org |X-BeenThere: libc-alpha@sourceware.org |X-Mailman-Version: 2.1.29 |Precedence: list |List-Id: Libc-alpha mailing list |List-Unsubscribe: , | |List-Archive: |List-Post: |List-Help: |List-Subscribe: , | |X-Patchwork-Original-From: Fangrui Song via Libc-alpha | |From: =?utf-8?b?RsSBbmctcnXDrCBTw7JuZw==?= |Reply-To: Fangrui Song |Cc: Fangrui Song |Errors-To: libc-alpha-bounces@sourceware.org |Sender: "Libc-alpha" | |This was introduced in 2014-12 to use local binding for external symbols |for -fPIE. Now that we have H.J. Lu's GOTPCRELX for years which mostly |nullify the benefit of HAVE_LD_PIE_COPYRELOC, HAVE_LD_PIE_COPYRELOC |should retire now. | |One design goal of -fPIE was to avoid copy relocations. |HAVE_LD_PIE_COPYRELOC has deviated from the goal. With this change, the |-fPIE behavior of x86-64 will be closer to x86-32 and other targets. |--- | |See https://gcc.gnu.org/legacy-ml/gcc/2019-05/msg00215.html for a list |of fixed and unfixed (e.g. gold incompatibility with protected |https://sourceware.org/bugzilla/show_bug.cgi?id=19823) issues. | |If you prefer a longer write-up, see |https://maskray.me/blog/2021-01-09-copy-relocations-canonical-plt-entries-and-protected |--- | gcc/config.in | 6 --- | gcc/config/i386/i386.c | 11 +--- | gcc/configure | 52 ------------------- | gcc/configure.ac | 48 ----------------- | gcc/doc/sourcebuild.texi | 3 -- | .../gcc.target/i386/pie-copyrelocs-1.c | 14 ----- | .../gcc.target/i386/pie-copyrelocs-2.c | 14 ----- | .../gcc.target/i386/pie-copyrelocs-3.c | 14 ----- | .../gcc.target/i386/pie-copyrelocs-4.c | 17 ------ | gcc/testsuite/lib/target-supports.exp | 47 ----------------- | 10 files changed, 2 insertions(+), 224 deletions(-) | delete mode 100644 gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c | delete mode 100644 gcc/testsuite/gcc.target/i386/pie-copyrelocs-2.c | delete mode 100644 gcc/testsuite/gcc.target/i386/pie-copyrelocs-3.c | delete mode 100644 gcc/testsuite/gcc.target/i386/pie-copyrelocs-4.c | |diff --git a/gcc/config.in b/gcc/config.in |index e54f59ce0c3..a65bf5d4176 100644 |--- a/gcc/config.in |+++ b/gcc/config.in -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 139 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c |index 915f89f571a..5ec3c6fd0c9 100644 |--- a/gcc/config/i386/i386.c |+++ b/gcc/config/i386/i386.c -------------------------- No file to patch. Skipping patch. 2 out of 2 hunks ignored can't find file to patch at input line 168 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/gcc/configure b/gcc/configure |index f03fe888384..c500f5ca11e 100755 |--- a/gcc/configure |+++ b/gcc/configure -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 231 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/gcc/configure.ac b/gcc/configure.ac |index e9ba2af548a..d60b22c1708 100644 |--- a/gcc/configure.ac |+++ b/gcc/configure.ac -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 290 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi |index 3a1d6536833..1c8019ea04c 100644 |--- a/gcc/doc/sourcebuild.texi |+++ b/gcc/doc/sourcebuild.texi -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored The next patch would delete the file gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c, which does not exist! Applying it anyway. patching file gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c.rej The next patch would delete the file gcc/testsuite/gcc.target/i386/pie-copyrelocs-2.c, which does not exist! Applying it anyway. patching file gcc/testsuite/gcc.target/i386/pie-copyrelocs-2.c Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file gcc/testsuite/gcc.target/i386/pie-copyrelocs-2.c.rej The next patch would delete the file gcc/testsuite/gcc.target/i386/pie-copyrelocs-3.c, which does not exist! Applying it anyway. patching file gcc/testsuite/gcc.target/i386/pie-copyrelocs-3.c Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file gcc/testsuite/gcc.target/i386/pie-copyrelocs-3.c.rej The next patch would delete the file gcc/testsuite/gcc.target/i386/pie-copyrelocs-4.c, which does not exist! Applying it anyway. patching file gcc/testsuite/gcc.target/i386/pie-copyrelocs-4.c Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file gcc/testsuite/gcc.target/i386/pie-copyrelocs-4.c.rej can't find file to patch at input line 387 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp |index 5700c231065..6f922ebf2ab 100644 |--- a/gcc/testsuite/lib/target-supports.exp |+++ b/gcc/testsuite/lib/target-supports.exp -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored Reject file gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c.rej: --- gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c +++ gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c @@ -1,14 +0,0 @@ -/* Check that GOTPCREL isn't used to access glob_a. */ -/* { dg-do compile { target *-*-linux* } } */ -/* { dg-require-effective-target pie_copyreloc } */ -/* { dg-options "-O2 -fpie" } */ - -extern int glob_a; - -int foo () -{ - return glob_a; -} - -/* glob_a should never be accessed with a GOTPCREL. */ -/* { dg-final { scan-assembler-not "glob_a@GOTPCREL" { target { ! ia32 } } } } */ Reject file gcc/testsuite/gcc.target/i386/pie-copyrelocs-2.c.rej: --- gcc/testsuite/gcc.target/i386/pie-copyrelocs-2.c +++ gcc/testsuite/gcc.target/i386/pie-copyrelocs-2.c @@ -1,14 +0,0 @@ -/* Check that GOTPCREL isn't used to access glob_a. */ -/* { dg-do compile { target *-*-linux* } } */ -/* { dg-require-effective-target pie_copyreloc } */ -/* { dg-options "-O2 -fpie" } */ - -int glob_a; - -int foo () -{ - return glob_a; -} - -/* glob_a should never be accessed with a GOTPCREL. */ -/* { dg-final { scan-assembler-not "glob_a@GOTPCREL" { target { ! ia32 } } } } */ Reject file gcc/testsuite/gcc.target/i386/pie-copyrelocs-3.c.rej: --- gcc/testsuite/gcc.target/i386/pie-copyrelocs-3.c +++ gcc/testsuite/gcc.target/i386/pie-copyrelocs-3.c @@ -1,14 +0,0 @@ -/* Check that PLT is used to access glob_a. */ -/* { dg-do compile { target *-*-linux* } } */ -/* { dg-require-effective-target pie_copyreloc } */ -/* { dg-options "-O2 -fpie" } */ - -extern int glob_a (void); - -int foo () -{ - return glob_a (); -} - -/* glob_a should be accessed with a PLT. */ -/* { dg-final { scan-assembler "glob_a@PLT" { target { ! ia32 } } } } */ Reject file gcc/testsuite/gcc.target/i386/pie-copyrelocs-4.c.rej: --- gcc/testsuite/gcc.target/i386/pie-copyrelocs-4.c +++ gcc/testsuite/gcc.target/i386/pie-copyrelocs-4.c @@ -1,17 +0,0 @@ -/* Check that GOTPCREL is used to access glob_a. */ -/* { dg-do compile { target *-*-linux* } } */ -/* { dg-require-effective-target pie_copyreloc } */ -/* { dg-options "-O2 -fpie" } */ - -extern int glob_a __attribute__((weak)); - -int foo () -{ - if (&glob_a != 0) - return glob_a; - else - return 0; -} - -/* weak glob_a should be accessed with a GOTPCREL. */ -/* { dg-final { scan-assembler "glob_a@GOTPCREL" { target { ! ia32 } } } } */