Linux-csky Archive on
 help / color / Atom feed
* [PATCH 1/1] riscv: Fix perf record without libelf support
@ 2019-07-11  2:38 Mao Han
  2019-07-25 21:11 ` Paul Walmsley
  0 siblings, 1 reply; 2+ messages in thread
From: Mao Han @ 2019-07-11  2:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-riscv, linux-csky, Mao Han, Paul Walmsley, Palmer Dabbelt,
	Albert Ou

This patch fix following perf record error by linking with
build id.
[ perf record: Woken up 1 times to write data ]
free(): double free detected in tcache 2

perf record use filename__read_build_id(util/symbol-minimal.c) to get
build id when libelf is not supported. When 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 <>
Cc: Paul Walmsley <>
Cc: Palmer Dabbelt <>
Cc: Albert Ou <>
 arch/riscv/kernel/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
index f1d6ffe..49a5852 100644
--- a/arch/riscv/kernel/vdso/Makefile
+++ b/arch/riscv/kernel/vdso/Makefile
@@ -37,7 +37,7 @@ $(obj)/ $(src)/ $(obj-vdso) FORCE
 # these symbols in the kernel code rather than hand-coded addresses. = -shared -s -Wl, \
-	-Wl,--hash-style=both
+	-Wl,--build-id -Wl,--hash-style=both
 $(obj)/vdso-dummy.o: $(src)/ $(obj)/rt_sigreturn.o FORCE
 	$(call if_changed,vdsold)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11  2:38 [PATCH 1/1] riscv: Fix perf record without libelf support Mao Han
2019-07-25 21:11 ` Paul Walmsley

Linux-csky Archive on

Archives are clonable:
	git clone --mirror linux-csky/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-csky linux-csky/ \
	public-inbox-index linux-csky

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone