GElf_Sym sym;
Elf_Scn *sec, *sec_strndx;
Elf *elf;
- int nr = 0;
+ int nr = 0, kernel = !strcmp("[kernel]", self->name);
elf = elf_begin(fd, ELF_C_READ_MMAP, NULL);
if (elf == NULL) {
nr_syms = shdr.sh_size / shdr.sh_entsize;
memset(&sym, 0, sizeof(sym));
- self->adjust_symbols = (ehdr.e_type == ET_EXEC ||
+ if (!kernel) {
+ self->adjust_symbols = (ehdr.e_type == ET_EXEC ||
elf_section_by_name(elf, &ehdr, &shdr,
".gnu.prelink_undo",
NULL) != NULL);
+ } else self->adjust_symbols = 0;
+
elf_symtab__for_each_symbol(syms, nr_syms, index, sym) {
struct symbol *f;
const char *name;