summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorBill Wendling <morbo@google.com>2020-11-18 14:39:10 -0800
committerMichael Ellerman <mpe@ellerman.id.au>2020-11-26 22:05:43 +1100
commit26ba9f9651d802ba38583138f43fea5dc7eb0fd6 (patch)
tree52e1bb4ddf2dfd74f3742b96eb36f4a89898d0e2 /arch
parenta538d184e3f0e3b5f800c5ab148e83bb5cdd0133 (diff)
powerpc/boot/wrapper: Add "-z rodynamic" when using LLD
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. Signed-off-by: Bill Wendling <morbo@google.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20201118223910.2711337-1-morbo@google.com
Diffstat (limited to 'arch')
-rwxr-xr-xarch/powerpc/boot/wrapper4
1 files changed, 3 insertions, 1 deletions
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