]> Gentwo Git Trees - linux/.git/commit
perf dso: Add support for reading the e_machine type for a dso
authorIan Rogers <irogers@google.com>
Wed, 19 Mar 2025 05:07:33 +0000 (22:07 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 21 Mar 2025 05:58:02 +0000 (22:58 -0700)
commitafffec6f032926f70fc9f43f5d07cdfa09a0a184
tree1fb478d7a3cb75845ec6b57ae62aaa5d760b056a
parent5c2938fe789c1876a35a1fbc24da3800b33adf26
perf dso: Add support for reading the e_machine type for a dso

For ELF file dsos read the e_machine from the ELF header. For kernel
types assume the e_machine matches the perf tool. In other cases
return EM_NONE.

When reading from the ELF header use DSO__SWAP that may need
dso->needs_swap initializing. Factor out dso__swap_init to allow this.

Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Link: https://lore.kernel.org/r/20250319050741.269828-7-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/dso.c
tools/perf/util/dso.h
tools/perf/util/symbol-elf.c