diff options
-rw-r--r-- | scripts/Makefile.build | 10 | ||||
-rwxr-xr-x | scripts/recordmcount.pl | 11 |
2 files changed, 18 insertions, 3 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 5ed4cbf1e0e1..468fbc9016c7 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -198,10 +198,16 @@ cmd_modversions = \ | |||
198 | fi; | 198 | fi; |
199 | endif | 199 | endif |
200 | 200 | ||
201 | ifdef CONFIG_64BIT | ||
202 | arch_bits = 64 | ||
203 | else | ||
204 | arch_bits = 32 | ||
205 | endif | ||
206 | |||
201 | ifdef CONFIG_FTRACE_MCOUNT_RECORD | 207 | ifdef CONFIG_FTRACE_MCOUNT_RECORD |
202 | cmd_record_mcount = perl $(srctree)/scripts/recordmcount.pl \ | 208 | cmd_record_mcount = perl $(srctree)/scripts/recordmcount.pl \ |
203 | "$(ARCH)" "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" \ | 209 | "$(ARCH)" "$(arch_bits)" "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" \ |
204 | "$(MV)" "$(@)"; | 210 | "$(NM)" "$(RM)" "$(MV)" "$(@)"; |
205 | endif | 211 | endif |
206 | 212 | ||
207 | define rule_cc_o_c | 213 | define rule_cc_o_c |
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index f56d760bd589..c1c618cd96f6 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -106,7 +106,8 @@ if ($#ARGV < 6) { | |||
106 | exit(1); | 106 | exit(1); |
107 | } | 107 | } |
108 | 108 | ||
109 | my ($arch, $objdump, $objcopy, $cc, $ld, $nm, $rm, $mv, $inputfile) = @ARGV; | 109 | my ($arch, $bits, $objdump, $objcopy, $cc, |
110 | $ld, $nm, $rm, $mv, $inputfile) = @ARGV; | ||
110 | 111 | ||
111 | $objdump = "objdump" if ((length $objdump) == 0); | 112 | $objdump = "objdump" if ((length $objdump) == 0); |
112 | $objcopy = "objcopy" if ((length $objcopy) == 0); | 113 | $objcopy = "objcopy" if ((length $objcopy) == 0); |
@@ -129,6 +130,14 @@ my $function_regex; # Find the name of a function | |||
129 | # (return offset and func name) | 130 | # (return offset and func name) |
130 | my $mcount_regex; # Find the call site to mcount (return offset) | 131 | my $mcount_regex; # Find the call site to mcount (return offset) |
131 | 132 | ||
133 | if ($arch eq "x86") { | ||
134 | if ($bits == 64) { | ||
135 | $arch = "x86_64"; | ||
136 | } else { | ||
137 | $arch = "i386"; | ||
138 | } | ||
139 | } | ||
140 | |||
132 | if ($arch eq "x86_64") { | 141 | if ($arch eq "x86_64") { |
133 | $section_regex = "Disassembly of section"; | 142 | $section_regex = "Disassembly of section"; |
134 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | 143 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; |