diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 10 | ||||
-rw-r--r-- | scripts/Makefile.modpost | 2 | ||||
-rw-r--r-- | scripts/bootgraph.pl | 19 | ||||
-rwxr-xr-x | scripts/checksyscalls.sh | 4 | ||||
-rw-r--r-- | scripts/headers_check.pl | 10 | ||||
-rw-r--r-- | scripts/headers_install.pl | 17 | ||||
-rwxr-xr-x | scripts/kernel-doc | 6 | ||||
-rw-r--r-- | scripts/mod/sumversion.c | 12 | ||||
-rw-r--r-- | scripts/package/builddeb | 24 | ||||
-rwxr-xr-x | scripts/package/mkspec | 5 | ||||
-rwxr-xr-x | scripts/recordmcount.pl | 28 | ||||
-rwxr-xr-x | scripts/setlocalversion | 6 |
12 files changed, 105 insertions, 38 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/Makefile.modpost b/scripts/Makefile.modpost index 9ee9783aea57..f4053dc7b5d6 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost | |||
@@ -82,7 +82,7 @@ modpost = scripts/mod/modpost \ | |||
82 | $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ | 82 | $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ |
83 | $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ | 83 | $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ |
84 | $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ | 84 | $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ |
85 | $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(EXTRA_SYMBOLS))) \ | 85 | $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e %,$(KBUILD_EXTRA_SYMBOLS))) \ |
86 | $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ | 86 | $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ |
87 | $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \ | 87 | $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \ |
88 | $(if $(CONFIG_MARKERS),-K $(kernelmarkersfile)) \ | 88 | $(if $(CONFIG_MARKERS),-K $(kernelmarkersfile)) \ |
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl index 5e7316e5aa39..d2c61efc216f 100644 --- a/scripts/bootgraph.pl +++ b/scripts/bootgraph.pl | |||
@@ -37,7 +37,10 @@ | |||
37 | # dmesg | perl scripts/bootgraph.pl > output.svg | 37 | # dmesg | perl scripts/bootgraph.pl > output.svg |
38 | # | 38 | # |
39 | 39 | ||
40 | my %start, %end; | 40 | use strict; |
41 | |||
42 | my %start; | ||
43 | my %end; | ||
41 | my $done = 0; | 44 | my $done = 0; |
42 | my $maxtime = 0; | 45 | my $maxtime = 0; |
43 | my $firsttime = 100; | 46 | my $firsttime = 100; |
@@ -105,18 +108,20 @@ my $threshold = ($maxtime - $firsttime) / 60.0; | |||
105 | my $stylecounter = 0; | 108 | my $stylecounter = 0; |
106 | my %rows; | 109 | my %rows; |
107 | my $rowscount = 1; | 110 | my $rowscount = 1; |
108 | while (($key,$value) = each %start) { | 111 | my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start); |
112 | my $key; | ||
113 | foreach $key (@initcalls) { | ||
109 | my $duration = $end{$key} - $start{$key}; | 114 | my $duration = $end{$key} - $start{$key}; |
110 | 115 | ||
111 | if ($duration >= $threshold) { | 116 | if ($duration >= $threshold) { |
112 | my $s, $s2, $e, $y; | 117 | my ($s, $s2, $e, $w, $y, $y2, $style); |
113 | $pid = $pids{$key}; | 118 | my $pid = $pids{$key}; |
114 | 119 | ||
115 | if (!defined($rows{$pid})) { | 120 | if (!defined($rows{$pid})) { |
116 | $rows{$pid} = $rowscount; | 121 | $rows{$pid} = $rowscount; |
117 | $rowscount = $rowscount + 1; | 122 | $rowscount = $rowscount + 1; |
118 | } | 123 | } |
119 | $s = ($value - $firsttime) * $mult; | 124 | $s = ($start{$key} - $firsttime) * $mult; |
120 | $s2 = $s + 6; | 125 | $s2 = $s + 6; |
121 | $e = ($end{$key} - $firsttime) * $mult; | 126 | $e = ($end{$key} - $firsttime) * $mult; |
122 | $w = $e - $s; | 127 | $w = $e - $s; |
@@ -140,9 +145,9 @@ while (($key,$value) = each %start) { | |||
140 | my $time = $firsttime; | 145 | my $time = $firsttime; |
141 | my $step = ($maxtime - $firsttime) / 15; | 146 | my $step = ($maxtime - $firsttime) / 15; |
142 | while ($time < $maxtime) { | 147 | while ($time < $maxtime) { |
143 | my $s2 = ($time - $firsttime) * $mult; | 148 | my $s3 = ($time - $firsttime) * $mult; |
144 | my $tm = int($time * 100) / 100.0; | 149 | my $tm = int($time * 100) / 100.0; |
145 | print "<text transform=\"translate($s2,89) rotate(90)\">$tm</text>\n"; | 150 | print "<text transform=\"translate($s3,89) rotate(90)\">$tm</text>\n"; |
146 | $time = $time + $step; | 151 | $time = $time + $step; |
147 | } | 152 | } |
148 | 153 | ||
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh index 41564b142c04..60d00d1c4eee 100755 --- a/scripts/checksyscalls.sh +++ b/scripts/checksyscalls.sh | |||
@@ -113,10 +113,10 @@ EOF | |||
113 | } | 113 | } |
114 | 114 | ||
115 | syscall_list() { | 115 | syscall_list() { |
116 | sed -n -e '/^\#define/ { s/[^_]*__NR_\([^[:space:]]*\).*/\ | 116 | sed -n -e '/^\#define/ s/[^_]*__NR_\([^[:space:]]*\).*/\ |
117 | \#if !defined \(__NR_\1\) \&\& !defined \(__IGNORE_\1\)\ | 117 | \#if !defined \(__NR_\1\) \&\& !defined \(__IGNORE_\1\)\ |
118 | \#warning syscall \1 not implemented\ | 118 | \#warning syscall \1 not implemented\ |
119 | \#endif/p }' $1 | 119 | \#endif/p' $1 |
120 | } | 120 | } |
121 | 121 | ||
122 | (ignore_list && syscall_list ${srctree}/arch/x86/include/asm/unistd_32.h) | \ | 122 | (ignore_list && syscall_list ${srctree}/arch/x86/include/asm/unistd_32.h) | \ |
diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl index 15d53a6b1a1f..488a3b1f760f 100644 --- a/scripts/headers_check.pl +++ b/scripts/headers_check.pl | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl -w |
2 | # | 2 | # |
3 | # headers_check.pl execute a number of trivial consistency checks | 3 | # headers_check.pl execute a number of trivial consistency checks |
4 | # | 4 | # |
@@ -17,7 +17,6 @@ | |||
17 | # 2) TODO: check for leaked CONFIG_ symbols | 17 | # 2) TODO: check for leaked CONFIG_ symbols |
18 | 18 | ||
19 | use strict; | 19 | use strict; |
20 | use warnings; | ||
21 | 20 | ||
22 | my ($dir, $arch, @files) = @ARGV; | 21 | my ($dir, $arch, @files) = @ARGV; |
23 | 22 | ||
@@ -27,14 +26,15 @@ my $lineno = 0; | |||
27 | my $filename; | 26 | my $filename; |
28 | 27 | ||
29 | foreach my $file (@files) { | 28 | foreach my $file (@files) { |
29 | local *FH; | ||
30 | $filename = $file; | 30 | $filename = $file; |
31 | open(my $fh, '<', "$filename") or die "$filename: $!\n"; | 31 | open(FH, "<$filename") or die "$filename: $!\n"; |
32 | $lineno = 0; | 32 | $lineno = 0; |
33 | while ($line = <$fh>) { | 33 | while ($line = <FH>) { |
34 | $lineno++; | 34 | $lineno++; |
35 | check_include(); | 35 | check_include(); |
36 | } | 36 | } |
37 | close $fh; | 37 | close FH; |
38 | } | 38 | } |
39 | exit $ret; | 39 | exit $ret; |
40 | 40 | ||
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl index 68591cd08731..7d2b4146e02f 100644 --- a/scripts/headers_install.pl +++ b/scripts/headers_install.pl | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl -w |
2 | # | 2 | # |
3 | # headers_install prepare the listed header files for use in | 3 | # headers_install prepare the listed header files for use in |
4 | # user space and copy the files to their destination. | 4 | # user space and copy the files to their destination. |
@@ -17,28 +17,29 @@ | |||
17 | # 3) Drop all sections defined out by __KERNEL__ (using unifdef) | 17 | # 3) Drop all sections defined out by __KERNEL__ (using unifdef) |
18 | 18 | ||
19 | use strict; | 19 | use strict; |
20 | use warnings; | ||
21 | 20 | ||
22 | my ($readdir, $installdir, $arch, @files) = @ARGV; | 21 | my ($readdir, $installdir, $arch, @files) = @ARGV; |
23 | 22 | ||
24 | my $unifdef = "scripts/unifdef -U__KERNEL__"; | 23 | my $unifdef = "scripts/unifdef -U__KERNEL__"; |
25 | 24 | ||
26 | foreach my $file (@files) { | 25 | foreach my $file (@files) { |
26 | local *INFILE; | ||
27 | local *OUTFILE; | ||
27 | my $tmpfile = "$installdir/$file.tmp"; | 28 | my $tmpfile = "$installdir/$file.tmp"; |
28 | open(my $infile, '<', "$readdir/$file") | 29 | open(INFILE, "<$readdir/$file") |
29 | or die "$readdir/$file: $!\n"; | 30 | or die "$readdir/$file: $!\n"; |
30 | open(my $outfile, '>', "$tmpfile") or die "$tmpfile: $!\n"; | 31 | open(OUTFILE, ">$tmpfile") or die "$tmpfile: $!\n"; |
31 | while (my $line = <$infile>) { | 32 | while (my $line = <INFILE>) { |
32 | $line =~ s/([\s(])__user\s/$1/g; | 33 | $line =~ s/([\s(])__user\s/$1/g; |
33 | $line =~ s/([\s(])__force\s/$1/g; | 34 | $line =~ s/([\s(])__force\s/$1/g; |
34 | $line =~ s/([\s(])__iomem\s/$1/g; | 35 | $line =~ s/([\s(])__iomem\s/$1/g; |
35 | $line =~ s/\s__attribute_const__\s/ /g; | 36 | $line =~ s/\s__attribute_const__\s/ /g; |
36 | $line =~ s/\s__attribute_const__$//g; | 37 | $line =~ s/\s__attribute_const__$//g; |
37 | $line =~ s/^#include <linux\/compiler.h>//; | 38 | $line =~ s/^#include <linux\/compiler.h>//; |
38 | printf $outfile "%s", $line; | 39 | printf OUTFILE "%s", $line; |
39 | } | 40 | } |
40 | close $outfile; | 41 | close OUTFILE; |
41 | close $infile; | 42 | close INFILE; |
42 | system $unifdef . " $tmpfile > $installdir/$file"; | 43 | system $unifdef . " $tmpfile > $installdir/$file"; |
43 | unlink $tmpfile; | 44 | unlink $tmpfile; |
44 | } | 45 | } |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 44ee94d2ab76..a53e2fc8dfb5 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -1648,7 +1648,7 @@ sub dump_function($$) { | |||
1648 | $prototype =~ s/^noinline +//; | 1648 | $prototype =~ s/^noinline +//; |
1649 | $prototype =~ s/__devinit +//; | 1649 | $prototype =~ s/__devinit +//; |
1650 | $prototype =~ s/__init +//; | 1650 | $prototype =~ s/__init +//; |
1651 | $prototype =~ s/^#define\s+//; #ak added | 1651 | $prototype =~ s/^#\s*define\s+//; #ak added |
1652 | $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; | 1652 | $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; |
1653 | 1653 | ||
1654 | # Yes, this truly is vile. We are looking for: | 1654 | # Yes, this truly is vile. We are looking for: |
@@ -1764,13 +1764,13 @@ sub process_state3_function($$) { | |||
1764 | 1764 | ||
1765 | $x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line | 1765 | $x =~ s@\/\/.*$@@gos; # strip C99-style comments to end of line |
1766 | 1766 | ||
1767 | if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#define/)) { | 1767 | if ($x =~ m#\s*/\*\s+MACDOC\s*#io || ($x =~ /^#/ && $x !~ /^#\s*define/)) { |
1768 | # do nothing | 1768 | # do nothing |
1769 | } | 1769 | } |
1770 | elsif ($x =~ /([^\{]*)/) { | 1770 | elsif ($x =~ /([^\{]*)/) { |
1771 | $prototype .= $1; | 1771 | $prototype .= $1; |
1772 | } | 1772 | } |
1773 | if (($x =~ /\{/) || ($x =~ /\#define/) || ($x =~ /;/)) { | 1773 | if (($x =~ /\{/) || ($x =~ /\#\s*define/) || ($x =~ /;/)) { |
1774 | $prototype =~ s@/\*.*?\*/@@gos; # strip comments. | 1774 | $prototype =~ s@/\*.*?\*/@@gos; # strip comments. |
1775 | $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's. | 1775 | $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's. |
1776 | $prototype =~ s@^\s+@@gos; # strip leading spaces | 1776 | $prototype =~ s@^\s+@@gos; # strip leading spaces |
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index d9cc6901d680..aadc5223dcdb 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c | |||
@@ -290,6 +290,15 @@ static int parse_file(const char *fname, struct md4_ctx *md) | |||
290 | release_file(file, len); | 290 | release_file(file, len); |
291 | return 1; | 291 | return 1; |
292 | } | 292 | } |
293 | /* Check whether the file is a static library or not */ | ||
294 | static int is_static_library(const char *objfile) | ||
295 | { | ||
296 | int len = strlen(objfile); | ||
297 | if (objfile[len - 2] == '.' && objfile[len - 1] == 'a') | ||
298 | return 1; | ||
299 | else | ||
300 | return 0; | ||
301 | } | ||
293 | 302 | ||
294 | /* We have dir/file.o. Open dir/.file.o.cmd, look for deps_ line to | 303 | /* We have dir/file.o. Open dir/.file.o.cmd, look for deps_ line to |
295 | * figure out source file. */ | 304 | * figure out source file. */ |
@@ -420,7 +429,8 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen) | |||
420 | while ((fname = strsep(&sources, " ")) != NULL) { | 429 | while ((fname = strsep(&sources, " ")) != NULL) { |
421 | if (!*fname) | 430 | if (!*fname) |
422 | continue; | 431 | continue; |
423 | if (!parse_source_files(fname, &md)) | 432 | if (!(is_static_library(fname)) && |
433 | !parse_source_files(fname, &md)) | ||
424 | goto release; | 434 | goto release; |
425 | } | 435 | } |
426 | 436 | ||
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index ba6bf5d5abf9..1264b8e2829d 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb | |||
@@ -15,15 +15,18 @@ set -e | |||
15 | version=$KERNELRELEASE | 15 | version=$KERNELRELEASE |
16 | revision=`cat .version` | 16 | revision=`cat .version` |
17 | tmpdir="$objtree/debian/tmp" | 17 | tmpdir="$objtree/debian/tmp" |
18 | fwdir="$objtree/debian/fwtmp" | ||
18 | packagename=linux-$version | 19 | packagename=linux-$version |
20 | fwpackagename=linux-firmware-image | ||
19 | 21 | ||
20 | if [ "$ARCH" == "um" ] ; then | 22 | if [ "$ARCH" == "um" ] ; then |
21 | packagename=user-mode-linux-$version | 23 | packagename=user-mode-linux-$version |
22 | fi | 24 | fi |
23 | 25 | ||
24 | # Setup the directory structure | 26 | # Setup the directory structure |
25 | rm -rf "$tmpdir" | 27 | rm -rf "$tmpdir" "$fwdir" |
26 | mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" | 28 | mkdir -p "$tmpdir/DEBIAN" "$tmpdir/lib" "$tmpdir/boot" |
29 | mkdir -p "$fwdir/DEBIAN" "$fwdir/lib" | ||
27 | if [ "$ARCH" == "um" ] ; then | 30 | if [ "$ARCH" == "um" ] ; then |
28 | mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin" | 31 | mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/share/doc/$packagename" "$tmpdir/usr/bin" |
29 | fi | 32 | fi |
@@ -107,6 +110,7 @@ Standards-Version: 3.6.1 | |||
107 | 110 | ||
108 | Package: $packagename | 111 | Package: $packagename |
109 | Provides: kernel-image-$version, linux-image-$version | 112 | Provides: kernel-image-$version, linux-image-$version |
113 | Suggests: $fwpackagename | ||
110 | Architecture: any | 114 | Architecture: any |
111 | Description: Linux kernel, version $version | 115 | Description: Linux kernel, version $version |
112 | This package contains the Linux kernel, modules and corresponding other | 116 | This package contains the Linux kernel, modules and corresponding other |
@@ -118,8 +122,24 @@ fi | |||
118 | chown -R root:root "$tmpdir" | 122 | chown -R root:root "$tmpdir" |
119 | chmod -R go-w "$tmpdir" | 123 | chmod -R go-w "$tmpdir" |
120 | 124 | ||
125 | # Do we have firmware? Move it out of the way and build it into a package. | ||
126 | if [ -e "$tmpdir/lib/firmware" ]; then | ||
127 | mv "$tmpdir/lib/firmware" "$fwdir/lib/" | ||
128 | |||
129 | cat <<EOF >> debian/control | ||
130 | |||
131 | Package: $fwpackagename | ||
132 | Architecture: all | ||
133 | Description: Linux kernel firmware, version $version | ||
134 | This package contains firmware from the Linux kernel, version $version | ||
135 | EOF | ||
136 | |||
137 | dpkg-gencontrol -isp -p$fwpackagename -P"$fwdir" | ||
138 | dpkg --build "$fwdir" .. | ||
139 | fi | ||
140 | |||
121 | # Perform the final magic | 141 | # Perform the final magic |
122 | dpkg-gencontrol -isp | 142 | dpkg-gencontrol -isp -p$packagename |
123 | dpkg --build "$tmpdir" .. | 143 | dpkg --build "$tmpdir" .. |
124 | 144 | ||
125 | exit 0 | 145 | exit 0 |
diff --git a/scripts/package/mkspec b/scripts/package/mkspec index ffd61fe0c1ad..2500886fb90a 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec | |||
@@ -57,15 +57,17 @@ fi | |||
57 | echo "%build" | 57 | echo "%build" |
58 | 58 | ||
59 | if ! $PREBUILT; then | 59 | if ! $PREBUILT; then |
60 | echo "make clean && make %{_smp_mflags}" | 60 | echo "make clean && make %{?_smp_mflags}" |
61 | echo "" | 61 | echo "" |
62 | fi | 62 | fi |
63 | 63 | ||
64 | echo "%install" | 64 | echo "%install" |
65 | echo "%ifarch ia64" | 65 | echo "%ifarch ia64" |
66 | echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules' | 66 | echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules' |
67 | echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' | ||
67 | echo "%else" | 68 | echo "%else" |
68 | echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules' | 69 | echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib/modules' |
70 | echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware' | ||
69 | echo "%endif" | 71 | echo "%endif" |
70 | 72 | ||
71 | echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install' | 73 | echo 'INSTALL_MOD_PATH=$RPM_BUILD_ROOT make %{_smp_mflags} modules_install' |
@@ -92,5 +94,6 @@ echo "%files" | |||
92 | echo '%defattr (-, root, root)' | 94 | echo '%defattr (-, root, root)' |
93 | echo "%dir /lib/modules" | 95 | echo "%dir /lib/modules" |
94 | echo "/lib/modules/$KERNELRELEASE" | 96 | echo "/lib/modules/$KERNELRELEASE" |
97 | echo "/lib/firmware" | ||
95 | echo "/boot/*" | 98 | echo "/boot/*" |
96 | echo "" | 99 | echo "" |
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index f56d760bd589..6b9fe3eb8360 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -106,7 +106,13 @@ 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; | ||
111 | |||
112 | # Acceptable sections to record. | ||
113 | my %text_sections = ( | ||
114 | ".text" => 1, | ||
115 | ); | ||
110 | 116 | ||
111 | $objdump = "objdump" if ((length $objdump) == 0); | 117 | $objdump = "objdump" if ((length $objdump) == 0); |
112 | $objcopy = "objcopy" if ((length $objcopy) == 0); | 118 | $objcopy = "objcopy" if ((length $objcopy) == 0); |
@@ -129,8 +135,16 @@ my $function_regex; # Find the name of a function | |||
129 | # (return offset and func name) | 135 | # (return offset and func name) |
130 | my $mcount_regex; # Find the call site to mcount (return offset) | 136 | my $mcount_regex; # Find the call site to mcount (return offset) |
131 | 137 | ||
138 | if ($arch eq "x86") { | ||
139 | if ($bits == 64) { | ||
140 | $arch = "x86_64"; | ||
141 | } else { | ||
142 | $arch = "i386"; | ||
143 | } | ||
144 | } | ||
145 | |||
132 | if ($arch eq "x86_64") { | 146 | if ($arch eq "x86_64") { |
133 | $section_regex = "Disassembly of section"; | 147 | $section_regex = "Disassembly of section\\s+(\\S+):"; |
134 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | 148 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; |
135 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; | 149 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; |
136 | $type = ".quad"; | 150 | $type = ".quad"; |
@@ -142,7 +156,7 @@ if ($arch eq "x86_64") { | |||
142 | $cc .= " -m64"; | 156 | $cc .= " -m64"; |
143 | 157 | ||
144 | } elsif ($arch eq "i386") { | 158 | } elsif ($arch eq "i386") { |
145 | $section_regex = "Disassembly of section"; | 159 | $section_regex = "Disassembly of section\\s+(\\S+):"; |
146 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | 160 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; |
147 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; | 161 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; |
148 | $type = ".long"; | 162 | $type = ".long"; |
@@ -289,7 +303,13 @@ my $text; | |||
289 | while (<IN>) { | 303 | while (<IN>) { |
290 | # is it a section? | 304 | # is it a section? |
291 | if (/$section_regex/) { | 305 | if (/$section_regex/) { |
292 | $read_function = 1; | 306 | |
307 | # Only record text sections that we know are safe | ||
308 | if (defined($text_sections{$1})) { | ||
309 | $read_function = 1; | ||
310 | } else { | ||
311 | $read_function = 0; | ||
312 | } | ||
293 | # print out any recorded offsets | 313 | # print out any recorded offsets |
294 | update_funcs() if ($text_found); | 314 | update_funcs() if ($text_found); |
295 | 315 | ||
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 83b75126c9f7..72d233528ade 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion | |||
@@ -9,11 +9,13 @@ usage() { | |||
9 | cd "${1:-.}" || usage | 9 | cd "${1:-.}" || usage |
10 | 10 | ||
11 | # Check for git and a git repo. | 11 | # Check for git and a git repo. |
12 | if head=`git rev-parse --verify HEAD 2>/dev/null`; then | 12 | if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then |
13 | # Do we have an untagged version? | 13 | # Do we have an untagged version? |
14 | if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then | 14 | if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then |
15 | if tag=`git describe 2>/dev/null`; then | 15 | if tag=`git describe 2>/dev/null`; then |
16 | echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' | 16 | echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' |
17 | else | ||
18 | printf '%s%s' -g $head | ||
17 | fi | 19 | fi |
18 | fi | 20 | fi |
19 | 21 | ||
@@ -55,7 +57,7 @@ if rev=`svn info 2>/dev/null | grep '^Revision'`; then | |||
55 | 57 | ||
56 | # Are there uncommitted changes? | 58 | # Are there uncommitted changes? |
57 | if [ $changes != 0 ]; then | 59 | if [ $changes != 0 ]; then |
58 | printf -- '-svn%s%s%s' "$rev" -dirty "$changes" | 60 | printf -- '-svn%s%s' "$rev" -dirty |
59 | else | 61 | else |
60 | printf -- '-svn%s' "$rev" | 62 | printf -- '-svn%s' "$rev" |
61 | fi | 63 | fi |