diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.fwinst | 4 | ||||
-rwxr-xr-x | scripts/checksyscalls.sh | 2 | ||||
-rw-r--r-- | scripts/coccinelle/api/memdup_user.cocci | 4 | ||||
-rw-r--r-- | scripts/kconfig/streamline_config.pl | 50 | ||||
-rw-r--r-- | scripts/recordmcount.h | 4 | ||||
-rw-r--r-- | scripts/sortextable.c | 10 |
6 files changed, 37 insertions, 37 deletions
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst index c3f69ae275d1..4d908d16c035 100644 --- a/scripts/Makefile.fwinst +++ b/scripts/Makefile.fwinst | |||
@@ -27,7 +27,7 @@ endif | |||
27 | installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) | 27 | installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) |
28 | 28 | ||
29 | installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) | 29 | installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) |
30 | installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/. | 30 | installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./ |
31 | 31 | ||
32 | # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. | 32 | # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. |
33 | PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs | 33 | PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs |
@@ -42,7 +42,7 @@ quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@) | |||
42 | $(installed-fw-dirs): | 42 | $(installed-fw-dirs): |
43 | $(call cmd,mkdir) | 43 | $(call cmd,mkdir) |
44 | 44 | ||
45 | $(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $$(dir $(INSTALL_FW_PATH)/%) | 45 | $(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %) |
46 | $(call cmd,install) | 46 | $(call cmd,install) |
47 | 47 | ||
48 | PHONY += __fw_install __fw_modinst FORCE | 48 | PHONY += __fw_install __fw_modinst FORCE |
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh index d24810fc6af6..fd8fa9aa7c4e 100755 --- a/scripts/checksyscalls.sh +++ b/scripts/checksyscalls.sh | |||
@@ -200,7 +200,7 @@ EOF | |||
200 | syscall_list() { | 200 | syscall_list() { |
201 | grep '^[0-9]' "$1" | sort -n | ( | 201 | grep '^[0-9]' "$1" | sort -n | ( |
202 | while read nr abi name entry ; do | 202 | while read nr abi name entry ; do |
203 | echo <<EOF | 203 | cat <<EOF |
204 | #if !defined(__NR_${name}) && !defined(__IGNORE_${name}) | 204 | #if !defined(__NR_${name}) && !defined(__IGNORE_${name}) |
205 | #warning syscall ${name} not implemented | 205 | #warning syscall ${name} not implemented |
206 | #endif | 206 | #endif |
diff --git a/scripts/coccinelle/api/memdup_user.cocci b/scripts/coccinelle/api/memdup_user.cocci index 2efac289fd59..2b131a8a1306 100644 --- a/scripts/coccinelle/api/memdup_user.cocci +++ b/scripts/coccinelle/api/memdup_user.cocci | |||
@@ -51,10 +51,10 @@ statement S1,S2; | |||
51 | p << r.p; | 51 | p << r.p; |
52 | @@ | 52 | @@ |
53 | 53 | ||
54 | coccilib.org.print_todo(p[0], "WARNING opportunity for memdep_user") | 54 | coccilib.org.print_todo(p[0], "WARNING opportunity for memdup_user") |
55 | 55 | ||
56 | @script:python depends on report@ | 56 | @script:python depends on report@ |
57 | p << r.p; | 57 | p << r.p; |
58 | @@ | 58 | @@ |
59 | 59 | ||
60 | coccilib.report.print_report(p[0], "WARNING opportunity for memdep_user") | 60 | coccilib.report.print_report(p[0], "WARNING opportunity for memdup_user") |
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 2fbbbc1ddea0..33689396953a 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl | |||
@@ -100,7 +100,7 @@ my @searchconfigs = ( | |||
100 | }, | 100 | }, |
101 | ); | 101 | ); |
102 | 102 | ||
103 | sub find_config { | 103 | sub read_config { |
104 | foreach my $conf (@searchconfigs) { | 104 | foreach my $conf (@searchconfigs) { |
105 | my $file = $conf->{"file"}; | 105 | my $file = $conf->{"file"}; |
106 | 106 | ||
@@ -115,17 +115,15 @@ sub find_config { | |||
115 | 115 | ||
116 | print STDERR "using config: '$file'\n"; | 116 | print STDERR "using config: '$file'\n"; |
117 | 117 | ||
118 | open(CIN, "$exec $file |") || die "Failed to run $exec $file"; | 118 | open(my $infile, '-|', "$exec $file") || die "Failed to run $exec $file"; |
119 | return; | 119 | my @x = <$infile>; |
120 | close $infile; | ||
121 | return @x; | ||
120 | } | 122 | } |
121 | die "No config file found"; | 123 | die "No config file found"; |
122 | } | 124 | } |
123 | 125 | ||
124 | find_config; | 126 | my @config_file = read_config; |
125 | |||
126 | # Read in the entire config file into config_file | ||
127 | my @config_file = <CIN>; | ||
128 | close CIN; | ||
129 | 127 | ||
130 | # Parse options | 128 | # Parse options |
131 | my $localmodconfig = 0; | 129 | my $localmodconfig = 0; |
@@ -135,7 +133,7 @@ GetOptions("localmodconfig" => \$localmodconfig, | |||
135 | "localyesconfig" => \$localyesconfig); | 133 | "localyesconfig" => \$localyesconfig); |
136 | 134 | ||
137 | # Get the build source and top level Kconfig file (passed in) | 135 | # Get the build source and top level Kconfig file (passed in) |
138 | my $ksource = $ARGV[0]; | 136 | my $ksource = ($ARGV[0] ? $ARGV[0] : '.'); |
139 | my $kconfig = $ARGV[1]; | 137 | my $kconfig = $ARGV[1]; |
140 | my $lsmod_file = $ENV{'LSMOD'}; | 138 | my $lsmod_file = $ENV{'LSMOD'}; |
141 | 139 | ||
@@ -173,8 +171,8 @@ sub read_kconfig { | |||
173 | $source =~ s/\$$env/$ENV{$env}/; | 171 | $source =~ s/\$$env/$ENV{$env}/; |
174 | } | 172 | } |
175 | 173 | ||
176 | open(KIN, "$source") || die "Can't open $kconfig"; | 174 | open(my $kinfile, '<', $source) || die "Can't open $kconfig"; |
177 | while (<KIN>) { | 175 | while (<$kinfile>) { |
178 | chomp; | 176 | chomp; |
179 | 177 | ||
180 | # Make sure that lines ending with \ continue | 178 | # Make sure that lines ending with \ continue |
@@ -251,10 +249,10 @@ sub read_kconfig { | |||
251 | $state = "NONE"; | 249 | $state = "NONE"; |
252 | } | 250 | } |
253 | } | 251 | } |
254 | close(KIN); | 252 | close($kinfile); |
255 | 253 | ||
256 | # read in any configs that were found. | 254 | # read in any configs that were found. |
257 | foreach $kconfig (@kconfigs) { | 255 | foreach my $kconfig (@kconfigs) { |
258 | if (!defined($read_kconfigs{$kconfig})) { | 256 | if (!defined($read_kconfigs{$kconfig})) { |
259 | $read_kconfigs{$kconfig} = 1; | 257 | $read_kconfigs{$kconfig} = 1; |
260 | read_kconfig($kconfig); | 258 | read_kconfig($kconfig); |
@@ -295,8 +293,8 @@ foreach my $makefile (@makefiles) { | |||
295 | my $line = ""; | 293 | my $line = ""; |
296 | my %make_vars; | 294 | my %make_vars; |
297 | 295 | ||
298 | open(MIN,$makefile) || die "Can't open $makefile"; | 296 | open(my $infile, '<', $makefile) || die "Can't open $makefile"; |
299 | while (<MIN>) { | 297 | while (<$infile>) { |
300 | # if this line ends with a backslash, continue | 298 | # if this line ends with a backslash, continue |
301 | chomp; | 299 | chomp; |
302 | if (/^(.*)\\$/) { | 300 | if (/^(.*)\\$/) { |
@@ -343,10 +341,11 @@ foreach my $makefile (@makefiles) { | |||
343 | } | 341 | } |
344 | } | 342 | } |
345 | } | 343 | } |
346 | close(MIN); | 344 | close($infile); |
347 | } | 345 | } |
348 | 346 | ||
349 | my %modules; | 347 | my %modules; |
348 | my $linfile; | ||
350 | 349 | ||
351 | if (defined($lsmod_file)) { | 350 | if (defined($lsmod_file)) { |
352 | if ( ! -f $lsmod_file) { | 351 | if ( ! -f $lsmod_file) { |
@@ -356,13 +355,10 @@ if (defined($lsmod_file)) { | |||
356 | die "$lsmod_file not found"; | 355 | die "$lsmod_file not found"; |
357 | } | 356 | } |
358 | } | 357 | } |
359 | if ( -x $lsmod_file) { | 358 | |
360 | # the file is executable, run it | 359 | my $otype = ( -x $lsmod_file) ? '-|' : '<'; |
361 | open(LIN, "$lsmod_file|"); | 360 | open($linfile, $otype, $lsmod_file); |
362 | } else { | 361 | |
363 | # Just read the contents | ||
364 | open(LIN, "$lsmod_file"); | ||
365 | } | ||
366 | } else { | 362 | } else { |
367 | 363 | ||
368 | # see what modules are loaded on this system | 364 | # see what modules are loaded on this system |
@@ -379,16 +375,16 @@ if (defined($lsmod_file)) { | |||
379 | $lsmod = "lsmod"; | 375 | $lsmod = "lsmod"; |
380 | } | 376 | } |
381 | 377 | ||
382 | open(LIN,"$lsmod|") || die "Can not call lsmod with $lsmod"; | 378 | open($linfile, '-|', $lsmod) || die "Can not call lsmod with $lsmod"; |
383 | } | 379 | } |
384 | 380 | ||
385 | while (<LIN>) { | 381 | while (<$linfile>) { |
386 | next if (/^Module/); # Skip the first line. | 382 | next if (/^Module/); # Skip the first line. |
387 | if (/^(\S+)/) { | 383 | if (/^(\S+)/) { |
388 | $modules{$1} = 1; | 384 | $modules{$1} = 1; |
389 | } | 385 | } |
390 | } | 386 | } |
391 | close (LIN); | 387 | close ($linfile); |
392 | 388 | ||
393 | # add to the configs hash all configs that are needed to enable | 389 | # add to the configs hash all configs that are needed to enable |
394 | # a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o | 390 | # a loaded module. This is a direct obj-${CONFIG_FOO} += bar.o |
@@ -605,6 +601,8 @@ foreach my $line (@config_file) { | |||
605 | if (defined($configs{$1})) { | 601 | if (defined($configs{$1})) { |
606 | if ($localyesconfig) { | 602 | if ($localyesconfig) { |
607 | $setconfigs{$1} = 'y'; | 603 | $setconfigs{$1} = 'y'; |
604 | print "$1=y\n"; | ||
605 | next; | ||
608 | } else { | 606 | } else { |
609 | $setconfigs{$1} = $2; | 607 | $setconfigs{$1} = $2; |
610 | } | 608 | } |
diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h index 54e35c1e5948..9d1421e63ff8 100644 --- a/scripts/recordmcount.h +++ b/scripts/recordmcount.h | |||
@@ -261,11 +261,13 @@ static unsigned get_mcountsym(Elf_Sym const *const sym0, | |||
261 | &sym0[Elf_r_sym(relp)]; | 261 | &sym0[Elf_r_sym(relp)]; |
262 | char const *symname = &str0[w(symp->st_name)]; | 262 | char const *symname = &str0[w(symp->st_name)]; |
263 | char const *mcount = gpfx == '_' ? "_mcount" : "mcount"; | 263 | char const *mcount = gpfx == '_' ? "_mcount" : "mcount"; |
264 | char const *fentry = "__fentry__"; | ||
264 | 265 | ||
265 | if (symname[0] == '.') | 266 | if (symname[0] == '.') |
266 | ++symname; /* ppc64 hack */ | 267 | ++symname; /* ppc64 hack */ |
267 | if (strcmp(mcount, symname) == 0 || | 268 | if (strcmp(mcount, symname) == 0 || |
268 | (altmcount && strcmp(altmcount, symname) == 0)) | 269 | (altmcount && strcmp(altmcount, symname) == 0) || |
270 | (strcmp(fentry, symname) == 0)) | ||
269 | mcountsym = Elf_r_sym(relp); | 271 | mcountsym = Elf_r_sym(relp); |
270 | 272 | ||
271 | return mcountsym; | 273 | return mcountsym; |
diff --git a/scripts/sortextable.c b/scripts/sortextable.c index 6acf83449105..f19ddc47304c 100644 --- a/scripts/sortextable.c +++ b/scripts/sortextable.c | |||
@@ -161,7 +161,7 @@ typedef void (*table_sort_t)(char *, int); | |||
161 | #define SORTEXTABLE_64 | 161 | #define SORTEXTABLE_64 |
162 | #include "sortextable.h" | 162 | #include "sortextable.h" |
163 | 163 | ||
164 | static int compare_x86_table(const void *a, const void *b) | 164 | static int compare_relative_table(const void *a, const void *b) |
165 | { | 165 | { |
166 | int32_t av = (int32_t)r(a); | 166 | int32_t av = (int32_t)r(a); |
167 | int32_t bv = (int32_t)r(b); | 167 | int32_t bv = (int32_t)r(b); |
@@ -173,7 +173,7 @@ static int compare_x86_table(const void *a, const void *b) | |||
173 | return 0; | 173 | return 0; |
174 | } | 174 | } |
175 | 175 | ||
176 | static void sort_x86_table(char *extab_image, int image_size) | 176 | static void sort_relative_table(char *extab_image, int image_size) |
177 | { | 177 | { |
178 | int i; | 178 | int i; |
179 | 179 | ||
@@ -188,7 +188,7 @@ static void sort_x86_table(char *extab_image, int image_size) | |||
188 | i += 4; | 188 | i += 4; |
189 | } | 189 | } |
190 | 190 | ||
191 | qsort(extab_image, image_size / 8, 8, compare_x86_table); | 191 | qsort(extab_image, image_size / 8, 8, compare_relative_table); |
192 | 192 | ||
193 | /* Now denormalize. */ | 193 | /* Now denormalize. */ |
194 | i = 0; | 194 | i = 0; |
@@ -245,9 +245,9 @@ do_file(char const *const fname) | |||
245 | break; | 245 | break; |
246 | case EM_386: | 246 | case EM_386: |
247 | case EM_X86_64: | 247 | case EM_X86_64: |
248 | custom_sort = sort_x86_table; | ||
249 | break; | ||
250 | case EM_S390: | 248 | case EM_S390: |
249 | custom_sort = sort_relative_table; | ||
250 | break; | ||
251 | case EM_MIPS: | 251 | case EM_MIPS: |
252 | break; | 252 | break; |
253 | } /* end switch */ | 253 | } /* end switch */ |