aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/ftrace.h7
-rw-r--r--scripts/recordmcount.c2
-rwxr-xr-xscripts/recordmcount.pl2
3 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index db24c2278be0..268c783ab1c0 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -38,11 +38,10 @@ extern void mcount(void);
38static inline unsigned long ftrace_call_adjust(unsigned long addr) 38static inline unsigned long ftrace_call_adjust(unsigned long addr)
39{ 39{
40 /* 40 /*
41 * call mcount is "e8 <4 byte offset>" 41 * addr is the address of the mcount call instruction.
42 * The addr points to the 4 byte offset and the caller of this 42 * recordmcount does the necessary offset calculation.
43 * function wants the pointer to e8. Simply subtract one.
44 */ 43 */
45 return addr - 1; 44 return addr;
46} 45}
47 46
48#ifdef CONFIG_DYNAMIC_FTRACE 47#ifdef CONFIG_DYNAMIC_FTRACE
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c
index 0e18975824f7..7648a5d11154 100644
--- a/scripts/recordmcount.c
+++ b/scripts/recordmcount.c
@@ -335,6 +335,7 @@ do_file(char const *const fname)
335 reltype = R_386_32; 335 reltype = R_386_32;
336 make_nop = make_nop_x86; 336 make_nop = make_nop_x86;
337 ideal_nop = ideal_nop5_x86_32; 337 ideal_nop = ideal_nop5_x86_32;
338 mcount_adjust_32 = -1;
338 break; 339 break;
339 case EM_ARM: reltype = R_ARM_ABS32; 340 case EM_ARM: reltype = R_ARM_ABS32;
340 altmcount = "__gnu_mcount_nc"; 341 altmcount = "__gnu_mcount_nc";
@@ -350,6 +351,7 @@ do_file(char const *const fname)
350 make_nop = make_nop_x86; 351 make_nop = make_nop_x86;
351 ideal_nop = ideal_nop5_x86_64; 352 ideal_nop = ideal_nop5_x86_64;
352 reltype = R_X86_64_64; 353 reltype = R_X86_64_64;
354 mcount_adjust_64 = -1;
353 break; 355 break;
354 } /* end switch */ 356 } /* end switch */
355 357
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index a871cd414055..414e7f5e42ec 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -223,6 +223,7 @@ if ($arch eq "x86_64") {
223 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; 223 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$";
224 $type = ".quad"; 224 $type = ".quad";
225 $alignment = 8; 225 $alignment = 8;
226 $mcount_adjust = -1;
226 227
227 # force flags for this arch 228 # force flags for this arch
228 $ld .= " -m elf_x86_64"; 229 $ld .= " -m elf_x86_64";
@@ -232,6 +233,7 @@ if ($arch eq "x86_64") {
232 233
233} elsif ($arch eq "i386") { 234} elsif ($arch eq "i386") {
234 $alignment = 4; 235 $alignment = 4;
236 $mcount_adjust = -1;
235 237
236 # force flags for this arch 238 # force flags for this arch
237 $ld .= " -m elf_i386"; 239 $ld .= " -m elf_i386";