linux/arch/powerpc
Masahiro Yamada a19846f0f4 powerpc: align syscall table for ppc32
commit c7acee3d2f upstream.

Christophe Leroy reported that commit 7b4537199a ("kbuild: link
symbol CRCs at final link,  removing CONFIG_MODULE_REL_CRCS") broke
mpc85xx_defconfig + CONFIG_RELOCATABLE=y.

    LD      vmlinux
    SYSMAP  System.map
    SORTTAB vmlinux
    CHKREL  vmlinux
  WARNING: 451 bad relocations
  c0b312a9 R_PPC_UADDR32     .head.text-0x3ff9ed54
  c0b312ad R_PPC_UADDR32     .head.text-0x3ffac224
  c0b312b1 R_PPC_UADDR32     .head.text-0x3ffb09f4
  c0b312b5 R_PPC_UADDR32     .head.text-0x3fe184dc
  c0b312b9 R_PPC_UADDR32     .head.text-0x3fe183a8
      ...

The compiler emits a bunch of R_PPC_UADDR32, which is not supported by
arch/powerpc/kernel/reloc_32.S.

The reason is there exists an unaligned symbol.

  $ powerpc-linux-gnu-nm -n vmlinux
    ...
  c0b31258 d spe_aligninfo
  c0b31298 d __func__.0
  c0b312a9 D sys_call_table
  c0b319b8 d __func__.0

Commit 7b4537199a is not the root cause. Even before that, I can
reproduce the same issue for mpc85xx_defconfig + CONFIG_RELOCATABLE=y
+ CONFIG_MODVERSIONS=n.

It is just that nobody noticed because when CONFIG_MODVERSIONS is
enabled, a __crc_* symbol inserted before sys_call_table was hiding the
unalignment issue.

Adding alignment to the syscall table for ppc32 fixes the issue.

Cc: stable@vger.kernel.org
Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
[mpe: Trim change log discussion, add Cc stable]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/lkml/38605f6a-a568-f884-f06f-ea4da5b214f0@csgroup.eu/
Link: https://lore.kernel.org/r/20220820165129.1147589-1-masahiroy@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-08 12:28:03 +02:00
..
boot powerpc: flexible GPR range save/restore macros 2022-07-12 16:35:02 +02:00
configs Documentation, arch: Remove leftovers from CIFS_WEAK_PW_HASH 2022-01-27 11:05:21 +01:00
crypto powerpc: flexible GPR range save/restore macros 2022-07-12 16:35:02 +02:00
include powerpc: Fix eh field when calling lwarx on PPC32 2022-08-17 14:24:29 +02:00
kernel powerpc: align syscall table for ppc32 2022-09-08 12:28:03 +02:00
kexec powerpc: Set crashkernel offset to mid of RMA region 2022-04-13 20:59:03 +02:00
kvm KVM: PPC: Book3S HV: Fix "rm_exit" entry in debugfs timings 2022-08-25 11:40:40 +02:00
lib powerpc: flexible GPR range save/restore macros 2022-07-12 16:35:02 +02: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/32: Set an IBAT covering up to _einittext during init 2022-08-25 11:40:43 +02:00
net powerpc64/bpf: Limit 'ldbrx' to processors compliant with ISA v2.06 2022-02-01 17:27:09 +01:00
perf powerpc/perf: Optimize clearing the pending PMI and remove WARN_ON for PMI check in power_pmu_disable 2022-08-17 14:24:04 +02:00
platforms powerpc/ioda/iommu/debugfs: Generate unique debugfs entries 2022-08-25 11:40:43 +02:00
purgatory powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S 2021-04-08 21:17:43 +10:00
sysdev powerpc/xive: Fix refcount leak in xive_get_max_prio 2022-08-17 14:24:13 +02:00
tools powerpc/64: Add UADDR64 relocation support 2022-05-09 09:14:44 +02:00
xmon powerpc/xmon: fix task state output 2021-11-18 19:16:57 +01:00
Kbuild
Kconfig powerpc/memhotplug: Add add_pages override for PPC 2022-07-07 17:53:28 +02:00
Kconfig.debug powerpc/ptdump: Convert powerpc to GENERIC_PTDUMP 2021-08-25 13:35:48 +10:00
Makefile powerpc/32: Don't always pass -mcpu=powerpc to the compiler 2022-08-25 11:40:43 +02:00
Makefile.postlink