linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Bill Wendling <morbo@google.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Fangrui Song <maskray@google.com>, Alan Modra <amodra@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	Bill Wendling <morbo@google.com>
Subject: [PATCH 1/2] powerpc/wrapper: Add "-z notext" flag to disable diagnostic
Date: Fri, 16 Oct 2020 17:47:51 -0700	[thread overview]
Message-ID: <20201017004752.415054-2-morbo@google.com> (raw)
In-Reply-To: <20201017004752.415054-1-morbo@google.com>

The "-z notext" flag disables reporting an error if DT_TEXTREL is set.

  ld.lld: error: can't create dynamic relocation R_PPC64_ADDR64 against
    symbol: _start in readonly segment; recompile object files with
    -fPIC or pass '-Wl,-z,notext' to allow text relocations in the
    output
  >>> defined in
  >>> referenced by crt0.o:(.text+0x8) in archive arch/powerpc/boot/wrapper.a

The BFD linker disables this by default (though it's configurable in
current versions). LLD enables this by default. So we add the flag to
keep LLD from emitting the error.

Cc: Fangrui Song <maskray@google.com>
Cc: Alan Modra <amodra@gmail.com>
Signed-off-by: Bill Wendling <morbo@google.com>
---
 arch/powerpc/boot/wrapper | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index cd58a62e810d..e576d3e4b23f 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -46,6 +46,7 @@ compression=.gz
 uboot_comp=gzip
 pie=
 format=
+notext=
 
 # cross-compilation prefix
 CROSS=
@@ -353,6 +354,7 @@ epapr)
     platformo="$object/pseries-head.o $object/epapr.o $object/epapr-wrapper.o"
     link_address='0x20000000'
     pie=-pie
+    notext='-z notext'
     ;;
 mvme5100)
     platformo="$object/fixed-head.o $object/mvme5100.o"
@@ -493,8 +495,8 @@ if [ "$platform" != "miboot" ]; then
         text_start="-Ttext $link_address"
     fi
 #link everything
-    ${CROSS}ld -m $format -T $lds $text_start $pie $nodl -o "$ofile" $map \
-	$platformo $tmp $object/wrapper.a
+    ${CROSS}ld -m $format -T $lds $text_start $pie $notext $nodl -o "$ofile" \
+        $map $platformo $tmp $object/wrapper.a
     rm $tmp
 fi
 
-- 
2.29.0.rc1.297.gfa9743e501-goog


  reply	other threads:[~2020-10-17  0:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-17  0:47 [PATCH 0/2] Fixes for clang/lld Bill Wendling
2020-10-17  0:47 ` Bill Wendling [this message]
2020-10-17  0:47 ` [PATCH 2/2] powerpc/boot: Use clang when CC is clang Bill Wendling
2020-11-18 22:35   ` [PATCH 0/3] PPC: fixes for clang support Bill Wendling
2020-11-20 22:40     ` [PATCH v3 " Bill Wendling
2020-11-20 22:40       ` [PATCH 1/3] powerpc/wrapper: add "-z notext" flag to disable diagnostic Bill Wendling
2020-11-20 22:40       ` [PATCH v3 2/3] powerpc/boot: Use clang when CC is clang Bill Wendling
2020-11-20 22:40       ` [PATCH v3 3/3] powerpc/64s: feature: Work around inline asm issues Bill Wendling
2020-11-23  5:44         ` Michael Ellerman
2020-11-23  6:34           ` Segher Boessenkool
2020-11-23 19:43             ` Bill Wendling
2020-11-23 19:53               ` Bill Wendling
2020-11-23 19:56               ` Segher Boessenkool
2020-11-23 20:01                 ` Bill Wendling
2020-11-23 20:08                   ` Segher Boessenkool
2020-11-23 20:17                     ` Bill Wendling
2020-11-24  3:43                       ` Michael Ellerman
2020-11-25  5:13                         ` Bill Wendling
2020-11-27  1:03                           ` Michael Ellerman
2020-11-27  1:10                             ` Bill Wendling
2020-11-27  1:59                             ` Bill Wendling
2020-11-18 22:35   ` [PATCH 1/3] powerpc/wrapper: add "-z notext" flag to disable diagnostic Bill Wendling
2020-11-18 22:35   ` [PATCH 2/3] powerpc/boot: Use clang when CC is clang Bill Wendling
2020-11-18 22:35   ` [PATCH 3/3] powerpc/64s: feature: work around inline asm issues Bill Wendling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201017004752.415054-2-morbo@google.com \
    --to=morbo@google.com \
    --cc=amodra@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maskray@google.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).