OpenCloudOS-Kernel/tools
Tiezhu Yang 69b3f5cd6e objtool: Check local label in read_unwind_hints()
commit e91c5e4c21b0339376ee124cda5c9b27d41f2cbc upstream.

When update the latest upstream gcc and binutils, it generates some
objtool warnings on LoongArch, like this:

  arch/loongarch/kernel/entry.o: warning: objtool: ret_from_fork+0x0: unreachable instruction

We can see that the reloc sym name is local label instead of section
in relocation section '.rela.discard.unwind_hints', in this case, the
reloc sym type is STT_NOTYPE instead of STT_SECTION. Let us check it
to not return -1, then use reloc->sym->offset instead of reloc addend
which is 0 to find the corresponding instruction.

Here are some detailed info:
[fedora@linux 6.8.test]$ gcc --version
gcc (GCC) 14.0.1 20240129 (experimental)
[fedora@linux 6.8.test]$ as --version
GNU assembler (GNU Binutils) 2.42.50.20240129
[fedora@linux 6.8.test]$ readelf -r arch/loongarch/kernel/entry.o | grep -A 3 "rela.discard.unwind_hints"
Relocation section '.rela.discard.unwind_hints' at offset 0x3a8 contains 7 entries:
  Offset          Info           Type           Sym. Value    Sym. Name + Addend
000000000000  000a00000063 R_LARCH_32_PCREL  0000000000000000 .Lhere_1 + 0
00000000000c  000b00000063 R_LARCH_32_PCREL  00000000000000a8 .Lhere_50 + 0

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2024-11-12 16:59:46 +08:00
..
accounting
arch objtool/LoongArch: Enable orc to be built 2024-11-12 16:59:42 +08:00
bootconfig
bpf bpftool: Fix undefined behavior in qsort(NULL, 0, ...) 2024-10-10 11:57:40 +02:00
build perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present 2024-02-05 20:14:31 +00:00
certs
cgroup
counter
crypto/ccp crypto: ccp - Fix some unfused tests 2023-11-20 11:59:18 +01:00
debugging
edid
firewire
firmware
gpio
hv tools: hv: rm .*.cmd when make clean 2024-09-30 16:25:12 +02:00
iio tools/iio: Add memory allocation failure check for trigger_name 2024-10-17 15:24:20 +02:00
include objtool/LoongArch: Implement instruction decoder 2024-11-12 16:59:37 +08:00
kvm/kvm_stat
laptop
leds
lib libsubcmd: Don't free the usage string 2024-10-17 15:24:13 +02:00
memory-model tools/memory-model: Fix bug in lock.cat 2024-08-03 08:54:21 +02:00
mm tools/mm: fix undefined reference to pthread_once 2023-09-05 10:13:45 -07:00
net/ynl tools: ynl: don't ignore errors in NLMSG_DONE messages 2024-05-02 16:32:36 +02:00
objtool objtool: Check local label in read_unwind_hints() 2024-11-12 16:59:46 +08:00
pci
pcmcia
perf perf kvm: Add kvm-stat for loongarch64 2024-11-06 19:36:39 +08:00
power pm:cpupower: Add missing powercap_set_enabled() stub function 2024-10-04 16:28:55 +02:00
rcu
sched_ext rue/scx/sched_ext: Add scx_rusty, a rust userspace hybrid scheduler 2024-03-29 11:22:52 +08:00
scripts
spi
testing Merge linux 6.6.57 2024-10-21 14:40:59 +08:00
thermal
time
tracing rtla: Fix the help text in osnoise and timerlat top tools 2024-10-10 11:58:00 +02:00
usb
verification tools/rv: Fix Makefile compiler options for clang 2024-02-23 09:25:14 +01:00
virtio tools/virtio: Add dma sync api for virtio test 2023-10-16 05:32:23 -04:00
wmi
workqueue
Makefile rue/scx/sched_ext: Add scx_simple and scx_example_qmap example schedulers 2024-03-29 11:22:20 +08:00