android_kernel_oneplus_msm8998/arch/powerpc
Joel Stanley c269f0b61c powerpc/boot: Ensure _zimage_start is a weak symbol
[ Upstream commit ee9d21b3b3583712029a0db65a4b7c081d08d3b3 ]

When building with clang crt0's _zimage_start is not marked weak, which
breaks the build when linking the kernel image:

 $ objdump -t arch/powerpc/boot/crt0.o |grep _zimage_start$
 0000000000000058 g       .text  0000000000000000 _zimage_start

 ld: arch/powerpc/boot/wrapper.a(crt0.o): in function '_zimage_start':
 (.text+0x58): multiple definition of '_zimage_start';
 arch/powerpc/boot/pseries-head.o:(.text+0x0): first defined here

Clang requires the .weak directive to appear after the symbol is
declared. The binutils manual says:

 This directive sets the weak attribute on the comma separated list of
 symbol names. If the symbols do not already exist, they will be
 created.

So it appears this is different with clang. The only reference I could
see for this was an OpenBSD mailing list post[1].

Changing it to be after the declaration fixes building with Clang, and
still works with GCC.

 $ objdump -t arch/powerpc/boot/crt0.o |grep _zimage_start$
 0000000000000058  w      .text	0000000000000000 _zimage_start

Reported to clang as https://bugs.llvm.org/show_bug.cgi?id=38921

[1] https://groups.google.com/forum/#!topic/fa.openbsd.tech/PAgKKen2YCY

Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-21 09:27:38 +01:00
..
boot powerpc/boot: Ensure _zimage_start is a weak symbol 2018-11-21 09:27:38 +01:00
configs powerpc updates for 4.4 2015-11-05 23:38:43 -08:00
crypto crypto: powerpc/md5 - use md5 IV MD5_HX instead of their raw value 2015-05-18 12:20:20 +08:00
include powerpc/msi: Fix compile error on mpc83xx 2018-11-21 09:27:36 +01:00
kernel powerpc/tm: Avoid possible userspace r1 corruption on reclaim 2018-10-20 09:52:38 +02:00
kvm KVM: PPC: Book3S HV: Don't truncate HPTE index in xlate function 2018-10-10 08:52:10 +02:00
lib powerpc/lib: Fix off-by-one in alternate feature patching 2018-04-24 09:32:11 +02:00
math-emu
mm powerpc/nohash: fix undefined behaviour when testing page size support 2018-11-21 09:27:38 +01:00
net powerpc/bpf/jit: Fix 32-bit JIT for seccomp_data access 2018-05-30 07:49:00 +02:00
oprofile powerpc: Remove mtmsrd(), use existing mtmsr() 2015-07-13 15:47:28 +10:00
perf powerpc/perf: Fix kernel address leak via sampling registers 2018-05-30 07:49:10 +02:00
platforms powerpc/powernv/ioda2: Reduce upper limit for DMA window size 2018-10-10 08:52:05 +02:00
sysdev powerpc: Fix size calculation using resource_size() 2018-09-15 09:40:39 +02:00
xmon powerpc/xmon: Add some more elements to the existing PACA dump list 2015-10-15 20:32:02 +11:00
Kconfig powerpc/64s: Wire up cpu_show_meltdown() 2018-02-16 20:09:36 +01:00
Kconfig.debug powerpc: Make STRICT_MM_TYPECHECKS a config option 2015-05-11 19:53:59 +10:00
Makefile powerpc/cell: Drop CONFIG_TUNE_CELL in favour of CONFIG_CELL_CPU 2015-10-19 19:51:18 +11:00
relocs_check.sh powerpc: Convert relocs_check to a shell script using grep 2015-03-23 14:47:39 +11:00