lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 12 Sep 2013 15:13:24 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	hpa@...or.com, paulus@...ba.org, eranian@...gle.com,
	linux-kernel@...r.kernel.org, acme@...hat.com, efault@....de,
	peterz@...radead.org, namhyung@...il.com, jolsa@...hat.com,
	fweisbec@...il.com, dsahern@...il.com, adrian.hunter@...el.com,
	tglx@...utronix.de
Cc:	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/core] perf symbols: Add support for reading from
 /proc/ kcore


* tip-bot for Adrian Hunter <tipbot@...or.com> wrote:

> Commit-ID:  8e0cf965f95edd41df11cca50b92b4cb6ea8d80a
> Gitweb:     http://git.kernel.org/tip/8e0cf965f95edd41df11cca50b92b4cb6ea8d80a
> Author:     Adrian Hunter <adrian.hunter@...el.com>
> AuthorDate: Wed, 7 Aug 2013 14:38:51 +0300
> Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
> CommitDate: Wed, 7 Aug 2013 17:35:33 -0300
> 
> perf symbols: Add support for reading from /proc/kcore
> 
> In the absence of vmlinux, perf tools uses kallsyms for symbols.  If the
> user has access, now also map to /proc/kcore.

> +static int elf_read_maps(Elf *elf, bool exe, mapfn_t mapfn, void *data)
> +{
> +	GElf_Phdr phdr;
> +	size_t i, phdrnum;
> +	int err;
> +	u64 sz;
> +
> +	if (elf_getphdrnum(elf, &phdrnum))
> +		return -1;

This doesn't build on old distros with old libelf.

The wrapper below builds fine, but I've not tested it otherwise. Also, the 
feature detection bits in config/* filling in HAVE_ELF_GETPHDRNUM are 
missing.

Thanks,

	Ingo

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index a7b9ab5..5fb9d61 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -8,6 +8,13 @@
 #include "symbol.h"
 #include "debug.h"
 
+#ifndef HAVE_ELF_GETPHDRNUM
+static int elf_getphdrnum (Elf *__elf __maybe_unused, size_t *__dst __maybe_unused)
+{
+	return 1;
+}
+#endif
+
 #ifndef NT_GNU_BUILD_ID
 #define NT_GNU_BUILD_ID 3
 #endif

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists