diff options
-rwxr-xr-x | scripts/recordmcount.pl | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index e4922a6c963b..36c8355c555e 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -108,20 +108,6 @@ if ($#ARGV < 6) { | |||
108 | 108 | ||
109 | my ($arch, $objdump, $objcopy, $cc, $ld, $nm, $rm, $mv, $inputfile) = @ARGV; | 109 | my ($arch, $objdump, $objcopy, $cc, $ld, $nm, $rm, $mv, $inputfile) = @ARGV; |
110 | 110 | ||
111 | if ($arch eq "i386") { | ||
112 | $ld = "ld -m elf_i386"; | ||
113 | $objdump = "objdump -M i386"; | ||
114 | $objcopy = "objcopy -O elf32-i386"; | ||
115 | $cc = "gcc -m32"; | ||
116 | } | ||
117 | |||
118 | if ($arch eq "x86_64") { | ||
119 | $ld = "ld -m elf_x86_64"; | ||
120 | $objdump = "objdump -M x86-64"; | ||
121 | $objcopy = "objcopy -O elf64-x86-64"; | ||
122 | $cc = "gcc -m64"; | ||
123 | } | ||
124 | |||
125 | $objdump = "objdump" if ((length $objdump) == 0); | 111 | $objdump = "objdump" if ((length $objdump) == 0); |
126 | $objcopy = "objcopy" if ((length $objcopy) == 0); | 112 | $objcopy = "objcopy" if ((length $objcopy) == 0); |
127 | $cc = "gcc" if ((length $cc) == 0); | 113 | $cc = "gcc" if ((length $cc) == 0); |
@@ -146,11 +132,25 @@ if ($arch eq "x86_64") { | |||
146 | $function_regex = "<(.*?)>:"; | 132 | $function_regex = "<(.*?)>:"; |
147 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; | 133 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; |
148 | $type = ".quad"; | 134 | $type = ".quad"; |
135 | |||
136 | # force flags for this arch | ||
137 | $ld .= " -m elf_x86_64"; | ||
138 | $objdump .= " -M x86-64"; | ||
139 | $objcopy .= " -O elf64-x86-64"; | ||
140 | $cc .= " -m64"; | ||
141 | |||
149 | } elsif ($arch eq "i386") { | 142 | } elsif ($arch eq "i386") { |
150 | $section_regex = "Disassembly of section"; | 143 | $section_regex = "Disassembly of section"; |
151 | $function_regex = "<(.*?)>:"; | 144 | $function_regex = "<(.*?)>:"; |
152 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; | 145 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; |
153 | $type = ".long"; | 146 | $type = ".long"; |
147 | |||
148 | # force flags for this arch | ||
149 | $ld .= " -m elf_i386"; | ||
150 | $objdump .= " -M i386"; | ||
151 | $objcopy .= " -O elf32-i386"; | ||
152 | $cc .= " -m32"; | ||
153 | |||
154 | } else { | 154 | } else { |
155 | die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD"; | 155 | die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD"; |
156 | } | 156 | } |