]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
elfcore: fix building with clang
authorArnd Bergmann <arnd@arndb.de>
Fri, 11 Dec 2020 21:36:46 +0000 (13:36 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 19 Feb 2021 15:45:13 +0000 (16:45 +0100)
commit711045c286522cde7cfc200478523c97252150df
tree2fa0566f12bf2f8ade0c92d2e6aca3b75af5fb59
parentdb4683b87e057f1dc1cc3df58b9abc64ea3fde45
elfcore: fix building with clang

BugLink: https://bugs.launchpad.net/bugs/1915186
commit 6e7b64b9dd6d96537d816ea07ec26b7dedd397b9 upstream.

kernel/elfcore.c only contains weak symbols, which triggers a bug with
clang in combination with recordmcount:

  Cannot find symbol for section 2: .text.
  kernel/elfcore.o: failed

Move the empty stubs into linux/elfcore.h as inline functions.  As only
two architectures use these, just use the architecture specific Kconfig
symbols to key off the declaration.

Link: https://lkml.kernel.org/r/20201204165742.3815221-2-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Barret Rhoden <brho@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jian Cai <jiancai@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: William Breathitt Gray <william.gray@canonical.com>
include/linux/elfcore.h
kernel/Makefile
kernel/elfcore.c [deleted file]