diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-10 03:10:44 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-10 03:10:44 -0500 |
commit | a5a64498c194c82ecad3a2d67cff6231cda8d3dd (patch) | |
tree | 723d5d81419f9960b8d30ed9a2ece8a58d6c4328 /scripts | |
parent | bb93d802ae5c1949977cc6da247b218240677f11 (diff) | |
parent | f7160c7573615ec82c691e294cf80d920b5d588d (diff) |
Merge commit 'v2.6.28-rc4' into timers/rtc
Conflicts:
drivers/rtc/rtc-cmos.c
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 13 | ||||
-rw-r--r-- | scripts/Makefile.modpost | 2 | ||||
-rw-r--r-- | scripts/basic/.gitignore | 2 | ||||
-rw-r--r-- | scripts/bootgraph.pl | 39 | ||||
-rwxr-xr-x | scripts/checkpatch.pl | 2 | ||||
-rwxr-xr-x | scripts/checkstack.pl | 4 | ||||
-rwxr-xr-x | scripts/checksyscalls.sh | 6 | ||||
-rw-r--r-- | scripts/headers_check.pl | 10 | ||||
-rw-r--r-- | scripts/headers_install.pl | 17 | ||||
-rw-r--r-- | scripts/kconfig/Makefile | 4 | ||||
-rw-r--r-- | scripts/kconfig/confdata.c | 3 | ||||
-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 | 415 | ||||
-rwxr-xr-x | scripts/setlocalversion | 6 |
17 files changed, 524 insertions, 46 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 277cfe0b7100..468fbc9016c7 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -198,10 +198,23 @@ 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 | |||
207 | ifdef CONFIG_FTRACE_MCOUNT_RECORD | ||
208 | cmd_record_mcount = perl $(srctree)/scripts/recordmcount.pl \ | ||
209 | "$(ARCH)" "$(arch_bits)" "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" \ | ||
210 | "$(NM)" "$(RM)" "$(MV)" "$(@)"; | ||
211 | endif | ||
212 | |||
201 | define rule_cc_o_c | 213 | define rule_cc_o_c |
202 | $(call echo-cmd,checksrc) $(cmd_checksrc) \ | 214 | $(call echo-cmd,checksrc) $(cmd_checksrc) \ |
203 | $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ | 215 | $(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \ |
204 | $(cmd_modversions) \ | 216 | $(cmd_modversions) \ |
217 | $(cmd_record_mcount) \ | ||
205 | scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \ | 218 | scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \ |
206 | $(dot-target).tmp; \ | 219 | $(dot-target).tmp; \ |
207 | rm -f $(depfile); \ | 220 | rm -f $(depfile); \ |
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/basic/.gitignore b/scripts/basic/.gitignore index 7304e19782c7..bf8b199ec598 100644 --- a/scripts/basic/.gitignore +++ b/scripts/basic/.gitignore | |||
@@ -1,3 +1,3 @@ | |||
1 | hash | ||
1 | fixdep | 2 | fixdep |
2 | split-include | ||
3 | docproc | 3 | docproc |
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl index 2243353fe55d..d2c61efc216f 100644 --- a/scripts/bootgraph.pl +++ b/scripts/bootgraph.pl | |||
@@ -37,13 +37,16 @@ | |||
37 | # dmesg | perl scripts/bootgraph.pl > output.svg | 37 | # dmesg | perl scripts/bootgraph.pl > output.svg |
38 | # | 38 | # |
39 | 39 | ||
40 | my @rows; | 40 | use strict; |
41 | my %start, %end, %row; | 41 | |
42 | my %start; | ||
43 | my %end; | ||
42 | my $done = 0; | 44 | my $done = 0; |
43 | my $rowcount = 0; | ||
44 | my $maxtime = 0; | 45 | my $maxtime = 0; |
45 | my $firsttime = 100; | 46 | my $firsttime = 100; |
46 | my $count = 0; | 47 | my $count = 0; |
48 | my %pids; | ||
49 | |||
47 | while (<>) { | 50 | while (<>) { |
48 | my $line = $_; | 51 | my $line = $_; |
49 | if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_]+)\+/) { | 52 | if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_]+)\+/) { |
@@ -54,14 +57,8 @@ while (<>) { | |||
54 | $firsttime = $1; | 57 | $firsttime = $1; |
55 | } | 58 | } |
56 | } | 59 | } |
57 | $row{$func} = 1; | ||
58 | if ($line =~ /\@ ([0-9]+)/) { | 60 | if ($line =~ /\@ ([0-9]+)/) { |
59 | my $pid = $1; | 61 | $pids{$func} = $1; |
60 | if (!defined($rows[$pid])) { | ||
61 | $rowcount = $rowcount + 1; | ||
62 | $rows[$pid] = $rowcount; | ||
63 | } | ||
64 | $row{$func} = $rows[$pid]; | ||
65 | } | 62 | } |
66 | $count = $count + 1; | 63 | $count = $count + 1; |
67 | } | 64 | } |
@@ -109,17 +106,27 @@ $styles[11] = "fill:rgb(128,255,255);fill-opacity:0.5;stroke-width:1;stroke:rgb( | |||
109 | my $mult = 950.0 / ($maxtime - $firsttime); | 106 | my $mult = 950.0 / ($maxtime - $firsttime); |
110 | my $threshold = ($maxtime - $firsttime) / 60.0; | 107 | my $threshold = ($maxtime - $firsttime) / 60.0; |
111 | my $stylecounter = 0; | 108 | my $stylecounter = 0; |
112 | while (($key,$value) = each %start) { | 109 | my %rows; |
110 | my $rowscount = 1; | ||
111 | my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start); | ||
112 | my $key; | ||
113 | foreach $key (@initcalls) { | ||
113 | my $duration = $end{$key} - $start{$key}; | 114 | my $duration = $end{$key} - $start{$key}; |
114 | 115 | ||
115 | if ($duration >= $threshold) { | 116 | if ($duration >= $threshold) { |
116 | my $s, $s2, $e, $y; | 117 | my ($s, $s2, $e, $w, $y, $y2, $style); |
117 | $s = ($value - $firsttime) * $mult; | 118 | my $pid = $pids{$key}; |
119 | |||
120 | if (!defined($rows{$pid})) { | ||
121 | $rows{$pid} = $rowscount; | ||
122 | $rowscount = $rowscount + 1; | ||
123 | } | ||
124 | $s = ($start{$key} - $firsttime) * $mult; | ||
118 | $s2 = $s + 6; | 125 | $s2 = $s + 6; |
119 | $e = ($end{$key} - $firsttime) * $mult; | 126 | $e = ($end{$key} - $firsttime) * $mult; |
120 | $w = $e - $s; | 127 | $w = $e - $s; |
121 | 128 | ||
122 | $y = $row{$key} * 150; | 129 | $y = $rows{$pid} * 150; |
123 | $y2 = $y + 4; | 130 | $y2 = $y + 4; |
124 | 131 | ||
125 | $style = $styles[$stylecounter]; | 132 | $style = $styles[$stylecounter]; |
@@ -138,9 +145,9 @@ while (($key,$value) = each %start) { | |||
138 | my $time = $firsttime; | 145 | my $time = $firsttime; |
139 | my $step = ($maxtime - $firsttime) / 15; | 146 | my $step = ($maxtime - $firsttime) / 15; |
140 | while ($time < $maxtime) { | 147 | while ($time < $maxtime) { |
141 | my $s2 = ($time - $firsttime) * $mult; | 148 | my $s3 = ($time - $firsttime) * $mult; |
142 | my $tm = int($time * 100) / 100.0; | 149 | my $tm = int($time * 100) / 100.0; |
143 | print "<text transform=\"translate($s2,89) rotate(90)\">$tm</text>\n"; | 150 | print "<text transform=\"translate($s3,89) rotate(90)\">$tm</text>\n"; |
144 | $time = $time + $step; | 151 | $time = $time + $step; |
145 | } | 152 | } |
146 | 153 | ||
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e30bac141b21..f88bb3e21cda 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1,5 +1,5 @@ | |||
1 | #!/usr/bin/perl -w | 1 | #!/usr/bin/perl -w |
2 | # (c) 2001, Dave Jones. <davej@codemonkey.org.uk> (the file handling bit) | 2 | # (c) 2001, Dave Jones. <davej@redhat.com> (the file handling bit) |
3 | # (c) 2005, Joel Schopp <jschopp@austin.ibm.com> (the ugly bit) | 3 | # (c) 2005, Joel Schopp <jschopp@austin.ibm.com> (the ugly bit) |
4 | # (c) 2007, Andy Whitcroft <apw@uk.ibm.com> (new conditions, test suite, etc) | 4 | # (c) 2007, Andy Whitcroft <apw@uk.ibm.com> (new conditions, test suite, etc) |
5 | # Licensed under the terms of the GNU GPL License version 2 | 5 | # Licensed under the terms of the GNU GPL License version 2 |
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index f7e8e93ff30d..14ee68e991dd 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl | |||
@@ -14,6 +14,7 @@ | |||
14 | # M68k port by Geert Uytterhoeven and Andreas Schwab | 14 | # M68k port by Geert Uytterhoeven and Andreas Schwab |
15 | # AVR32 port by Haavard Skinnemoen <hskinnemoen@atmel.com> | 15 | # AVR32 port by Haavard Skinnemoen <hskinnemoen@atmel.com> |
16 | # PARISC port by Kyle McMartin <kyle@parisc-linux.org> | 16 | # PARISC port by Kyle McMartin <kyle@parisc-linux.org> |
17 | # sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk> | ||
17 | # | 18 | # |
18 | # Usage: | 19 | # Usage: |
19 | # objdump -d vmlinux | scripts/checkstack.pl [arch] | 20 | # objdump -d vmlinux | scripts/checkstack.pl [arch] |
@@ -94,6 +95,9 @@ my (@stack, $re, $dre, $x, $xs); | |||
94 | } elsif ($arch =~ /^blackfin$/) { | 95 | } elsif ($arch =~ /^blackfin$/) { |
95 | # 0: 00 e8 38 01 LINK 0x4e0; | 96 | # 0: 00 e8 38 01 LINK 0x4e0; |
96 | $re = qr/.*[[:space:]]LINK[[:space:]]*(0x$x{1,8})/o; | 97 | $re = qr/.*[[:space:]]LINK[[:space:]]*(0x$x{1,8})/o; |
98 | } elsif ($arch eq 'sparc' || $arch eq 'sparc64') { | ||
99 | # f0019d10: 9d e3 bf 90 save %sp, -112, %sp | ||
100 | $re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o; | ||
97 | } else { | 101 | } else { |
98 | print("wrong or unknown architecture \"$arch\"\n"); | 102 | print("wrong or unknown architecture \"$arch\"\n"); |
99 | exit | 103 | exit |
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh index 366f8c7f62bf..60d00d1c4eee 100755 --- a/scripts/checksyscalls.sh +++ b/scripts/checksyscalls.sh | |||
@@ -113,11 +113,11 @@ 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}/include/asm-x86/unistd_32.h) | \ | 122 | (ignore_list && syscall_list ${srctree}/arch/x86/include/asm/unistd_32.h) | \ |
123 | $* -E -x c - > /dev/null | 123 | $* -E -x c - > /dev/null |
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/kconfig/Makefile b/scripts/kconfig/Makefile index fa1a7d565903..fa8c2dd9c983 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
@@ -4,7 +4,11 @@ | |||
4 | 4 | ||
5 | PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config | 5 | PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config |
6 | 6 | ||
7 | ifdef KBUILD_KCONFIG | ||
8 | Kconfig := $(KBUILD_KCONFIG) | ||
9 | else | ||
7 | Kconfig := arch/$(SRCARCH)/Kconfig | 10 | Kconfig := arch/$(SRCARCH)/Kconfig |
11 | endif | ||
8 | 12 | ||
9 | xconfig: $(obj)/qconf | 13 | xconfig: $(obj)/qconf |
10 | $< $(Kconfig) | 14 | $< $(Kconfig) |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index b91cf241a539..830d9eae11f9 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
@@ -852,8 +852,7 @@ void conf_set_all_new_symbols(enum conf_def_mode mode) | |||
852 | 852 | ||
853 | } | 853 | } |
854 | 854 | ||
855 | if (modules_sym) | 855 | sym_clear_all_valid(); |
856 | sym_calc_value(modules_sym); | ||
857 | 856 | ||
858 | if (mode != def_random) | 857 | if (mode != def_random) |
859 | return; | 858 | return; |
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 new file mode 100755 index 000000000000..6b9fe3eb8360 --- /dev/null +++ b/scripts/recordmcount.pl | |||
@@ -0,0 +1,415 @@ | |||
1 | #!/usr/bin/perl -w | ||
2 | # (c) 2008, Steven Rostedt <srostedt@redhat.com> | ||
3 | # Licensed under the terms of the GNU GPL License version 2 | ||
4 | # | ||
5 | # recordmcount.pl - makes a section called __mcount_loc that holds | ||
6 | # all the offsets to the calls to mcount. | ||
7 | # | ||
8 | # | ||
9 | # What we want to end up with is a section in vmlinux called | ||
10 | # __mcount_loc that contains a list of pointers to all the | ||
11 | # call sites in the kernel that call mcount. Later on boot up, the kernel | ||
12 | # will read this list, save the locations and turn them into nops. | ||
13 | # When tracing or profiling is later enabled, these locations will then | ||
14 | # be converted back to pointers to some function. | ||
15 | # | ||
16 | # This is no easy feat. This script is called just after the original | ||
17 | # object is compiled and before it is linked. | ||
18 | # | ||
19 | # The references to the call sites are offsets from the section of text | ||
20 | # that the call site is in. Hence, all functions in a section that | ||
21 | # has a call site to mcount, will have the offset from the beginning of | ||
22 | # the section and not the beginning of the function. | ||
23 | # | ||
24 | # The trick is to find a way to record the beginning of the section. | ||
25 | # The way we do this is to look at the first function in the section | ||
26 | # which will also be the location of that section after final link. | ||
27 | # e.g. | ||
28 | # | ||
29 | # .section ".text.sched" | ||
30 | # .globl my_func | ||
31 | # my_func: | ||
32 | # [...] | ||
33 | # call mcount (offset: 0x5) | ||
34 | # [...] | ||
35 | # ret | ||
36 | # other_func: | ||
37 | # [...] | ||
38 | # call mcount (offset: 0x1b) | ||
39 | # [...] | ||
40 | # | ||
41 | # Both relocation offsets for the mcounts in the above example will be | ||
42 | # offset from .text.sched. If we make another file called tmp.s with: | ||
43 | # | ||
44 | # .section __mcount_loc | ||
45 | # .quad my_func + 0x5 | ||
46 | # .quad my_func + 0x1b | ||
47 | # | ||
48 | # We can then compile this tmp.s into tmp.o, and link it to the original | ||
49 | # object. | ||
50 | # | ||
51 | # But this gets hard if my_func is not globl (a static function). | ||
52 | # In such a case we have: | ||
53 | # | ||
54 | # .section ".text.sched" | ||
55 | # my_func: | ||
56 | # [...] | ||
57 | # call mcount (offset: 0x5) | ||
58 | # [...] | ||
59 | # ret | ||
60 | # .globl my_func | ||
61 | # other_func: | ||
62 | # [...] | ||
63 | # call mcount (offset: 0x1b) | ||
64 | # [...] | ||
65 | # | ||
66 | # If we make the tmp.s the same as above, when we link together with | ||
67 | # the original object, we will end up with two symbols for my_func: | ||
68 | # one local, one global. After final compile, we will end up with | ||
69 | # an undefined reference to my_func. | ||
70 | # | ||
71 | # Since local objects can reference local variables, we need to find | ||
72 | # a way to make tmp.o reference the local objects of the original object | ||
73 | # file after it is linked together. To do this, we convert the my_func | ||
74 | # into a global symbol before linking tmp.o. Then after we link tmp.o | ||
75 | # we will only have a single symbol for my_func that is global. | ||
76 | # We can convert my_func back into a local symbol and we are done. | ||
77 | # | ||
78 | # Here are the steps we take: | ||
79 | # | ||
80 | # 1) Record all the local symbols by using 'nm' | ||
81 | # 2) Use objdump to find all the call site offsets and sections for | ||
82 | # mcount. | ||
83 | # 3) Compile the list into its own object. | ||
84 | # 4) Do we have to deal with local functions? If not, go to step 8. | ||
85 | # 5) Make an object that converts these local functions to global symbols | ||
86 | # with objcopy. | ||
87 | # 6) Link together this new object with the list object. | ||
88 | # 7) Convert the local functions back to local symbols and rename | ||
89 | # the result as the original object. | ||
90 | # End. | ||
91 | # 8) Link the object with the list object. | ||
92 | # 9) Move the result back to the original object. | ||
93 | # End. | ||
94 | # | ||
95 | |||
96 | use strict; | ||
97 | |||
98 | my $P = $0; | ||
99 | $P =~ s@.*/@@g; | ||
100 | |||
101 | my $V = '0.1'; | ||
102 | |||
103 | if ($#ARGV < 6) { | ||
104 | print "usage: $P arch objdump objcopy cc ld nm rm mv inputfile\n"; | ||
105 | print "version: $V\n"; | ||
106 | exit(1); | ||
107 | } | ||
108 | |||
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 | ); | ||
116 | |||
117 | $objdump = "objdump" if ((length $objdump) == 0); | ||
118 | $objcopy = "objcopy" if ((length $objcopy) == 0); | ||
119 | $cc = "gcc" if ((length $cc) == 0); | ||
120 | $ld = "ld" if ((length $ld) == 0); | ||
121 | $nm = "nm" if ((length $nm) == 0); | ||
122 | $rm = "rm" if ((length $rm) == 0); | ||
123 | $mv = "mv" if ((length $mv) == 0); | ||
124 | |||
125 | #print STDERR "running: $P '$arch' '$objdump' '$objcopy' '$cc' '$ld' " . | ||
126 | # "'$nm' '$rm' '$mv' '$inputfile'\n"; | ||
127 | |||
128 | my %locals; # List of local (static) functions | ||
129 | my %weak; # List of weak functions | ||
130 | my %convert; # List of local functions used that needs conversion | ||
131 | |||
132 | my $type; | ||
133 | my $section_regex; # Find the start of a section | ||
134 | my $function_regex; # Find the name of a function | ||
135 | # (return offset and func name) | ||
136 | my $mcount_regex; # Find the call site to mcount (return offset) | ||
137 | |||
138 | if ($arch eq "x86") { | ||
139 | if ($bits == 64) { | ||
140 | $arch = "x86_64"; | ||
141 | } else { | ||
142 | $arch = "i386"; | ||
143 | } | ||
144 | } | ||
145 | |||
146 | if ($arch eq "x86_64") { | ||
147 | $section_regex = "Disassembly of section\\s+(\\S+):"; | ||
148 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | ||
149 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; | ||
150 | $type = ".quad"; | ||
151 | |||
152 | # force flags for this arch | ||
153 | $ld .= " -m elf_x86_64"; | ||
154 | $objdump .= " -M x86-64"; | ||
155 | $objcopy .= " -O elf64-x86-64"; | ||
156 | $cc .= " -m64"; | ||
157 | |||
158 | } elsif ($arch eq "i386") { | ||
159 | $section_regex = "Disassembly of section\\s+(\\S+):"; | ||
160 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; | ||
161 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; | ||
162 | $type = ".long"; | ||
163 | |||
164 | # force flags for this arch | ||
165 | $ld .= " -m elf_i386"; | ||
166 | $objdump .= " -M i386"; | ||
167 | $objcopy .= " -O elf32-i386"; | ||
168 | $cc .= " -m32"; | ||
169 | |||
170 | } else { | ||
171 | die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD"; | ||
172 | } | ||
173 | |||
174 | my $text_found = 0; | ||
175 | my $read_function = 0; | ||
176 | my $opened = 0; | ||
177 | my $mcount_section = "__mcount_loc"; | ||
178 | |||
179 | my $dirname; | ||
180 | my $filename; | ||
181 | my $prefix; | ||
182 | my $ext; | ||
183 | |||
184 | if ($inputfile =~ m,^(.*)/([^/]*)$,) { | ||
185 | $dirname = $1; | ||
186 | $filename = $2; | ||
187 | } else { | ||
188 | $dirname = "."; | ||
189 | $filename = $inputfile; | ||
190 | } | ||
191 | |||
192 | if ($filename =~ m,^(.*)(\.\S),) { | ||
193 | $prefix = $1; | ||
194 | $ext = $2; | ||
195 | } else { | ||
196 | $prefix = $filename; | ||
197 | $ext = ""; | ||
198 | } | ||
199 | |||
200 | my $mcount_s = $dirname . "/.tmp_mc_" . $prefix . ".s"; | ||
201 | my $mcount_o = $dirname . "/.tmp_mc_" . $prefix . ".o"; | ||
202 | |||
203 | # | ||
204 | # --globalize-symbols came out in 2.17, we must test the version | ||
205 | # of objcopy, and if it is less than 2.17, then we can not | ||
206 | # record local functions. | ||
207 | my $use_locals = 01; | ||
208 | my $local_warn_once = 0; | ||
209 | my $found_version = 0; | ||
210 | |||
211 | open (IN, "$objcopy --version |") || die "error running $objcopy"; | ||
212 | while (<IN>) { | ||
213 | if (/objcopy.*\s(\d+)\.(\d+)/) { | ||
214 | my $major = $1; | ||
215 | my $minor = $2; | ||
216 | |||
217 | $found_version = 1; | ||
218 | if ($major < 2 || | ||
219 | ($major == 2 && $minor < 17)) { | ||
220 | $use_locals = 0; | ||
221 | } | ||
222 | last; | ||
223 | } | ||
224 | } | ||
225 | close (IN); | ||
226 | |||
227 | if (!$found_version) { | ||
228 | print STDERR "WARNING: could not find objcopy version.\n" . | ||
229 | "\tDisabling local function references.\n"; | ||
230 | } | ||
231 | |||
232 | |||
233 | # | ||
234 | # Step 1: find all the local (static functions) and weak symbols. | ||
235 | # 't' is local, 'w/W' is weak (we never use a weak function) | ||
236 | # | ||
237 | open (IN, "$nm $inputfile|") || die "error running $nm"; | ||
238 | while (<IN>) { | ||
239 | if (/^[0-9a-fA-F]+\s+t\s+(\S+)/) { | ||
240 | $locals{$1} = 1; | ||
241 | } elsif (/^[0-9a-fA-F]+\s+([wW])\s+(\S+)/) { | ||
242 | $weak{$2} = $1; | ||
243 | } | ||
244 | } | ||
245 | close(IN); | ||
246 | |||
247 | my @offsets; # Array of offsets of mcount callers | ||
248 | my $ref_func; # reference function to use for offsets | ||
249 | my $offset = 0; # offset of ref_func to section beginning | ||
250 | |||
251 | ## | ||
252 | # update_funcs - print out the current mcount callers | ||
253 | # | ||
254 | # Go through the list of offsets to callers and write them to | ||
255 | # the output file in a format that can be read by an assembler. | ||
256 | # | ||
257 | sub update_funcs | ||
258 | { | ||
259 | return if ($#offsets < 0); | ||
260 | |||
261 | defined($ref_func) || die "No function to reference"; | ||
262 | |||
263 | # A section only had a weak function, to represent it. | ||
264 | # Unfortunately, a weak function may be overwritten by another | ||
265 | # function of the same name, making all these offsets incorrect. | ||
266 | # To be safe, we simply print a warning and bail. | ||
267 | if (defined $weak{$ref_func}) { | ||
268 | print STDERR | ||
269 | "$inputfile: WARNING: referencing weak function" . | ||
270 | " $ref_func for mcount\n"; | ||
271 | return; | ||
272 | } | ||
273 | |||
274 | # is this function static? If so, note this fact. | ||
275 | if (defined $locals{$ref_func}) { | ||
276 | |||
277 | # only use locals if objcopy supports globalize-symbols | ||
278 | if (!$use_locals) { | ||
279 | return; | ||
280 | } | ||
281 | $convert{$ref_func} = 1; | ||
282 | } | ||
283 | |||
284 | # Loop through all the mcount caller offsets and print a reference | ||
285 | # to the caller based from the ref_func. | ||
286 | for (my $i=0; $i <= $#offsets; $i++) { | ||
287 | if (!$opened) { | ||
288 | open(FILE, ">$mcount_s") || die "can't create $mcount_s\n"; | ||
289 | $opened = 1; | ||
290 | print FILE "\t.section $mcount_section,\"a\",\@progbits\n"; | ||
291 | } | ||
292 | printf FILE "\t%s %s + %d\n", $type, $ref_func, $offsets[$i] - $offset; | ||
293 | } | ||
294 | } | ||
295 | |||
296 | # | ||
297 | # Step 2: find the sections and mcount call sites | ||
298 | # | ||
299 | open(IN, "$objdump -dr $inputfile|") || die "error running $objdump"; | ||
300 | |||
301 | my $text; | ||
302 | |||
303 | while (<IN>) { | ||
304 | # is it a section? | ||
305 | if (/$section_regex/) { | ||
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 | } | ||
313 | # print out any recorded offsets | ||
314 | update_funcs() if ($text_found); | ||
315 | |||
316 | # reset all markers and arrays | ||
317 | $text_found = 0; | ||
318 | undef($ref_func); | ||
319 | undef(@offsets); | ||
320 | |||
321 | # section found, now is this a start of a function? | ||
322 | } elsif ($read_function && /$function_regex/) { | ||
323 | $text_found = 1; | ||
324 | $offset = hex $1; | ||
325 | $text = $2; | ||
326 | |||
327 | # if this is either a local function or a weak function | ||
328 | # keep looking for functions that are global that | ||
329 | # we can use safely. | ||
330 | if (!defined($locals{$text}) && !defined($weak{$text})) { | ||
331 | $ref_func = $text; | ||
332 | $read_function = 0; | ||
333 | } else { | ||
334 | # if we already have a function, and this is weak, skip it | ||
335 | if (!defined($ref_func) || !defined($weak{$text})) { | ||
336 | $ref_func = $text; | ||
337 | } | ||
338 | } | ||
339 | } | ||
340 | |||
341 | # is this a call site to mcount? If so, record it to print later | ||
342 | if ($text_found && /$mcount_regex/) { | ||
343 | $offsets[$#offsets + 1] = hex $1; | ||
344 | } | ||
345 | } | ||
346 | |||
347 | # dump out anymore offsets that may have been found | ||
348 | update_funcs() if ($text_found); | ||
349 | |||
350 | # If we did not find any mcount callers, we are done (do nothing). | ||
351 | if (!$opened) { | ||
352 | exit(0); | ||
353 | } | ||
354 | |||
355 | close(FILE); | ||
356 | |||
357 | # | ||
358 | # Step 3: Compile the file that holds the list of call sites to mcount. | ||
359 | # | ||
360 | `$cc -o $mcount_o -c $mcount_s`; | ||
361 | |||
362 | my @converts = keys %convert; | ||
363 | |||
364 | # | ||
365 | # Step 4: Do we have sections that started with local functions? | ||
366 | # | ||
367 | if ($#converts >= 0) { | ||
368 | my $globallist = ""; | ||
369 | my $locallist = ""; | ||
370 | |||
371 | foreach my $con (@converts) { | ||
372 | $globallist .= " --globalize-symbol $con"; | ||
373 | $locallist .= " --localize-symbol $con"; | ||
374 | } | ||
375 | |||
376 | my $globalobj = $dirname . "/.tmp_gl_" . $filename; | ||
377 | my $globalmix = $dirname . "/.tmp_mx_" . $filename; | ||
378 | |||
379 | # | ||
380 | # Step 5: set up each local function as a global | ||
381 | # | ||
382 | `$objcopy $globallist $inputfile $globalobj`; | ||
383 | |||
384 | # | ||
385 | # Step 6: Link the global version to our list. | ||
386 | # | ||
387 | `$ld -r $globalobj $mcount_o -o $globalmix`; | ||
388 | |||
389 | # | ||
390 | # Step 7: Convert the local functions back into local symbols | ||
391 | # | ||
392 | `$objcopy $locallist $globalmix $inputfile`; | ||
393 | |||
394 | # Remove the temp files | ||
395 | `$rm $globalobj $globalmix`; | ||
396 | |||
397 | } else { | ||
398 | |||
399 | my $mix = $dirname . "/.tmp_mx_" . $filename; | ||
400 | |||
401 | # | ||
402 | # Step 8: Link the object with our list of call sites object. | ||
403 | # | ||
404 | `$ld -r $inputfile $mcount_o -o $mix`; | ||
405 | |||
406 | # | ||
407 | # Step 9: Move the result back to the original object. | ||
408 | # | ||
409 | `$mv $mix $inputfile`; | ||
410 | } | ||
411 | |||
412 | # Clean up the temp files | ||
413 | `$rm $mcount_o $mcount_s`; | ||
414 | |||
415 | exit(0); | ||
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 |