From: Bill Wendling <morbo@google.com>
To: Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org
Cc: Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Fangrui Song <maskray@google.com>, Alan Modra <amodra@gmail.com>
Subject: [PATCH] powerpc/wrapper: add "-z rodynamic" when using LLD
Date: Wed, 18 Nov 2020 14:39:10 -0800 [thread overview]
Message-ID: <20201118223910.2711337-1-morbo@google.com> (raw)
In-Reply-To: <20201017000151.150788-1-morbo@google.com>
Normally all read-only sections precede SHF_WRITE sections. .dynamic and
.got have the SHF_WRITE flag; .dynamic probably because of DT_DEBUG. LLD
emits an error when this happens, so use "-z rodynamic" to mark .dynamic
as read-only.
Cc: Fangrui Song <maskray@google.com>
Cc: Alan Modra <amodra@gmail.com>
Signed-off-by: Bill Wendling <morbo@google.com>
---
arch/powerpc/boot/wrapper | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index cd58a62e810d..e1194955adbb 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -46,6 +46,7 @@ compression=.gz
uboot_comp=gzip
pie=
format=
+rodynamic=
# 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
+ rodynamic=$(if ${CROSS}ld -V 2>&1 | grep -q LLD ; then echo "-z rodynamic"; fi)
;;
mvme5100)
platformo="$object/fixed-head.o $object/mvme5100.o"
@@ -493,7 +495,7 @@ 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 \
+ ${CROSS}ld -m $format -T $lds $text_start $pie $nodl $rodynamic -o "$ofile" $map \
$platformo $tmp $object/wrapper.a
rm $tmp
fi
--
2.29.2.454.gaff20da3a2-goog
next prev parent reply other threads:[~2020-11-18 22:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-17 0:01 [PATCH] powerpc/boot: move the .got section to after the .dynamic section Bill Wendling
2020-10-19 23:56 ` Fāng-ruì Sòng
2020-11-18 22:39 ` Bill Wendling [this message]
2020-11-18 22:55 ` [PATCH] powerpc/wrapper: add "-z rodynamic" when using LLD Fangrui Song
2020-12-10 11:30 ` Michael Ellerman
2020-12-10 11:30 ` [PATCH] powerpc/boot: move the .got section to after the .dynamic section Michael Ellerman
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=20201118223910.2711337-1-morbo@google.com \
--to=morbo@google.com \
--cc=amodra@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maskray@google.com \
--cc=mpe@ellerman.id.au \
--cc=ndesaulniers@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.