linux-yocto/tools
Tiezhu Yang 4050d08f84 objtool/LoongArch: Get table size correctly if LTO is enabled
[ Upstream commit a47bc954cf0eb51f2828e1607d169d487df7f11f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-28 16:34:48 +02:00
..
accounting
arch x86/rdrand: Disable RDSEED on AMD Cyan Skillfish 2025-07-08 21:33:26 +02:00
bootconfig
bpf bpftool: Fix JSON writer resource leak in version command 2025-08-20 18:41:18 +02:00
build
certs
cgroup memcg_slabinfo: Fix use of PG_slab 2025-08-15 16:38:50 +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 tools/nolibc: fix spelling of FD_SETBITMASK in FD_* macros 2025-08-20 18:41:42 +02:00
kvm/kvm_stat
laptop
leds
lib libbpf: Fix warning in calloc() usage 2025-08-20 18:41:07 +02:00
memory-model
mm
net tools: ynl: fix mixing ops and notifications on one socket 2025-06-19 08:37:39 -07:00
objtool objtool/LoongArch: Get table size correctly if LTO is enabled 2025-08-28 16:34:48 +02:00
pcmcia
perf perf record: Cache build-ID of hit DSOs only 2025-08-15 16:39:14 +02:00
power tools/power turbostat: Handle cap_get_proc() ENOSYS 2025-08-20 18:41:31 +02:00
rcu
sched_ext
scripts tools/build: Fix s390(x) cross-compilation with clang 2025-08-20 18:40:59 +02:00
sound
spi
testing selftests: mptcp: sockopt: fix C23 extension warning 2025-08-28 16:34:32 +02:00
thermal
time
tracing tracing tools updates for v6.16: 2025-05-29 20:59:52 -07:00
usb
verification verification/dot2k: Make a separate dot2k_templates/Kconfig_container 2025-08-20 18:41:05 +02:00
virtio
wmi
workqueue
writeback
Makefile