]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: Fix perf record without libelf support
authorMao Han <han_mao@c-sky.com>
Thu, 11 Jul 2019 02:38:40 +0000 (10:38 +0800)
committerPaul Walmsley <paul.walmsley@sifive.com>
Wed, 31 Jul 2019 19:26:10 +0000 (12:26 -0700)
commitc3954a66abfa196ff85283aaf091a18903f6ee94
treecb747e3d9ad777a4fa9a027368da790b7ac498b8
parentbfe2de5a355e71917b08e947fe3e805ec2f51c71
riscv: Fix perf record without libelf support

This patch fix following perf record error by linking vdso.so with
build id.

perf.data      perf.data.old
[ perf record: Woken up 1 times to write data ]
free(): double free detected in tcache 2
Aborted

perf record use filename__read_build_id(util/symbol-minimal.c) to get
build id when libelf is not supported. When vdso.so is linked without
build id, the section size of PT_NOTE will be zero, buf size will
realloc to zero and cause memory corruption.

Signed-off-by: Mao Han <han_mao@c-sky.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
arch/riscv/kernel/vdso/Makefile