Skip to content

Commit 4c078c8

Browse files
bwendlingmpe
authored andcommitted
powerpc/boot/wrapper: Add "-z notext" flag to disable diagnostic
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. Signed-off-by: Bill Wendling <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 26ba9f9 commit 4c078c8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/powerpc/boot/wrapper

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ compression=.gz
4646
uboot_comp=gzip
4747
pie=
4848
format=
49+
notext=
4950
rodynamic=
5051

5152
# cross-compilation prefix
@@ -354,6 +355,7 @@ epapr)
354355
platformo="$object/pseries-head.o $object/epapr.o $object/epapr-wrapper.o"
355356
link_address='0x20000000'
356357
pie=-pie
358+
notext='-z notext'
357359
rodynamic=$(if ${CROSS}ld -V 2>&1 | grep -q LLD ; then echo "-z rodynamic"; fi)
358360
;;
359361
mvme5100)
@@ -495,7 +497,7 @@ if [ "$platform" != "miboot" ]; then
495497
text_start="-Ttext $link_address"
496498
fi
497499
#link everything
498-
${CROSS}ld -m $format -T $lds $text_start $pie $nodl $rodynamic -o "$ofile" $map \
500+
${CROSS}ld -m $format -T $lds $text_start $pie $nodl $rodynamic $notext -o "$ofile" $map \
499501
$platformo $tmp $object/wrapper.a
500502
rm $tmp
501503
fi

0 commit comments

Comments
 (0)