[lkml]   [2013]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[tip:perf/core] perf symbols: Include elf.h header regardless LIBELF_SUPPORT
Commit-ID:  eec185ab603fab3b7b5021e840cf4b282c4c7e6b
Author: Namhyung Kim <>
AuthorDate: Fri, 28 Dec 2012 16:16:49 +0900
Committer: Arnaldo Carvalho de Melo <>
CommitDate: Thu, 24 Jan 2013 16:40:18 -0300

perf symbols: Include elf.h header regardless LIBELF_SUPPORT

The elf.h header file is used for NO_LIBELF build too so it should be
included anyway. Also remove duplicated include of the header file in
symbol-*.c. This patch fixes following build error on NO_LIBELF build:

CC tests/hists_link.o
tests/hists_link.c: In function ‘setup_fake_machine’:
tests/hists_link.c:132:8: error: ‘STB_GLOBAL’ undeclared (first use in this function)
tests/hists_link.c:132:8: note: each undeclared identifier is reported only once for each function it appears in

Signed-off-by: Namhyung Kim <>
Cc: David Ahern <>
Cc: Ingo Molnar <>
Cc: Jiri Olsa <>
Cc: Paul Mackerras <>
Cc: Peter Zijlstra <>
Signed-off-by: Arnaldo Carvalho de Melo <>
tools/perf/util/symbol-elf.c | 3 ---
tools/perf/util/symbol-minimal.c | 1 -
tools/perf/util/symbol.h | 2 +-
3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index f63557b..54efcb5 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -1,6 +1,3 @@
-#include <libelf.h>
-#include <gelf.h>
-#include <elf.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
index 259f8f2..a7390cd 100644
--- a/tools/perf/util/symbol-minimal.c
+++ b/tools/perf/util/symbol-minimal.c
@@ -1,6 +1,5 @@
#include "symbol.h"

-#include <elf.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index ec7b240..d97377a 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -16,8 +16,8 @@
#include <libelf.h>
#include <gelf.h>
-#include <elf.h>
+#include <elf.h>

#include "dso.h"

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2013-01-25 20:23    [W:0.042 / U:20.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site