android_kernel_oneplus_msm8998/arch
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
..
alpha sys: don't hold uts_sem while accessing userspace memory 2018-09-09 20:04:35 +02:00
arc ARC: build: Get rid of toolchain check 2018-10-20 09:52:38 +02:00
arm ARM: dts: imx53-qsb: disable 1.2GHz OPP 2018-11-10 07:41:40 -08:00
arm64 arm64: dts: stratix10: Correct System Manager register size 2018-11-21 09:27:37 +01:00
avr32
blackfin pinctrl: adi2: Fix Kconfig build problem 2017-12-20 10:05:00 +01:00
c6x
cris
frv futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
h8300
hexagon hexagon: modify ffs() and fls() to return int 2018-10-10 08:52:12 +02:00
ia64 futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
m32r
m68k m68k: fix "bad page state" oops on ColdFire boot 2018-08-24 13:26:57 +02:00
metag
microblaze microblaze: Fix simpleImage format generation 2018-08-06 16:24:39 +02:00
mips MIPS: kexec: Mark CPU offline before disabling local IRQ 2018-11-21 09:27:38 +01:00
mn10300 mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy 2018-02-16 20:09:47 +01:00
nios2
openrisc kthread: fix boot hang (regression) on MIPS/OpenRISC 2018-09-19 22:48:55 +02:00
parisc parisc: Fix map_pages() to not overwrite existing pte entries 2018-11-21 09:27:30 +01:00
powerpc powerpc/boot: Ensure _zimage_start is a weak symbol 2018-11-21 09:27:38 +01:00
s390 s390/extmem: fix gcc 8 stringop-overflow warning 2018-10-10 08:52:05 +02:00
score
sh sh: New gcc support 2018-06-06 16:46:20 +02:00
sparc sparc: Fix single-pcr perf event counter management. 2018-11-21 09:27:30 +01:00
tile futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
um um: Avoid longjmp/setjmp symbol clashes with libpthread.a 2018-11-10 07:41:35 -08:00
unicore32
x86 xen: fix xen_qlock_wait() 2018-11-21 09:27:36 +01:00
xtensa signal/xtensa: Consistenly use SIGBUS in do_unaligned_user 2018-07-03 11:21:26 +02:00
.gitignore
Kconfig