]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - tools/perf/util/symbol-elf.c
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / tools / perf / util / symbol-elf.c
index bc229a74c6a9aa70f2605fe04b7076c9c346f6cb..87a297dd89016e13a829d4a7397c74e0892eae30 100644 (file)
@@ -709,17 +709,10 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
        if (ss->opdshdr.sh_type != SHT_PROGBITS)
                ss->opdsec = NULL;
 
-       if (dso->kernel == DSO_TYPE_USER) {
-               GElf_Shdr shdr;
-               ss->adjust_symbols = (ehdr.e_type == ET_EXEC ||
-                               ehdr.e_type == ET_REL ||
-                               dso__is_vdso(dso) ||
-                               elf_section_by_name(elf, &ehdr, &shdr,
-                                                    ".gnu.prelink_undo",
-                                                    NULL) != NULL);
-       } else {
+       if (dso->kernel == DSO_TYPE_USER)
+               ss->adjust_symbols = true;
+       else
                ss->adjust_symbols = elf__needs_adjust_symbols(ehdr);
-       }
 
        ss->name   = strdup(name);
        if (!ss->name) {
@@ -777,7 +770,8 @@ static bool want_demangle(bool is_kernel_sym)
        return is_kernel_sym ? symbol_conf.demangle_kernel : symbol_conf.demangle;
 }
 
-void __weak arch__elf_sym_adjust(GElf_Sym *sym __maybe_unused) { }
+void __weak arch__sym_update(struct symbol *s __maybe_unused,
+               GElf_Sym *sym __maybe_unused) { }
 
 int dso__load_sym(struct dso *dso, struct map *map,
                  struct symsrc *syms_ss, struct symsrc *runtime_ss,
@@ -954,8 +948,6 @@ int dso__load_sym(struct dso *dso, struct map *map,
                    (sym.st_value & 1))
                        --sym.st_value;
 
-               arch__elf_sym_adjust(&sym);
-
                if (dso->kernel || kmodule) {
                        char dso_name[PATH_MAX];
 
@@ -1089,6 +1081,8 @@ new_symbol:
                if (!f)
                        goto out_elf_end;
 
+               arch__sym_update(f, &sym);
+
                if (filter && filter(curr_map, f))
                        symbol__delete(f);
                else {