Skip to content

Commit

Permalink
ftrace/recordmcount: Work around for addition of metag magic but not …
Browse files Browse the repository at this point in the history
…relocations

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: https://bugzilla.redhat.com/show_bug.cgi?id=1354034

Link: http://lkml.kernel.org/r/[email protected]

Cc: [email protected] # v3.9+
Cc: James Hogan <[email protected]>
Fixes: 00512bd ("metag: ftrace support")
Reported-by: Ross Burton <[email protected]>
Signed-off-by: Laura Abbott <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
  • Loading branch information
labbott authored and rostedt committed Aug 2, 2016
1 parent 124a3d8 commit b2e1c26
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/recordmcount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
#endif
#ifndef R_METAG_ADDR32
#define R_METAG_ADDR32 2
#endif
#ifndef R_METAG_NONE
#define R_METAG_NONE 3
#endif

Expand Down

0 comments on commit b2e1c26

Please sign in to comment.