linux-yocto/tools/objtool
Josh Poimboeuf 157d7d16f8 objtool: Fix weak symbol detection
[ Upstream commit 72567c630d32bc31f671977f78228c80937ed80e ]

find_symbol_hole_containing() fails to find a symbol hole (aka stripped
weak symbol) if its section has no symbols before the hole.  This breaks
weak symbol detection if -ffunction-sections is enabled.

Fix that by allowing the interval tree to contain section symbols, which
are always at offset zero for a given section.

Fixes a bunch of (-ffunction-sections) warnings like:

  vmlinux.o: warning: objtool: .text.__x64_sys_io_setup+0x10: unreachable instruction

Fixes: 4adb236867 ("objtool: Ignore extra-symbol code")
Acked-by: Petr Mladek <pmladek@suse.com>
Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-12-18 14:02:28 +01:00
..
arch - Add functionality to provide runtime firmware updates for the non-x86 parts 2025-09-30 13:40:35 -07:00
Documentation objtool: Fix up some outdated references to ENTRY/ENDPROC 2025-03-25 09:20:27 +01:00
include/objtool - Remove a bunch of asm implementing condition flags testing in KVM's 2025-10-11 11:19:16 -07:00
.gitignore
Build
builtin-check.c objtool: Add action to check for absence of absolute relocations 2025-09-03 17:59:51 +02:00
check.c objtool: Fix standalone --hacks=jump_label 2025-12-18 14:02:28 +01:00
elf.c objtool: Fix weak symbol detection 2025-12-18 14:02:28 +01:00
Makefile objtool: Hide unnecessary compiler error message 2025-03-12 15:43:38 -07:00
noreturns.h x86/sev: Zap snp_abort() 2025-09-04 13:15:59 +02:00
objtool.c objtool: Change "warning:" to "error: " for fatal errors 2025-04-01 09:07:13 +02:00
orc_dump.c objtool: Change "warning:" to "error: " for fatal errors 2025-04-01 09:07:13 +02:00
orc_gen.c objtool/x86: Separate arch-specific and generic parts 2024-03-11 22:23:47 +08:00
special.c objtool: Change "warning:" to "error: " for fatal errors 2025-04-01 09:07:13 +02:00
sync-check.sh objtool: Add objtool_types.h 2023-03-23 23:18:56 +01:00
weak.c