linux-stable/arch/powerpc
Fangrui Song 0355785313 powerpc: Add "-z notext" flag to disable diagnostic
Object files used to link .tmp_vmlinux.kallsyms1 have many
R_PPC64_ADDR64 relocations in non-SHF_WRITE sections. There are many
text relocations (e.g. in .rela___ksymtab_gpl+* and .rela__mcount_loc
sections) in a -pie link and are disallowed by LLD:

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

Newer GNU ld configured with "--enable-textrel-check=error" will report
an error as well:

  $ ld-new -EL -m elf64lppc -pie ... -o .tmp_vmlinux.kallsyms1 ...
  ld-new: read-only segment has dynamic relocations

Add "-z notext" to suppress the errors. Non-CONFIG_RELOCATABLE builds
use the default -no-pie mode and thus R_PPC64_ADDR64 relocations can be
resolved at link-time.

Reported-by: Itaru Kitayama <itaru.kitayama@riken.jp>
Co-developed-by: Bill Wendling <morbo@google.com>
Signed-off-by: Fangrui Song <maskray@google.com>
Signed-off-by: Bill Wendling <morbo@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210813200511.1905703-1-morbo@google.com
2021-08-15 13:49:39 +10:00
..
boot powerpc: wii.dts: Expose the OTP on this platform 2021-08-13 22:04:25 +10:00
configs powerpc: wii_defconfig: Enable OTP by default 2021-08-13 22:04:25 +10:00
crypto crypto: powepc/sha1 - remove unneeded semicolon 2021-03-07 15:13:14 +11:00
include powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto 2021-08-15 13:49:24 +10:00
kernel powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto 2021-08-15 13:49:24 +10:00
kexec powerpc/kexec: fix for_each_child.cocci warning 2021-08-10 23:14:55 +10:00
kvm powerpc: rename powerpc_debugfs_root to arch_debugfs_dir 2021-08-13 22:04:26 +10:00
lib powerpc: Only build restart_table.c for 64s 2021-07-01 22:50:54 +10:00
math-emu powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
mm powerpc/pseries: Add support for FORM2 associativity 2021-08-13 22:04:27 +10:00
net powerpc/bpf: Reject atomic ops in ppc32 JIT 2021-07-05 22:23:25 +10:00
perf powerpc/64s/perf: Always use SIAR for kernel interrupts 2021-08-04 10:53:39 +10:00
platforms powerpc/pseries: Add support for FORM2 associativity 2021-08-13 22:04:27 +10:00
purgatory powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S 2021-04-08 21:17:43 +10:00
sysdev powerpc: rename powerpc_debugfs_root to arch_debugfs_dir 2021-08-13 22:04:26 +10:00
tools
xmon powerpc: rename powerpc_debugfs_root to arch_debugfs_dir 2021-08-13 22:04:26 +10:00
Kbuild
Kconfig powerpc updates for 5.14 2021-07-02 12:54:34 -07:00
Kconfig.debug powerpc: Make PPC_IRQ_SOFT_MASK_DEBUG depend on PPC64 2021-06-25 00:07:09 +10:00
Makefile powerpc: Add "-z notext" flag to disable diagnostic 2021-08-15 13:49:39 +10:00
Makefile.postlink