Ubuntu-focal-kernel/tools
Josh Poimboeuf 553fe231cd objtool: Support Clang non-section symbols in ORC generation
BugLink: https://bugs.launchpad.net/bugs/1904445

commit e81e072443 upstream.

When compiling the kernel with AS=clang, objtool produces a lot of
warnings:

  warning: objtool: missing symbol for section .text
  warning: objtool: missing symbol for section .init.text
  warning: objtool: missing symbol for section .ref.text

It then fails to generate the ORC table.

The problem is that objtool assumes text section symbols always exist.
But the Clang assembler is aggressive about removing them.

When generating relocations for the ORC table, objtool always tries to
reference instructions by their section symbol offset.  If the section
symbol doesn't exist, it bails.

Do a fallback: when a section symbol isn't available, reference a
function symbol instead.

Reported-by: Dmitry Golovin <dima@golovin.in>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://github.com/ClangBuiltLinux/linux/issues/669
Link: https://lkml.kernel.org/r/9a9cae7fcf628843aabe5a086b1a3c5bf50f42e8.1585761021.git.jpoimboe@redhat.com
Cc: Nick Desaulniers <ndesaulniers@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>
2020-12-10 12:02:24 +01:00
..
accounting tools/accounting/getdelays.c: fix netlink attribute length 2020-05-05 12:32:22 +02:00
arch x86/syscalls: Revert "x86/syscalls: Make __X32_SYSCALL_BIT be unsigned long" 2020-06-22 17:23:35 -03:00
bpf tools, bpftool: Fix wrong return value in do_dump() 2020-09-04 16:29:21 -03:00
build tools build feature: Quote CC and CXX for their arguments 2020-09-04 16:30:11 -03:00
cgroup iocost_monitor: drop string wrap around numbers when outputting json 2020-08-08 01:53:12 -04:00
debugging
firewire
firmware
gpio tools: gpio-hammer: Avoid potential overflow in main 2020-11-09 14:47:41 +01:00
hv UBUNTU: SAUCE: tools: hv: Update shebang to use python3 instead of python 2020-01-08 08:45:12 -06:00
iio
include perf tools: Correct SNOOPX field offset 2020-09-17 00:47:05 -06:00
io_uring tools/io_uring: fix compile breakage 2020-11-09 14:48:10 +01:00
kvm/kvm_stat tools/kvm_stat: Fix kvm_exit filter name 2020-02-17 11:10:45 +01:00
laptop
leds
lib libbpf: Remove arch-specific include path in Makefile 2020-11-09 14:48:08 +01:00
memory-model tools/memory-model: Fix data race detection for unordered store and load 2020-01-06 08:15:00 -06:00
nfsd
objtool objtool: Support Clang non-section symbols in ORC generation 2020-12-10 12:02:24 +01:00
pci tools: PCI: Fix fd leakage 2020-01-30 16:25:07 +01:00
pcmcia
perf perf stat: Skip duration_time in setup_system_wide 2020-11-09 14:48:58 +01:00
power tools/power/x86/intel_pstate_tracer: changes for python 3 compatibility 2020-11-09 14:47:29 +01:00
scripts tools: Let O= makes handle a relative path with -C option 2020-04-03 15:17:23 +02:00
spi
testing selftests/powerpc: entry flush test 2020-11-23 13:44:06 -03:00
thermal/tmon
time
usb usbip: Fix unsafe unaligned pointer usage 2020-02-24 16:19:52 +01:00
virtio
vm tools/vm: fix cross-compile build 2020-05-25 10:41:49 +02:00
wmi
Makefile