mirror of
https://github.com/dynup/kpatch
synced 2025-04-11 03:31:20 +00:00
When building a livepatch, we assume symbols from "readelf -s" is the same as the order observed in kallsyms. We calculate sympos of a symbol based on this order (readelf -s). However, with gcc-14, "readelf -s" may present the symbols in a different order. For example: With gcc 13: 32951: ffff8000802edf20 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 33497: ffff8000802fb798 236 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 47034: ffff80008044b250 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 51466: ffff8000804be260 236 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 51483: ffff8000804bf6a8 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 52287: ffff8000804cb098 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 54066: ffff800080518e38 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 58217: ffff800080575bb0 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 72912: ffff8000806c5dc0 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 73719: ffff8000806eccd0 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 With gcc 14: 9557: ffff800080312f28 236 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 16599: ffff8000806eb060 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 17305: ffff800080711d30 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 63960: ffff800080305540 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 74577: ffff800080466030 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 78568: ffff8000804dc3e0 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 79372: ffff8000804e81c0 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 81016: ffff800080537380 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 84685: ffff800080595428 172 FUNC LOCAL DEFAULT 2 zero_user_segments.constprop.0 Fix this by calculating sympos in another for_each_obj_symbol loop. Signed-off-by: Song Liu <song@kernel.org> |
||
---|---|---|
.. | ||
gcc-plugins | ||
insn | ||
create-diff-object.c | ||
create-klp-module.c | ||
create-kpatch-module.c | ||
kpatch-build | ||
kpatch-cc | ||
kpatch-elf.c | ||
kpatch-elf.h | ||
kpatch-intermediate.h | ||
kpatch.h | ||
list.h | ||
log.h | ||
lookup.c | ||
lookup.h | ||
Makefile |