Linux-RISC-V Archive on
 help / color / Atom feed
From: Mao Han <>
Cc: Albert Ou <>,
	Palmer Dabbelt <>,,
	Paul Walmsley <>,, Mao Han <>
Subject: [PATCH 1/1] riscv: Fix perf record without libelf support
Date: Thu, 11 Jul 2019 10:38:40 +0800
Message-ID: <> (raw)

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)

linux-riscv mailing list

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-RISC-V Archive on

Archives are clonable:
	git clone --mirror linux-riscv/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-riscv linux-riscv/ \
	public-inbox-index linux-riscv

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox