linux-loongson/tools
Tiezhu Yang a47bc954cf objtool/LoongArch: Get table size correctly if LTO is enabled
When compiling with LLVM and CONFIG_LTO_CLANG is set, there exist many
objtool warnings "sibling call from callable instruction with modified
stack frame".

For this special case, the related object file shows that there is no
generated relocation section '.rela.discard.tablejump_annotate' for the
table jump instruction jirl, thus objtool can not know that what is the
actual destination address.

It needs to do something on the LLVM side to make sure that there is the
relocation section '.rela.discard.tablejump_annotate' if LTO is enabled,
but in order to maintain compatibility for the current LLVM compiler,
this can be done in the kernel Makefile for now. Ensure it is aware of
linker with LTO, '--loongarch-annotate-tablejump' needs to be passed via
'-mllvm' to ld.lld.

Before doing the above changes, it should handle the special case of the
relocation section '.rela.discard.tablejump_annotate' to get the correct
table size first, otherwise there are many objtool warnings and errors
if LTO is enabled.

There are many different rodata for each function if LTO is enabled, it
is necessary to enhance get_rodata_table_size_by_table_annotate().

Fixes: b95f852d3a ("objtool/LoongArch: Add support for switch table")
Closes: https://lore.kernel.org/loongarch/20250731175655.GA1455142@ax162/
Reported-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2025-08-20 22:23:15 +08:00
..
accounting tools/getdelays: add backward compatibility for taskstats version 2025-08-02 12:01:41 -07:00
arch x86/rdrand: Disable RDSEED on AMD Cyan Skillfish 2025-07-08 21:33:26 +02:00
bootconfig bootconfig: Fix unaligned access when building footer 2025-07-24 22:16:48 +09:00
bpf bpftool: Add support for dumping streams 2025-07-03 19:30:07 -07:00
build tools: Remove libcrypto dependency 2025-06-26 10:51:41 -07:00
certs
cgroup memcg_slabinfo: Fix use of PG_slab 2025-07-23 11:55:22 +02:00
counter
crypto
debugging
firewire
firmware
gpio
hv tools/hv: fcopy: Fix irregularities with size of ring buffer 2025-07-15 06:25:33 +00:00
iio
include ARM: 2025-07-30 17:14:01 -07:00
kvm/kvm_stat
laptop
leds
lib libbpf: Add the ability to suppress perf event enablement 2025-08-07 09:01:41 -07:00
memory-model
mm tools/mm: add script to display page state for a given PID and VADDR 2025-07-09 22:41:53 -07:00
net tools: ynl-gen: print setters for multi-val attrs 2025-07-24 17:28:49 -07:00
objtool objtool/LoongArch: Get table size correctly if LTO is enabled 2025-08-20 22:23:15 +08:00
pcmcia
perf perf bpf-filter: Enable events manually 2025-08-07 09:03:44 -07:00
power tools/power turbostat: version 2025.09.09 2025-08-10 09:02:36 +03:00
rcu
sched tools/sched: Add dl_bw_dump.py for printing bandwidth accounting info 2025-07-14 10:59:33 +02:00
sched_ext sched_ext: Add support for cgroup bandwidth control interface 2025-06-20 17:03:51 -10:00
scripts tools/build: Fix s390(x) cross-compilation with clang 2025-07-08 09:19:23 +02:00
sound
spi
testing Including fixes from Netfilter and IPsec. 2025-08-14 07:14:30 -07:00
thermal
time
tracing rtla/tests: Test timerlat -P option using actions 2025-07-28 10:22:39 -04:00
usb
verification rv: Add opid per-cpu monitor 2025-07-28 16:47:35 -04:00
virtio
wmi
workqueue
writeback
Makefile