aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2015-02-09 16:29:37 -0800
committerArnaldo Carvalho de Melo <[email protected]>2015-02-11 12:37:32 -0300
commit4e31050f482c02c822b150d71cf1ea5be7c9d6e4 (patch)
tree37fd96843a7e3b57697a2b9864e2ccad498834b8
parent23773ca18b399051eb94f98b689cf7a9173c795b (diff)
perf symbols: Define STT_GNU_IFUNC for glibc 2.9 and older.
The token STT_GNU_IFUNC is not available with glibc 2.9 and older. Define this token if it is not already defined. This patch fixes this build errors with older versions of glibc. CC util/symbol-elf.o util/symbol-elf.c: In function ‘elf_sym__is_function’: util/symbol-elf.c:75: error: ‘STT_GNU_IFUNC’ undeclared (first use in this function) util/symbol-elf.c:75: error: (Each undeclared identifier is reported only once util/symbol-elf.c:75: error: for each function it appears in.) make: *** [util/symbol-elf.o] Error 1 Signed-off-by: Vinson Lee <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Avi Kivity <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Waiman Long <[email protected]> Cc: [email protected] # 3.17+ Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/util/symbol-elf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 225eb73ee78b..b02731a19d1f 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -69,6 +69,10 @@ static inline uint8_t elf_sym__type(const GElf_Sym *sym)
return GELF_ST_TYPE(sym->st_info);
}
+#ifndef STT_GNU_IFUNC
+#define STT_GNU_IFUNC 10
+#endif
+
static inline int elf_sym__is_function(const GElf_Sym *sym)
{
return (elf_sym__type(sym) == STT_FUNC ||