diff options
-rwxr-xr-x | scripts/recordmcount.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 6b9fe3eb8360..eeac71c87c66 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -134,6 +134,7 @@ my $section_regex; # Find the start of a section | |||
134 | my $function_regex; # Find the name of a function | 134 | my $function_regex; # Find the name of a function |
135 | # (return offset and func name) | 135 | # (return offset and func name) |
136 | my $mcount_regex; # Find the call site to mcount (return offset) | 136 | my $mcount_regex; # Find the call site to mcount (return offset) |
137 | my $alignment; # The .align value to use for $mcount_section | ||
137 | 138 | ||
138 | if ($arch eq "x86") { | 139 | if ($arch eq "x86") { |
139 | if ($bits == 64) { | 140 | if ($bits == 64) { |
@@ -148,6 +149,7 @@ if ($arch eq "x86_64") { | |||
148 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | 149 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; |
149 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; | 150 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; |
150 | $type = ".quad"; | 151 | $type = ".quad"; |
152 | $alignment = 8; | ||
151 | 153 | ||
152 | # force flags for this arch | 154 | # force flags for this arch |
153 | $ld .= " -m elf_x86_64"; | 155 | $ld .= " -m elf_x86_64"; |
@@ -160,6 +162,7 @@ if ($arch eq "x86_64") { | |||
160 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | 162 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; |
161 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; | 163 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; |
162 | $type = ".long"; | 164 | $type = ".long"; |
165 | $alignment = 4; | ||
163 | 166 | ||
164 | # force flags for this arch | 167 | # force flags for this arch |
165 | $ld .= " -m elf_i386"; | 168 | $ld .= " -m elf_i386"; |
@@ -288,6 +291,7 @@ sub update_funcs | |||
288 | open(FILE, ">$mcount_s") || die "can't create $mcount_s\n"; | 291 | open(FILE, ">$mcount_s") || die "can't create $mcount_s\n"; |
289 | $opened = 1; | 292 | $opened = 1; |
290 | print FILE "\t.section $mcount_section,\"a\",\@progbits\n"; | 293 | print FILE "\t.section $mcount_section,\"a\",\@progbits\n"; |
294 | print FILE "\t.align $alignment\n"; | ||
291 | } | 295 | } |
292 | printf FILE "\t%s %s + %d\n", $type, $ref_func, $offsets[$i] - $offset; | 296 | printf FILE "\t%s %s + %d\n", $type, $ref_func, $offsets[$i] - $offset; |
293 | } | 297 | } |