mirror of
https://github.com/dynup/kpatch
synced 2024-12-19 03:44:31 +00:00
symtab_read tries to skip '.dynsym' symbol table and only read '.symtab' symbol table. Newer readelf from binutils 2.37 now adds section names (see the diff): --- vmlinux.symtab 2022-02-18 02:10:06.691220932 +0100 +++ vmlinux.symtab.new 2022-02-18 01:16:06.161210458 +0100 Symbol table '.dynsym' contains 1541 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000100000 0 SECTION LOCAL DEFAULT 1 .text 2: 00000000017a3ac0 4 OBJECT GLOBAL DEFAULT 19 sclp_console_pages Symbol table '.symtab' contains 159980 entries: Num: Value Size Type Bind Vis Ndx Name - 41: 0000000001a93600 0 SECTION LOCAL DEFAULT 41 - 42: 0000000001a9c678 0 SECTION LOCAL DEFAULT 42 ... + 41: 0000000001a93600 0 SECTION LOCAL DEFAULT 41 .dynsym + 42: 0000000001a9c678 0 SECTION LOCAL DEFAULT 42 .rela.dyn ... 54: 0000000000000000 0 FILE LOCAL DEFAULT ABS main.c Simple matching of ".dynsym" in the line buffer is not enough anymore, because it hits not just Symbol table '.dynsym' contains 1541 entries: line, but also 41: 0000000001a93600 0 SECTION LOCAL DEFAULT 41 .dynsym skipping the rest of the file and leading to an error: create-diff-object: ERROR: *.o: find_local_syms: 189: couldn't find matching *.c local symbols in vmlinux symbol table Limit matching only to lines containing "Symbol table" header. This works with readelf from the binutils, as well as readelf from elfutils (its output looks slightly different). Symbol table [41] '.dynsym' contains 1541 entries: Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> |
||
---|---|---|
.. | ||
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 |