aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/symbol.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 98aee922acca..28106059bf12 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -525,7 +525,7 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
525 GElf_Sym sym; 525 GElf_Sym sym;
526 Elf_Scn *sec, *sec_strndx; 526 Elf_Scn *sec, *sec_strndx;
527 Elf *elf; 527 Elf *elf;
528 int nr = 0; 528 int nr = 0, kernel = !strcmp("[kernel]", self->name);
529 529
530 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); 530 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL);
531 if (elf == NULL) { 531 if (elf == NULL) {
@@ -571,10 +571,13 @@ static int dso__load_sym(struct dso *self, int fd, const char *name,
571 nr_syms = shdr.sh_size / shdr.sh_entsize; 571 nr_syms = shdr.sh_size / shdr.sh_entsize;
572 572
573 memset(&sym, 0, sizeof(sym)); 573 memset(&sym, 0, sizeof(sym));
574 self->adjust_symbols = (ehdr.e_type == ET_EXEC || 574 if (!kernel) {
575 self->adjust_symbols = (ehdr.e_type == ET_EXEC ||
575 elf_section_by_name(elf, &ehdr, &shdr, 576 elf_section_by_name(elf, &ehdr, &shdr,
576 ".gnu.prelink_undo", 577 ".gnu.prelink_undo",
577 NULL) != NULL); 578 NULL) != NULL);
579 } else self->adjust_symbols = 0;
580
578 elf_symtab__for_each_symbol(syms, nr_syms, index, sym) { 581 elf_symtab__for_each_symbol(syms, nr_syms, index, sym) {
579 struct symbol *f; 582 struct symbol *f;
580 const char *name; 583 const char *name;