diff options
-rw-r--r-- | tools/perf/util/symbol.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 613874260761..051d71b33df0 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -1011,7 +1011,7 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name, | |||
1011 | if (curr_dso == NULL) | 1011 | if (curr_dso == NULL) |
1012 | goto out_elf_end; | 1012 | goto out_elf_end; |
1013 | curr_map = map__new2(start, curr_dso, | 1013 | curr_map = map__new2(start, curr_dso, |
1014 | MAP__FUNCTION); | 1014 | map->type); |
1015 | if (curr_map == NULL) { | 1015 | if (curr_map == NULL) { |
1016 | dso__delete(curr_dso); | 1016 | dso__delete(curr_dso); |
1017 | goto out_elf_end; | 1017 | goto out_elf_end; |
@@ -1021,6 +1021,7 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name, | |||
1021 | curr_dso->origin = DSO__ORIG_KERNEL; | 1021 | curr_dso->origin = DSO__ORIG_KERNEL; |
1022 | map_groups__insert(kmap->kmaps, curr_map); | 1022 | map_groups__insert(kmap->kmaps, curr_map); |
1023 | dsos__add(&dsos__kernel, curr_dso); | 1023 | dsos__add(&dsos__kernel, curr_dso); |
1024 | dso__set_loaded(curr_dso, map->type); | ||
1024 | } else | 1025 | } else |
1025 | curr_dso = curr_map->dso; | 1026 | curr_dso = curr_map->dso; |
1026 | 1027 | ||
@@ -1058,8 +1059,16 @@ new_symbol: | |||
1058 | /* | 1059 | /* |
1059 | * For misannotated, zeroed, ASM function sizes. | 1060 | * For misannotated, zeroed, ASM function sizes. |
1060 | */ | 1061 | */ |
1061 | if (nr > 0) | 1062 | if (nr > 0) { |
1062 | symbols__fixup_end(&self->symbols[map->type]); | 1063 | symbols__fixup_end(&self->symbols[map->type]); |
1064 | if (kmap) { | ||
1065 | /* | ||
1066 | * We need to fixup this here too because we create new | ||
1067 | * maps here, for things like vsyscall sections. | ||
1068 | */ | ||
1069 | __map_groups__fixup_end(kmap->kmaps, map->type); | ||
1070 | } | ||
1071 | } | ||
1063 | err = nr; | 1072 | err = nr; |
1064 | out_elf_end: | 1073 | out_elf_end: |
1065 | elf_end(elf); | 1074 | elf_end(elf); |