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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 18 Oct 2018 16:36:46 +0800
From:   Nickhu <nickhu@...estech.com>
To:     <greentime@...estech.com>, <linux-kernel@...r.kernel.org>,
        <peterz@...radead.org>, <mingo@...hat.com>, <acme@...nel.org>,
        <alexander.shishkin@...ux.intel.com>, <jolsa@...hat.com>,
        <namhyung@...nel.org>, <deanbo422@...il.com>,
        <adrian.hunter@...el.com>, <tglx@...utronix.de>,
        <gregkh@...uxfoundation.org>
CC:     Nickhu <nickhu@...estech.com>, <green.hu@...il.com>
Subject: [PATCH 1/1] Perf: Compile failed when compile with libelf.

The error message:
=====================================================================
util/symbol-elf.c:46:12: error: static declaration of 'elf_getphdrnum'
follows non-static declaration
static int elf_getphdrnum(Elf *elf, size_t *dst)
            ^~~~~~~~~~~~~~
In file included from util/symbol.h:20,
                 from util/symbol-elf.c:9:
/local/nickhu/build-system-3/toolchain/nds32le-linux-glibc-v3-upstream/
nds32le-linux/sysroot/usr/include/libelf.h:266:12: note: previous declaration
of 'elf_getphdrnum' was here
extern int elf_getphdrnum (Elf *__elf, size_t *__dst);
            ^~~~~~~~~~~~~~
util/symbol-elf.c:62:12: error: static declaration of 'elf_getshdrstrndx'
follows non-static declaration
static int elf_getshdrstrndx(Elf *elf __maybe_unused, size_t *dst __maybe
_unused)
            ^~~~~~~~~~~~~~~~~
In file included from util/symbol.h:20,
                 from util/symbol-elf.c:9:
/local/nickhu/build-system-3/toolchain/nds32le-linux-glibc-v3-upstream/
nds32le-linux/sysroot/usr/include/libelf.h:316:12: note: previous declaration
of 'elf_getshdrstrndx' was here
extern int elf_getshdrstrndx (Elf *__elf, size_t *__dst);
=====================================================================

Fix it.

Signed-off-by: Nickhu <nickhu@...estech.com>
---
 tools/perf/util/symbol-elf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 29770ea61768..3ccdfe603d67 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -43,7 +43,7 @@ static inline char *bfd_demangle(void __maybe_unused *v,
 #endif
 
 #ifndef HAVE_ELF_GETPHDRNUM_SUPPORT
-static int elf_getphdrnum(Elf *elf, size_t *dst)
+int elf_getphdrnum(Elf *elf, size_t *dst)
 {
 	GElf_Ehdr gehdr;
 	GElf_Ehdr *ehdr;
@@ -59,7 +59,7 @@ static int elf_getphdrnum(Elf *elf, size_t *dst)
 #endif
 
 #ifndef HAVE_ELF_GETSHDRSTRNDX_SUPPORT
-static int elf_getshdrstrndx(Elf *elf __maybe_unused, size_t *dst __maybe_unused)
+int elf_getshdrstrndx(Elf *elf __maybe_unused, size_t *dst __maybe_unused)
 {
 	pr_err("%s: update your libelf to > 0.140, this one lacks elf_getshdrstrndx().\n", __func__);
 	return -1;
-- 
2.17.0

Powered by blists - more mailing lists