[lkml]   [2016]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3.16 140/346] ftrace/recordmcount: Work around for addition of metag magic but not relocations
3.16.39-rc1 review patch.  If anyone has any objections, please let me know.


From: Laura Abbott <>

commit b2e1c26f0b62531636509fbcb6dab65617ed8331 upstream.

glibc recently did a sync up (94e73c95d9b5 "elf.h: Sync with the gabi
webpage") that added a #define for EM_METAG but did not add relocations

This triggers build errors:

scripts/recordmcount.c: In function 'do_file':
scripts/recordmcount.c:466:28: error: 'R_METAG_ADDR32' undeclared (first use in this function)
case EM_METAG: reltype = R_METAG_ADDR32;
scripts/recordmcount.c:466:28: note: each undeclared identifier is reported only once for each function it appears in
scripts/recordmcount.c:468:20: error: 'R_METAG_NONE' undeclared (first use in this function)
rel_type_nop = R_METAG_NONE;

Work around this change with some more #ifdefery for the relocations.

Fedora Bugzilla:


Cc: James Hogan <>
Fixes: 00512bdd4573 ("metag: ftrace support")
Reported-by: Ross Burton <>
Signed-off-by: Laura Abbott <>
Signed-off-by: Steven Rostedt <>
Signed-off-by: Ben Hutchings <>
scripts/recordmcount.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -33,10 +33,17 @@
#include <string.h>
#include <unistd.h>

+ * glibc synced up and added the metag number but didn't add the relocations.
+ * Work around this in a crude manner for now.
+ */
#ifndef EM_METAG
-/* Remove this when these make it to the standard system elf.h. */
#define EM_METAG 174
+#ifndef R_METAG_ADDR32
#define R_METAG_ADDR32 2
+#ifndef R_METAG_NONE
#define R_METAG_NONE 3

 \ /
  Last update: 2016-11-14 03:26    [W:1.212 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site