History

Merge commit 'v3.0-rc1' into kbuild/kbuild

Michal Marek committed 15 years ago

Commit 2e483522 parents 163d3fe 55922c99467 files · +477775 −392439Browse files

Showing the changes to scripts (33 of 9467 files). Show all

Unified · Split

33 files
  1. scripts/Makefile.build +9 −3
  2. scripts/Makefile.modpost +2 −2
  3. scripts/checkpatch.pl +12 −7
  4. scripts/checkstack.pl +1 −1
  5. scripts/checkversion.pl +1 −0
  6. scripts/dtc/libfdt/libfdt.h +1 −1
  7. scripts/dtc/livetree.c +1 −1
  8. scripts/export_report.pl +20 −6
  9. scripts/gen_initramfs_list.sh +1 −1
  10. scripts/kconfig/Makefile +23 −15
  11. scripts/kconfig/conf.c +1 −1
  12. scripts/kconfig/confdata.c +3 −17
  13. scripts/kconfig/expr.h +0 −4
  14. scripts/kconfig/gconf.c +8 −4
  15. scripts/kconfig/lex.zconf.c_shipped +19 −14
  16. scripts/kconfig/nconf.c +7 −7
  17. scripts/kconfig/qconf.cc +2 −3
  18. scripts/kconfig/zconf.l +19 −14
  19. scripts/kernel-doc +1 −1
  20. scripts/mod/file2alias.c +22 −0
  21. scripts/mod/modpost.c +6 −10
  22. scripts/mod/modpost.h +8 −19
  23. scripts/module-common.lds +11 −0
  24. scripts/package/Makefile +2 −2
  25. scripts/package/buildtar +1 −1
  26. scripts/package/mkspec +18 −1
  27. scripts/patch-kernel +1 −1
  28. scripts/recordmcount.c +114 −54
  29. scripts/recordmcount.h +146 −36
  30. scripts/recordmcount.pl +5 −0
  31. scripts/rt-tester/rt-tester.py +1 −1
  32. scripts/selinux/README +1 −1
  33. scripts/tags.sh +4 −2
scripts/Makefile.build+9−3
@@ -260,14 +260,19 @@ endif · 259 unmodified lines
260260
261261 ifdef CONFIG_FTRACE_MCOUNT_RECORD
262262 ifdef BUILD_C_RECORDMCOUNT
263+ifeq ("$(origin RECORDMCOUNT_WARN)", "command line")
264+ RECORDMCOUNT_FLAGS = -w
265+endif
263266 # Due to recursion, we must skip empty.o.
264267 # The empty.o file is created in the make process in order to determine
265268 # the target endianness and word size. It is made before all other C
266269 # files, including recordmcount.
267270 sub_cmd_record_mcount = \
268271 if [ $(@) != "scripts/mod/empty.o" ]; then \
269− $(objtree)/scripts/recordmcount "$(@)"; \
272+ $(objtree)/scripts/recordmcount $(RECORDMCOUNT_FLAGS) "$(@)"; \
270273 fi;
274+recordmcount_source := $(srctree)/scripts/recordmcount.c \
275+ $(srctree)/scripts/recordmcount.h
271276 else
272277 sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
273278 "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \
@@ -275,6 +280,7 @@ sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH · 1 unmodified line
275280 "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \
276281 "$(LD)" "$(NM)" "$(RM)" "$(MV)" \
277282 "$(if $(part-of-module),1,0)" "$(@)";
283+recordmcount_source := $(srctree)/scripts/recordmcount.pl
278284 endif
279285 cmd_record_mcount = \
280286 if [ "$(findstring -pg,$(_c_flags))" = "-pg" ]; then \
@@ -295,13 +301,13 @@ define rule_cc_o_c · 14 unmodified lines
295301 endef
296302
297303 # Built-in and composite module parts
298−$(obj)/%.o: $(src)/%.c FORCE
304+$(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE
299305 $(call cmd,force_checksrc)
300306 $(call if_changed_rule,cc_o_c)
301307
302308 # Single-part modules are special since we need to mark them in $(MODVERDIR)
303309
304−$(single-used-m): $(obj)/%.o: $(src)/%.c FORCE
310+$(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE
305311 $(call cmd,force_checksrc)
306312 $(call if_changed_rule,cc_o_c)
307313 @{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod)
scripts/Makefile.modpost+2−2
@@ -35,14 +35,14 @@ · 34 unmodified lines
3535 # KBUILD_MODPOST_WARN can be set to avoid error out in case of undefined
3636 # symbols in the final module linking stage
3737 # KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
38−# This is solely usefull to speed up test compiles
38+# This is solely useful to speed up test compiles
3939 PHONY := _modpost
4040 _modpost: __modpost
4141
4242 include include/config/auto.conf
4343 include scripts/Kbuild.include
4444
45−# When building external modules load the Kbuild file to retreive EXTRA_SYMBOLS info
45+# When building external modules load the Kbuild file to retrieve EXTRA_SYMBOLS info
4646 ifneq ($(KBUILD_EXTMOD),)
4747
4848 # set src + obj - they may be used when building the .mod.c file
scripts/checkpatch.pl+12−7
@@ -210,10 +210,10 @@ our $typeTypedefs = qr{(?x: · 209 unmodified lines
210210
211211 our $logFunctions = qr{(?x:
212212 printk|
213− pr_(debug|dbg|vdbg|devel|info|warning|err|notice|alert|crit|emerg|cont)|
214− (dev|netdev|netif)_(printk|dbg|vdbg|info|warn|err|notice|alert|crit|emerg|WARN)|
213+ [a-z]+_(emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)|
215214 WARN|
216− panic
215+ panic|
216+ MODULE_[A-Z_]+
217217 )};
218218
219219 our @typeList = (
@@ -1462,7 +1462,7 @@ sub process { · 1242 unmodified lines
14621462 #80 column limit
14631463 if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
14641464 $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
1465− !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ ||
1465+ !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?"[X\t]*"\s*(?:|,|\)\s*;)\s*$/ ||
14661466 $line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) &&
14671467 $length > 80)
14681468 {
@@ -1946,13 +1946,13 @@ sub process { · 477 unmodified lines
19461946 # printk should use KERN_* levels. Note that follow on printk's on the
19471947 # same line do not need a level, so we use the current block context
19481948 # to try and find and validate the current printk. In summary the current
1949−# printk includes all preceeding printk's which have no newline on the end.
1949+# printk includes all preceding printk's which have no newline on the end.
19501950 # we assume the first bad printk is the one to report.
19511951 if ($line =~ /\bprintk\((?!KERN_)\s*"/) {
19521952 my $ok = 0;
19531953 for (my $ln = $linenr - 1; $ln >= $first_line; $ln--) {
19541954 #print "CHECK<$lines[$ln - 1]\n";
1955− # we have a preceeding printk if it ends
1955+ # we have a preceding printk if it ends
19561956 # with "\n" ignore it, else it is to blame
19571957 if ($lines[$ln - 1] =~ m{\bprintk\(}) {
19581958 if ($rawlines[$ln - 1] !~ m{\\n"}) {
@@ -2044,7 +2044,7 @@ sub process { · 85 unmodified lines
20442044 for (my $n = 0; $n < $#elements; $n += 2) {
20452045 $off += length($elements[$n]);
20462046
2047− # Pick up the preceeding and succeeding characters.
2047+ # Pick up the preceding and succeeding characters.
20482048 my $ca = substr($opline, 0, $off);
20492049 my $cc = '';
20502050 if (length($opline) >= ($off + length($elements[$n + 1]))) {
@@ -2748,6 +2748,11 @@ sub process { · 697 unmodified lines
27482748 WARN("sizeof(& should be avoided\n" . $herecurr);
27492749 }
27502750
2751+# check for line continuations in quoted strings with odd counts of "
2752+ if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) {
2753+ WARN("Avoid line continuations in quoted strings\n" . $herecurr);
2754+ }
2755+
27512756 # check for new externs in .c files.
27522757 if ($realfile =~ /\.c$/ && defined $stat &&
27532758 $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s)
scripts/checkstack.pl+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 # sh64 port by Paul Mundt
1313 # Random bits by Matt Mackall <mpm@selenic.com>
1414 # M68k port by Geert Uytterhoeven and Andreas Schwab
15−# AVR32 port by Haavard Skinnemoen <hskinnemoen@atmel.com>
15+# AVR32 port by Haavard Skinnemoen (Atmel)
1616 # PARISC port by Kyle McMartin <kyle@parisc-linux.org>
1717 # sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
1818 #
scripts/checkversion.pl+1−0
@@ -12,6 +12,7 @@ $| = 1; · 11 unmodified lines
1212 my $debugging;
1313
1414 foreach my $file (@ARGV) {
15+ next if $file =~ "include/linux/version\.h";
1516 # Open this file.
1617 open( my $f, '<', $file )
1718 or die "Can't open $file: $!\n";
scripts/dtc/libfdt/libfdt.h+1−1
@@ -61,7 +61,7 @@ · 60 unmodified lines
6161 #define FDT_ERR_NOTFOUND 1
6262 /* FDT_ERR_NOTFOUND: The requested node or property does not exist */
6363 #define FDT_ERR_EXISTS 2
64− /* FDT_ERR_EXISTS: Attemped to create a node or property which
64+ /* FDT_ERR_EXISTS: Attempted to create a node or property which
6565 * already exists */
6666 #define FDT_ERR_NOSPACE 3
6767 /* FDT_ERR_NOSPACE: Operation needed to expand the device
scripts/dtc/livetree.c+1−1
@@ -155,7 +155,7 @@ struct node *merge_nodes(struct node *old_node, struct node *new_node) · 154 unmodified lines
155155 }
156156 }
157157
158− /* if no collision occured, add child to the old node. */
158+ /* if no collision occurred, add child to the old node. */
159159 if (new_child)
160160 add_child(old_node, new_child);
161161 }
scripts/export_report.pl+20−6
@@ -25,11 +25,12 @@ sub alphabetically { · 24 unmodified lines
2525 sub print_depends_on {
2626 my ($href) = @_;
2727 print "\n";
28− while (my ($mod, $list) = each %$href) {
28+ for my $mod (sort keys %$href) {
29+ my $list = $href->{$mod};
2930 print "\t$mod:\n";
3031 foreach my $sym (sort numerically @{$list}) {
3132 my ($symbol, $no) = split /\s+/, $sym;
32− printf("\t\t%-25s\t%-25d\n", $symbol, $no);
33+ printf("\t\t%-25s\n", $symbol);
3334 }
3435 print "\n";
3536 }
@@ -49,8 +50,14 @@ sub usage { · 13 unmodified lines
4950 }
5051
5152 sub collectcfiles {
52− my @file
53− = `cat .tmp_versions/*.mod | grep '.*\.ko\$' | sed s/\.ko$/.mod.c/`;
53+ my @file;
54+ while (<.tmp_versions/*.mod>) {
55+ open my $fh, '<', $_ or die "cannot open $_: $!\n";
56+ push (@file,
57+ grep s/\.ko/.mod.c/, # change the suffix
58+ grep m/.+\.ko/, # find the .ko path
59+ <$fh>); # lines in opened file
60+ }
5461 chomp @file;
5562 return @file;
5663 }
@@ -95,6 +102,8 @@ close($module_symvers); · 38 unmodified lines
95102 #
96103 # collect the usage count of each symbol.
97104 #
105+my $modversion_warnings = 0;
106+
98107 foreach my $thismod (@allcfiles) {
99108 my $module;
100109
@@ -125,7 +134,8 @@ foreach my $thismod (@allcfiles) { · 24 unmodified lines
125134 }
126135 }
127136 if ($state != 2) {
128− print "WARNING:$thismod is not built with CONFIG_MODVERSION enabled\n";
137+ warn "WARNING:$thismod is not built with CONFIG_MODVERSIONS enabled\n";
138+ $modversion_warnings++;
129139 }
130140 close($module);
131141 }
@@ -159,8 +169,12 @@ printf("SECTION 2:\n\tThis section reports export-symbol-usage of in-kernel · 27 unmodified lines
159169 modules. Each module lists the modules, and the symbols from that module that
160170 it uses. Each listed symbol reports the number of modules using it\n");
161171
172+print "\nNOTE: Got $modversion_warnings CONFIG_MODVERSIONS warnings\n\n"
173+ if $modversion_warnings;
174+
162175 print "~"x80 , "\n";
163−while (my ($thismod, $list) = each %MODULE) {
176+for my $thismod (sort keys %MODULE) {
177+ my $list = $MODULE{$thismod};
164178 my %depends;
165179 $thismod =~ s/\.mod\.c/.ko/;
166180 print "\t\t\t$thismod\n";
scripts/gen_initramfs_list.sh+1−1
@@ -284,7 +284,7 @@ while [ $# -gt 0 ]; do · 283 unmodified lines
284284 done
285285
286286 # If output_file is set we will generate cpio archive and compress it
287−# we are carefull to delete tmp files
287+# we are careful to delete tmp files
288288 if [ ! -z ${output_file} ]; then
289289 if [ -z ${cpio_file} ]; then
290290 timestamp=
scripts/kconfig/Makefile+23−15
@@ -77,14 +77,15 @@ localyesconfig: $(obj)/streamline_config.pl $(obj)/conf · 76 unmodified lines
7777 # The symlink is used to repair a deficiency in arch/um
7878 update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
7979 $(Q)echo " GEN config"
80− $(Q)xgettext --default-domain=linux \
81− --add-comments --keyword=_ --keyword=N_ \
82− --from-code=UTF-8 \
83− --files-from=scripts/kconfig/POTFILES.in \
80+ $(Q)xgettext --default-domain=linux \
81+ --add-comments --keyword=_ --keyword=N_ \
82+ --from-code=UTF-8 \
83+ --files-from=$(srctree)/scripts/kconfig/POTFILES.in \
84+ --directory=$(srctree) --directory=$(objtree) \
8485 --output $(obj)/config.pot
8586 $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
86− $(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch
87− $(Q)(for i in `ls arch/*/Kconfig`; \
87+ $(Q)ln -fs Kconfig.x86 arch/um/Kconfig
88+ $(Q)(for i in `ls $(srctree)/arch/*/Kconfig`; \
8889 do \
8990 echo " GEN $$i"; \
9091 $(obj)/kxgettext $$i \
@@ -92,7 +93,7 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h · 1 unmodified line
9293 done )
9394 $(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
9495 --output $(obj)/linux.pot
95− $(Q)rm -f arch/um/Kconfig.arch
96+ $(Q)rm -f $(srctree)/arch/um/Kconfig
9697 $(Q)rm -f $(obj)/config.pot
9798
9899 PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
@@ -168,8 +169,11 @@ conf-objs := conf.o zconf.tab.o · 69 unmodified lines
168169 mconf-objs := mconf.o zconf.tab.o $(lxdialog)
169170 nconf-objs := nconf.o zconf.tab.o nconf.gui.o
170171 kxgettext-objs := kxgettext.o zconf.tab.o
172+qconf-cxxobjs := qconf.o
173+qconf-objs := kconfig_load.o zconf.tab.o
174+gconf-objs := gconf.o kconfig_load.o zconf.tab.o
171175
172−hostprogs-y := conf qconf gconf kxgettext
176+hostprogs-y := conf
173177
174178 ifeq ($(MAKECMDGOALS),nconfig)
175179 hostprogs-y += nconf
@@ -179,6 +183,10 @@ ifeq ($(MAKECMDGOALS),menuconfig) · 3 unmodified lines
179183 hostprogs-y += mconf
180184 endif
181185
186+ifeq ($(MAKECMDGOALS),update-po-config)
187+ hostprogs-y += kxgettext
188+endif
189+
182190 ifeq ($(MAKECMDGOALS),xconfig)
183191 qconf-target := 1
184192 endif
@@ -188,16 +196,15 @@ endif · 3 unmodified lines
188196
189197
190198 ifeq ($(qconf-target),1)
191−qconf-cxxobjs := qconf.o
192−qconf-objs := kconfig_load.o zconf.tab.o
199+ hostprogs-y += qconf
193200 endif
194201
195202 ifeq ($(gconf-target),1)
196−gconf-objs := gconf.o kconfig_load.o zconf.tab.o
203+ hostprogs-y += gconf
197204 endif
198205
199−clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \
200− .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
206+clean-files := lkc_defs.h qconf.moc .tmp_qtcheck .tmp_gtkcheck
207+clean-files += zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
201208 clean-files += mconf qconf gconf nconf
202209 clean-files += config.pot linux.pot
203210
@@ -321,11 +328,12 @@ $(obj)/%.moc: $(src)/%.h · 117 unmodified lines
321328 $(KC_QT_MOC) -i $< -o $@
322329
323330 $(obj)/lkc_defs.h: $(src)/lkc_proto.h
324− sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
331+ $(Q)sed < $< > $@ 's/P(\([^,]*\),.*/#define \1 (\*\1_p)/'
325332
326333 # Extract gconf menu items for I18N support
327334 $(obj)/gconf.glade.h: $(obj)/gconf.glade
328− intltool-extract --type=gettext/glade $(obj)/gconf.glade
335+ $(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
336+ $(obj)/gconf.glade
329337
330338 ###
331339 # The following requires flex/bison/gperf
scripts/kconfig/conf.c+1−1
@@ -332,7 +332,7 @@ static int conf_choice(struct menu *menu) · 331 unmodified lines
332332 }
333333 if (!child)
334334 continue;
335− if (line[strlen(line) - 1] == '?') {
335+ if (line[0] && line[strlen(line) - 1] == '?') {
336336 print_help(child);
337337 continue;
338338 }
scripts/kconfig/confdata.c+3−17
@@ -560,8 +560,6 @@ int conf_write(const char *name) · 559 unmodified lines
560560 const char *basename;
561561 const char *str;
562562 char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1];
563− time_t now;
564− int use_timestamp = 1;
565563 char *env;
566564
567565 dirname[0] = 0;
@@ -598,19 +596,11 @@ int conf_write(const char *name) · 30 unmodified lines
598596 if (!out)
599597 return 1;
600598
601− time(&now);
602− env = getenv("KCONFIG_NOTIMESTAMP");
603− if (env && *env)
604− use_timestamp = 0;
605−
606599 fprintf(out, _("#\n"
607600 "# Automatically generated make config: don't edit\n"
608601 "# %s\n"
609− "%s%s"
610602 "#\n"),
611− rootmenu.prompt->text,
612− use_timestamp ? "# " : "",
613− use_timestamp ? ctime(&now) : "");
603+ rootmenu.prompt->text);
614604
615605 if (!conf_get_changed())
616606 sym_clear_all_valid();
@@ -784,7 +774,6 @@ int conf_write_autoconf(void) · 167 unmodified lines
784774 const char *str;
785775 const char *name;
786776 FILE *out, *tristate, *out_h;
787− time_t now;
788777 int i;
789778
790779 sym_clear_all_valid();
@@ -811,22 +800,19 @@ int conf_write_autoconf(void) · 20 unmodified lines
811800 return 1;
812801 }
813802
814− time(&now);
815803 fprintf(out, "#\n"
816804 "# Automatically generated make config: don't edit\n"
817805 "# %s\n"
818− "# %s"
819806 "#\n",
820− rootmenu.prompt->text, ctime(&now));
807+ rootmenu.prompt->text);
821808 fprintf(tristate, "#\n"
822809 "# Automatically generated - do not edit\n"
823810 "\n");
824811 fprintf(out_h, "/*\n"
825812 " * Automatically generated C config: don't edit\n"
826813 " * %s\n"
827− " * %s"
828814 " */\n",
829− rootmenu.prompt->text, ctime(&now));
815+ rootmenu.prompt->text);
830816
831817 for_all_symbols(i, sym) {
832818 sym_calc_value(sym);
scripts/kconfig/expr.h+0−4
@@ -20,12 +20,8 @@ struct file { · 19 unmodified lines
2020 struct file *parent;
2121 const char *name;
2222 int lineno;
23− int flags;
2423 };
2524
26−#define FILE_BUSY 0x0001
27−#define FILE_SCANNED 0x0002
28−
2925 typedef enum tristate {
3026 no, mod, yes
3127 } tristate;
scripts/kconfig/gconf.c+8−4
@@ -253,7 +253,7 @@ void init_left_tree(void) · 252 unmodified lines
253253
254254 gtk_tree_view_set_model(view, model1);
255255 gtk_tree_view_set_headers_visible(view, TRUE);
256− gtk_tree_view_set_rules_hint(view, FALSE);
256+ gtk_tree_view_set_rules_hint(view, TRUE);
257257
258258 column = gtk_tree_view_column_new();
259259 gtk_tree_view_append_column(view, column);
@@ -298,7 +298,7 @@ void init_right_tree(void) · 38 unmodified lines
298298
299299 gtk_tree_view_set_model(view, model2);
300300 gtk_tree_view_set_headers_visible(view, TRUE);
301− gtk_tree_view_set_rules_hint(view, FALSE);
301+ gtk_tree_view_set_rules_hint(view, TRUE);
302302
303303 column = gtk_tree_view_column_new();
304304 gtk_tree_view_append_column(view, column);
@@ -756,7 +756,6 @@ void on_load_clicked(GtkButton * button, gpointer user_data) · 451 unmodified lines
756756 void on_single_clicked(GtkButton * button, gpointer user_data)
757757 {
758758 view_mode = SINGLE_VIEW;
759− gtk_paned_set_position(GTK_PANED(hpaned), 0);
760759 gtk_widget_hide(tree1_w);
761760 current = &rootmenu;
762761 display_tree_part();
@@ -782,7 +781,6 @@ void on_split_clicked(GtkButton * button, gpointer user_data) · 19 unmodified lines
782781 void on_full_clicked(GtkButton * button, gpointer user_data)
783782 {
784783 view_mode = FULL_VIEW;
785− gtk_paned_set_position(GTK_PANED(hpaned), 0);
786784 gtk_widget_hide(tree1_w);
787785 if (tree2)
788786 gtk_tree_store_clear(tree2);
@@ -1444,6 +1442,12 @@ static void display_tree(struct menu *menu) · 655 unmodified lines
14441442 if (((menu != &rootmenu) && !(menu->flags & MENU_ROOT))
14451443 || (view_mode == FULL_VIEW)
14461444 || (view_mode == SPLIT_VIEW))*/
1445+
1446+ /* Change paned position if the view is not in 'split mode' */
1447+ if (view_mode == SINGLE_VIEW || view_mode == FULL_VIEW) {
1448+ gtk_paned_set_position(GTK_PANED(hpaned), 0);
1449+ }
1450+
14471451 if (((view_mode == SINGLE_VIEW) && (menu->flags & MENU_ROOT))
14481452 || (view_mode == FULL_VIEW)
14491453 || (view_mode == SPLIT_VIEW)) {
scripts/kconfig/lex.zconf.c_shipped+19−14
@@ -2363,11 +2363,11 @@ void zconf_initscan(const char *name) · 2362 unmodified lines
23632363
23642364 current_file = file_lookup(name);
23652365 current_file->lineno = 1;
2366− current_file->flags = FILE_BUSY;
23672366 }
23682367
23692368 void zconf_nextfile(const char *name)
23702369 {
2370+ struct file *iter;
23712371 struct file *file = file_lookup(name);
23722372 struct buffer *buf = malloc(sizeof(*buf));
23732373 memset(buf, 0, sizeof(*buf));
@@ -2383,18 +2383,25 @@ void zconf_nextfile(const char *name) · 9 unmodified lines
23832383 buf->parent = current_buf;
23842384 current_buf = buf;
23852385
2386− if (file->flags & FILE_BUSY) {
2387− printf("%s:%d: do not source '%s' from itself\n",
2388− zconf_curname(), zconf_lineno(), name);
2389− exit(1);
2390− }
2391− if (file->flags & FILE_SCANNED) {
2392− printf("%s:%d: file '%s' is already sourced from '%s'\n",
2393− zconf_curname(), zconf_lineno(), name,
2394− file->parent->name);
2395− exit(1);
2386+ for (iter = current_file->parent; iter; iter = iter->parent ) {
2387+ if (!strcmp(current_file->name,iter->name) ) {
2388+ printf("%s:%d: recursive inclusion detected. "
2389+ "Inclusion path:\n current file : '%s'\n",
2390+ zconf_curname(), zconf_lineno(),
2391+ zconf_curname());
2392+ iter = current_file->parent;
2393+ while (iter && \
2394+ strcmp(iter->name,current_file->name)) {
2395+ printf(" included from: '%s:%d'\n",
2396+ iter->name, iter->lineno-1);
2397+ iter = iter->parent;
2398+ }
2399+ if (iter)
2400+ printf(" included from: '%s:%d'\n",
2401+ iter->name, iter->lineno+1);
2402+ exit(1);
2403+ }
23962404 }
2397− file->flags |= FILE_BUSY;
23982405 file->lineno = 1;
23992406 file->parent = current_file;
24002407 current_file = file;
@@ -2404,8 +2411,6 @@ static void zconf_endfile(void) · 3 unmodified lines
24042411 {
24052412 struct buffer *parent;
24062413
2407− current_file->flags |= FILE_SCANNED;
2408− current_file->flags &= ~FILE_BUSY;
24092414 current_file = current_file->parent;
24102415
24112416 parent = current_buf->parent;
scripts/kconfig/nconf.c+7−7
@@ -373,18 +373,18 @@ static void print_function_line(void) · 372 unmodified lines
373373 const int skip = 1;
374374
375375 for (i = 0; i < function_keys_num; i++) {
376− wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]);
376+ (void) wattrset(main_window, attributes[FUNCTION_HIGHLIGHT]);
377377 mvwprintw(main_window, LINES-3, offset,
378378 "%s",
379379 function_keys[i].key_str);
380− wattrset(main_window, attributes[FUNCTION_TEXT]);
380+ (void) wattrset(main_window, attributes[FUNCTION_TEXT]);
381381 offset += strlen(function_keys[i].key_str);
382382 mvwprintw(main_window, LINES-3,
383383 offset, "%s",
384384 function_keys[i].func);
385385 offset += strlen(function_keys[i].func) + skip;
386386 }
387− wattrset(main_window, attributes[NORMAL]);
387+ (void) wattrset(main_window, attributes[NORMAL]);
388388 }
389389
390390 /* help */
@@ -953,16 +953,16 @@ static void show_menu(const char *prompt, const char *instructions, · 562 unmodified lines
953953 current_instructions = instructions;
954954
955955 clear();
956− wattrset(main_window, attributes[NORMAL]);
956+ (void) wattrset(main_window, attributes[NORMAL]);
957957 print_in_middle(stdscr, 1, 0, COLS,
958958 menu_backtitle,
959959 attributes[MAIN_HEADING]);
960960
961− wattrset(main_window, attributes[MAIN_MENU_BOX]);
961+ (void) wattrset(main_window, attributes[MAIN_MENU_BOX]);
962962 box(main_window, 0, 0);
963− wattrset(main_window, attributes[MAIN_MENU_HEADING]);
963+ (void) wattrset(main_window, attributes[MAIN_MENU_HEADING]);
964964 mvwprintw(main_window, 0, 3, " %s ", prompt);
965− wattrset(main_window, attributes[NORMAL]);
965+ (void) wattrset(main_window, attributes[NORMAL]);
966966
967967 set_menu_items(curses_menu, curses_menu_items);
968968
scripts/kconfig/qconf.cc+2−3
@@ -1489,8 +1489,7 @@ void ConfigMainWindow::saveConfigAs(void) · 1488 unmodified lines
14891489 QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this);
14901490 if (s.isNull())
14911491 return;
1492− if (conf_write(QFile::encodeName(s)))
1493− QMessageBox::information(this, "qconf", _("Unable to save configuration!"));
1492+ saveConfig();
14941493 }
14951494
14961495 void ConfigMainWindow::searchConfig(void)
@@ -1643,7 +1642,7 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e) · 146 unmodified lines
16431642 mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit"));
16441643 switch (mb.exec()) {
16451644 case QMessageBox::Yes:
1646− conf_write(NULL);
1645+ saveConfig();
16471646 case QMessageBox::No:
16481647 e->accept();
16491648 break;
scripts/kconfig/zconf.l+19−14
@@ -294,11 +294,11 @@ void zconf_initscan(const char *name) · 293 unmodified lines
294294
295295 current_file = file_lookup(name);
296296 current_file->lineno = 1;
297− current_file->flags = FILE_BUSY;
298297 }
299298
300299 void zconf_nextfile(const char *name)
301300 {
301+ struct file *iter;
302302 struct file *file = file_lookup(name);
303303 struct buffer *buf = malloc(sizeof(*buf));
304304 memset(buf, 0, sizeof(*buf));
@@ -314,18 +314,25 @@ void zconf_nextfile(const char *name) · 9 unmodified lines
314314 buf->parent = current_buf;
315315 current_buf = buf;
316316
317− if (file->flags & FILE_BUSY) {
318− printf("%s:%d: do not source '%s' from itself\n",
319− zconf_curname(), zconf_lineno(), name);
320− exit(1);
321− }
322− if (file->flags & FILE_SCANNED) {
323− printf("%s:%d: file '%s' is already sourced from '%s'\n",
324− zconf_curname(), zconf_lineno(), name,
325− file->parent->name);
326− exit(1);
317+ for (iter = current_file->parent; iter; iter = iter->parent ) {
318+ if (!strcmp(current_file->name,iter->name) ) {
319+ printf("%s:%d: recursive inclusion detected. "
320+ "Inclusion path:\n current file : '%s'\n",
321+ zconf_curname(), zconf_lineno(),
322+ zconf_curname());
323+ iter = current_file->parent;
324+ while (iter && \
325+ strcmp(iter->name,current_file->name)) {
326+ printf(" included from: '%s:%d'\n",
327+ iter->name, iter->lineno-1);
328+ iter = iter->parent;
329+ }
330+ if (iter)
331+ printf(" included from: '%s:%d'\n",
332+ iter->name, iter->lineno+1);
333+ exit(1);
334+ }
327335 }
328− file->flags |= FILE_BUSY;
329336 file->lineno = 1;
330337 file->parent = current_file;
331338 current_file = file;
@@ -335,8 +342,6 @@ static void zconf_endfile(void) · 3 unmodified lines
335342 {
336343 struct buffer *parent;
337344
338− current_file->flags |= FILE_SCANNED;
339− current_file->flags &= ~FILE_BUSY;
340345 current_file = current_file->parent;
341346
342347 parent = current_buf->parent;
scripts/kernel-doc+1−1
@@ -1705,7 +1705,7 @@ sub push_parameter($$$) { · 1704 unmodified lines
17051705
17061706 $param = xml_escape($param);
17071707
1708− # strip spaces from $param so that it is one continous string
1708+ # strip spaces from $param so that it is one continuous string
17091709 # on @parameterlist;
17101710 # this fixes a problem where check_sections() cannot find
17111711 # a parameter like "addr[6 + 2]" because it actually appears
scripts/mod/file2alias.c+22−0
@@ -702,6 +702,24 @@ static int do_ssb_entry(const char *filename, · 701 unmodified lines
702702 return 1;
703703 }
704704
705+/* Looks like: bcma:mNidNrevNclN. */
706+static int do_bcma_entry(const char *filename,
707+ struct bcma_device_id *id, char *alias)
708+{
709+ id->manuf = TO_NATIVE(id->manuf);
710+ id->id = TO_NATIVE(id->id);
711+ id->rev = TO_NATIVE(id->rev);
712+ id->class = TO_NATIVE(id->class);
713+
714+ strcpy(alias, "bcma:");
715+ ADD(alias, "m", id->manuf != BCMA_ANY_MANUF, id->manuf);
716+ ADD(alias, "id", id->id != BCMA_ANY_ID, id->id);
717+ ADD(alias, "rev", id->rev != BCMA_ANY_REV, id->rev);
718+ ADD(alias, "cl", id->class != BCMA_ANY_CLASS, id->class);
719+ add_wildcard(alias);
720+ return 1;
721+}
722+
705723 /* Looks like: virtio:dNvN */
706724 static int do_virtio_entry(const char *filename, struct virtio_device_id *id,
707725 char *alias)
@@ -968,6 +986,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, · 260 unmodified lines
968986 do_table(symval, sym->st_size,
969987 sizeof(struct ssb_device_id), "ssb",
970988 do_ssb_entry, mod);
989+ else if (sym_is(symname, "__mod_bcma_device_table"))
990+ do_table(symval, sym->st_size,
991+ sizeof(struct bcma_device_id), "bcma",
992+ do_bcma_entry, mod);
971993 else if (sym_is(symname, "__mod_virtio_device_table"))
972994 do_table(symval, sym->st_size,
973995 sizeof(struct virtio_device_id), "virtio",
scripts/mod/modpost.c+6−10
@@ -420,11 +420,10 @@ static int parse_elf(struct elf_info *info, const char *filename) · 419 unmodified lines
420420 return 0;
421421 }
422422
423− if (hdr->e_shnum == 0) {
423+ if (hdr->e_shnum == SHN_UNDEF) {
424424 /*
425425 * There are more than 64k sections,
426426 * read count from .sh_size.
427− * note: it doesn't need shndx2secindex()
428427 */
429428 info->num_sections = TO_NATIVE(sechdrs[0].sh_size);
430429 }
@@ -432,8 +431,7 @@ static int parse_elf(struct elf_info *info, const char *filename) · 1 unmodified line
432431 info->num_sections = hdr->e_shnum;
433432 }
434433 if (hdr->e_shstrndx == SHN_XINDEX) {
435− info->secindex_strings =
436− shndx2secindex(TO_NATIVE(sechdrs[0].sh_link));
434+ info->secindex_strings = TO_NATIVE(sechdrs[0].sh_link);
437435 }
438436 else {
439437 info->secindex_strings = hdr->e_shstrndx;
@@ -489,7 +487,7 @@ static int parse_elf(struct elf_info *info, const char *filename) · 49 unmodified lines
489487 sechdrs[i].sh_offset;
490488 info->symtab_stop = (void *)hdr +
491489 sechdrs[i].sh_offset + sechdrs[i].sh_size;
492− sh_link_idx = shndx2secindex(sechdrs[i].sh_link);
490+ sh_link_idx = sechdrs[i].sh_link;
493491 info->strtab = (void *)hdr +
494492 sechdrs[sh_link_idx].sh_offset;
495493 }
@@ -516,11 +514,9 @@ static int parse_elf(struct elf_info *info, const char *filename) · 20 unmodified lines
516514
517515 if (symtab_shndx_idx != ~0U) {
518516 Elf32_Word *p;
519− if (symtab_idx !=
520− shndx2secindex(sechdrs[symtab_shndx_idx].sh_link))
517+ if (symtab_idx != sechdrs[symtab_shndx_idx].sh_link)
521518 fatal("%s: SYMTAB_SHNDX has bad sh_link: %u!=%u\n",
522− filename,
523− shndx2secindex(sechdrs[symtab_shndx_idx].sh_link),
519+ filename, sechdrs[symtab_shndx_idx].sh_link,
524520 symtab_idx);
525521 /* Fix endianness */
526522 for (p = info->symtab_shndx_start; p < info->symtab_shndx_stop;
@@ -1446,7 +1442,7 @@ static unsigned int *reloc_location(struct elf_info *elf, · 919 unmodified lines
14461442 Elf_Shdr *sechdr, Elf_Rela *r)
14471443 {
14481444 Elf_Shdr *sechdrs = elf->sechdrs;
1449− int section = shndx2secindex(sechdr->sh_info);
1445+ int section = sechdr->sh_info;
14501446
14511447 return (void *)elf->hdr + sechdrs[section].sh_offset +
14521448 r->r_offset;
scripts/mod/modpost.h+8−19
@@ -145,33 +145,22 @@ static inline int is_shndx_special(unsigned int i) · 144 unmodified lines
145145 return i != SHN_XINDEX && i >= SHN_LORESERVE && i <= SHN_HIRESERVE;
146146 }
147147
148−/* shndx is in [0..SHN_LORESERVE) U (SHN_HIRESERVE, 0xfffffff], thus:
149− * shndx == 0 <=> sechdrs[0]
150− * ......
151− * shndx == SHN_LORESERVE-1 <=> sechdrs[SHN_LORESERVE-1]
152− * shndx == SHN_HIRESERVE+1 <=> sechdrs[SHN_LORESERVE]
153− * shndx == SHN_HIRESERVE+2 <=> sechdrs[SHN_LORESERVE+1]
154− * ......
155− * fyi: sym->st_shndx is uint16, SHN_LORESERVE = ff00, SHN_HIRESERVE = ffff,
156− * so basically we map 0000..feff -> 0000..feff
157− * ff00..ffff -> (you are a bad boy, dont do it)
158− * 10000..xxxx -> ff00..(xxxx-0x100)
148+/*
149+ * Move reserved section indices SHN_LORESERVE..SHN_HIRESERVE out of
150+ * the way to -256..-1, to avoid conflicting with real section
151+ * indices.
159152 */
160−static inline unsigned int shndx2secindex(unsigned int i)
161−{
162− if (i <= SHN_HIRESERVE)
163− return i;
164− return i - (SHN_HIRESERVE + 1 - SHN_LORESERVE);
165−}
153+#define SPECIAL(i) ((i) - (SHN_HIRESERVE + 1))
166154
167155 /* Accessor for sym->st_shndx, hides ugliness of "64k sections" */
168156 static inline unsigned int get_secindex(const struct elf_info *info,
169157 const Elf_Sym *sym)
170158 {
159+ if (is_shndx_special(sym->st_shndx))
160+ return SPECIAL(sym->st_shndx);
171161 if (sym->st_shndx != SHN_XINDEX)
172162 return sym->st_shndx;
173− return shndx2secindex(info->symtab_shndx_start[sym -
174− info->symtab_start]);
163+ return info->symtab_shndx_start[sym - info->symtab_start];
175164 }
176165
177166 /* file2alias.c */
scripts/module-common.lds+11−0
@@ -5,4 +5,15 @@ · 4 unmodified lines
55 */
66 SECTIONS {
77 /DISCARD/ : { *(.discard) }
8+
9+ __ksymtab : { *(SORT(___ksymtab+*)) }
10+ __ksymtab_gpl : { *(SORT(___ksymtab_gpl+*)) }
11+ __ksymtab_unused : { *(SORT(___ksymtab_unused+*)) }
12+ __ksymtab_unused_gpl : { *(SORT(___ksymtab_unused_gpl+*)) }
13+ __ksymtab_gpl_future : { *(SORT(___ksymtab_gpl_future+*)) }
14+ __kcrctab : { *(SORT(___kcrctab+*)) }
15+ __kcrctab_gpl : { *(SORT(___kcrctab_gpl+*)) }
16+ __kcrctab_unused : { *(SORT(___kcrctab_unused+*)) }
17+ __kcrctab_unused_gpl : { *(SORT(___kcrctab_unused_gpl+*)) }
18+ __kcrctab_gpl_future : { *(SORT(___kcrctab_gpl_future+*)) }
819 }
scripts/package/Makefile+2−2
@@ -26,9 +26,9 @@ RPM := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \ · 25 unmodified lines
2626 else echo rpm; fi)
2727
2828 # Remove hyphens since they have special meaning in RPM filenames
29−KERNELPATH := kernel-$(subst -,,$(KERNELRELEASE))
29+KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
3030 MKSPEC := $(srctree)/scripts/package/mkspec
31−PREV := set -e; cd ..;
31+PREV := set -e; cd -P ..;
3232
3333 # rpm-pkg
3434 # ---------------------------------------------------------------------------
scripts/package/buildtar+1−1
@@ -92,7 +92,7 @@ case "${ARCH}" in · 91 unmodified lines
9292 echo "" >&2
9393 echo '** ** ** WARNING ** ** **' >&2
9494 echo "" >&2
95− echo "Your architecture did not define any architecture-dependant files" >&2
95+ echo "Your architecture did not define any architecture-dependent files" >&2
9696 echo "to be placed into the tarball. Please add those to ${0} ..." >&2
9797 echo "" >&2
9898 sleep 5
scripts/package/mkspec+18−1
@@ -22,7 +22,7 @@ if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then · 21 unmodified lines
2222 fi
2323
2424 PROVIDES="$PROVIDES kernel-$KERNELRELEASE"
25−__KERNELRELEASE=`echo $KERNELRELEASE | sed -e "s/-//g"`
25+__KERNELRELEASE=`echo $KERNELRELEASE | sed -e "s/-/_/g"`
2626
2727 echo "Name: kernel"
2828 echo "Summary: The Linux Kernel"
@@ -47,6 +47,18 @@ echo "" · 18 unmodified lines
4747 echo "%description"
4848 echo "The Linux Kernel, the operating system core itself"
4949 echo ""
50+echo "%package headers"
51+echo "Summary: Header files for the Linux kernel for use by glibc"
52+echo "Group: Development/System"
53+echo "Obsoletes: kernel-headers"
54+echo "Provides: kernel-headers = %{version}"
55+echo "%description headers"
56+echo "Kernel-headers includes the C header files that specify the interface"
57+echo "between the Linux kernel and userspace libraries and programs. The"
58+echo "header files define structures and constants that are needed for"
59+echo "building most standard programs and are also needed for rebuilding the"
60+echo "glibc package."
61+echo ""
5062
5163 if ! $PREBUILT; then
5264 echo "%prep"
@@ -83,6 +95,7 @@ echo 'cp $KBUILD_IMAGE $RPM_BUILD_ROOT'"/boot/vmlinuz-$KERNELRELEASE" · 30 unmodified lines
8395 echo "%endif"
8496 echo "%endif"
8597
98+echo 'make %{?_smp_mflags} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr headers_install'
8699 echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"
87100
88101 echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE"
@@ -105,3 +118,7 @@ echo "/lib/modules/$KERNELRELEASE" · 16 unmodified lines
105118 echo "/lib/firmware"
106119 echo "/boot/*"
107120 echo ""
121+echo "%files headers"
122+echo '%defattr (-, root, root)'
123+echo "/usr/include"
124+echo ""
scripts/patch-kernel+1−1
@@ -250,7 +250,7 @@ while : # incrementing SUBLEVEL (s in v.p.s) · 249 unmodified lines
250250 do
251251 CURRENTFULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL"
252252 EXTRAVER=
253− if [ $STOPFULLVERSION = $CURRENTFULLVERSION ]; then
253+ if [ x$STOPFULLVERSION = x$CURRENTFULLVERSION ]; then
254254 echo "Stopping at $CURRENTFULLVERSION base as requested."
255255 break
256256 fi
scripts/recordmcount.c+114−54
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include <sys/types.h>
2525 #include <sys/mman.h>
2626 #include <sys/stat.h>
27+#include <getopt.h>
2728 #include <elf.h>
2829 #include <fcntl.h>
2930 #include <setjmp.h>
@@ -39,6 +40,7 @@ static char gpfx; /* prefix for global symbol name (sometimes '_') */ · 9 unmodified lines
3940 static struct stat sb; /* Remember .st_size, etc. */
4041 static jmp_buf jmpenv; /* setjmp/longjmp per-file error escape */
4142 static const char *altmcount; /* alternate mcount symbol name */
43+static int warn_on_notrace_sect; /* warn when section has mcount not being recorded */
4244
4345 /* setjmp() return values */
4446 enum {
@@ -78,7 +80,7 @@ static off_t · 33 unmodified lines
7880 ulseek(int const fd, off_t const offset, int const whence)
7981 {
8082 off_t const w = lseek(fd, offset, whence);
81− if ((off_t)-1 == w) {
83+ if (w == (off_t)-1) {
8284 perror("lseek");
8385 fail_file();
8486 }
@@ -111,13 +113,41 @@ static void * · 26 unmodified lines
111113 umalloc(size_t size)
112114 {
113115 void *const addr = malloc(size);
114− if (0 == addr) {
116+ if (addr == 0) {
115117 fprintf(stderr, "malloc failed: %zu bytes\n", size);
116118 fail_file();
117119 }
118120 return addr;
119121 }
120122
123+static unsigned char ideal_nop5_x86_64[5] = { 0x0f, 0x1f, 0x44, 0x00, 0x00 };
124+static unsigned char ideal_nop5_x86_32[5] = { 0x3e, 0x8d, 0x74, 0x26, 0x00 };
125+static unsigned char *ideal_nop;
126+
127+static char rel_type_nop;
128+
129+static int (*make_nop)(void *map, size_t const offset);
130+
131+static int make_nop_x86(void *map, size_t const offset)
132+{
133+ uint32_t *ptr;
134+ unsigned char *op;
135+
136+ /* Confirm we have 0xe8 0x0 0x0 0x0 0x0 */
137+ ptr = map + offset;
138+ if (*ptr != 0)
139+ return -1;
140+
141+ op = map + offset - 1;
142+ if (*op != 0xe8)
143+ return -1;
144+
145+ /* convert to nop */
146+ ulseek(fd_map, offset - 1, SEEK_SET);
147+ uwrite(fd_map, ideal_nop, 5);
148+ return 0;
149+}
150+
121151 /*
122152 * Get the whole file as a programming convenience in order to avoid
123153 * malloc+lseek+read+free of many pieces. If successful, then mmap
@@ -136,7 +166,7 @@ static void *mmap_file(char const *fname) · 12 unmodified lines
136166 void *addr;
137167
138168 fd_map = open(fname, O_RDWR);
139− if (0 > fd_map || 0 > fstat(fd_map, &sb)) {
169+ if (fd_map < 0 || fstat(fd_map, &sb) < 0) {
140170 perror(fname);
141171 fail_file();
142172 }
@@ -147,7 +177,7 @@ static void *mmap_file(char const *fname) · 4 unmodified lines
147177 addr = mmap(0, sb.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE,
148178 fd_map, 0);
149179 mmap_failed = 0;
150− if (MAP_FAILED == addr) {
180+ if (addr == MAP_FAILED) {
151181 mmap_failed = 1;
152182 addr = umalloc(sb.st_size);
153183 uread(fd_map, addr, sb.st_size);
@@ -206,12 +236,13 @@ static uint32_t (*w2)(uint16_t); · 52 unmodified lines
206236 static int
207237 is_mcounted_section_name(char const *const txtname)
208238 {
209− return 0 == strcmp(".text", txtname) ||
210− 0 == strcmp(".ref.text", txtname) ||
211− 0 == strcmp(".sched.text", txtname) ||
212− 0 == strcmp(".spinlock.text", txtname) ||
213− 0 == strcmp(".irqentry.text", txtname) ||
214− 0 == strcmp(".text.unlikely", txtname);
239+ return strcmp(".text", txtname) == 0 ||
240+ strcmp(".ref.text", txtname) == 0 ||
241+ strcmp(".sched.text", txtname) == 0 ||
242+ strcmp(".spinlock.text", txtname) == 0 ||
243+ strcmp(".irqentry.text", txtname) == 0 ||
244+ strcmp(".kprobes.text", txtname) == 0 ||
245+ strcmp(".text.unlikely", txtname) == 0;
215246 }
216247
217248 /* 32 bit and 64 bit are very similar */
@@ -264,43 +295,48 @@ do_file(char const *const fname) · 46 unmodified lines
264295 w8 = w8nat;
265296 switch (ehdr->e_ident[EI_DATA]) {
266297 static unsigned int const endian = 1;
267− default: {
298+ default:
268299 fprintf(stderr, "unrecognized ELF data encoding %d: %s\n",
269300 ehdr->e_ident[EI_DATA], fname);
270301 fail_file();
271− } break;
272− case ELFDATA2LSB: {
273− if (1 != *(unsigned char const *)&endian) {
302+ break;
303+ case ELFDATA2LSB:
304+ if (*(unsigned char const *)&endian != 1) {
274305 /* main() is big endian, file.o is little endian. */
275306 w = w4rev;
276307 w2 = w2rev;
277308 w8 = w8rev;
278309 }
279− } break;
280− case ELFDATA2MSB: {
281− if (0 != *(unsigned char const *)&endian) {
310+ break;
311+ case ELFDATA2MSB:
312+ if (*(unsigned char const *)&endian != 0) {
282313 /* main() is little endian, file.o is big endian. */
283314 w = w4rev;
284315 w2 = w2rev;
285316 w8 = w8rev;
286317 }
287− } break;
318+ break;
288319 } /* end switch */
289− if (0 != memcmp(ELFMAG, ehdr->e_ident, SELFMAG)
290− || ET_REL != w2(ehdr->e_type)
291− || EV_CURRENT != ehdr->e_ident[EI_VERSION]) {
320+ if (memcmp(ELFMAG, ehdr->e_ident, SELFMAG) != 0
321+ || w2(ehdr->e_type) != ET_REL
322+ || ehdr->e_ident[EI_VERSION] != EV_CURRENT) {
292323 fprintf(stderr, "unrecognized ET_REL file %s\n", fname);
293324 fail_file();
294325 }
295326
296327 gpfx = 0;
297328 switch (w2(ehdr->e_machine)) {
298− default: {
329+ default:
299330 fprintf(stderr, "unrecognized e_machine %d %s\n",
300331 w2(ehdr->e_machine), fname);
301332 fail_file();
302− } break;
303− case EM_386: reltype = R_386_32; break;
333+ break;
334+ case EM_386:
335+ reltype = R_386_32;
336+ make_nop = make_nop_x86;
337+ ideal_nop = ideal_nop5_x86_32;
338+ mcount_adjust_32 = -1;
339+ break;
304340 case EM_ARM: reltype = R_ARM_ABS32;
305341 altmcount = "__gnu_mcount_nc";
306342 break;
@@ -311,67 +347,91 @@ do_file(char const *const fname) · 4 unmodified lines
311347 case EM_S390: /* reltype: e_class */ gpfx = '_'; break;
312348 case EM_SH: reltype = R_SH_DIR32; break;
313349 case EM_SPARCV9: reltype = R_SPARC_64; gpfx = '_'; break;
314− case EM_X86_64: reltype = R_X86_64_64; break;
350+ case EM_X86_64:
351+ make_nop = make_nop_x86;
352+ ideal_nop = ideal_nop5_x86_64;
353+ reltype = R_X86_64_64;
354+ mcount_adjust_64 = -1;
355+ break;
315356 } /* end switch */
316357
317358 switch (ehdr->e_ident[EI_CLASS]) {
318− default: {
359+ default:
319360 fprintf(stderr, "unrecognized ELF class %d %s\n",
320361 ehdr->e_ident[EI_CLASS], fname);
321362 fail_file();
322− } break;
323− case ELFCLASS32: {
324− if (sizeof(Elf32_Ehdr) != w2(ehdr->e_ehsize)
325− || sizeof(Elf32_Shdr) != w2(ehdr->e_shentsize)) {
363+ break;
364+ case ELFCLASS32:
365+ if (w2(ehdr->e_ehsize) != sizeof(Elf32_Ehdr)
366+ || w2(ehdr->e_shentsize) != sizeof(Elf32_Shdr)) {
326367 fprintf(stderr,
327368 "unrecognized ET_REL file: %s\n", fname);
328369 fail_file();
329370 }
330− if (EM_S390 == w2(ehdr->e_machine))
371+ if (w2(ehdr->e_machine) == EM_S390) {
331372 reltype = R_390_32;
332− if (EM_MIPS == w2(ehdr->e_machine)) {
373+ mcount_adjust_32 = -4;
374+ }
375+ if (w2(ehdr->e_machine) == EM_MIPS) {
333376 reltype = R_MIPS_32;
334377 is_fake_mcount32 = MIPS32_is_fake_mcount;
335378 }
336379 do32(ehdr, fname, reltype);
337− } break;
380+ break;
338381 case ELFCLASS64: {
339382 Elf64_Ehdr *const ghdr = (Elf64_Ehdr *)ehdr;
340− if (sizeof(Elf64_Ehdr) != w2(ghdr->e_ehsize)
341− || sizeof(Elf64_Shdr) != w2(ghdr->e_shentsize)) {
383+ if (w2(ghdr->e_ehsize) != sizeof(Elf64_Ehdr)
384+ || w2(ghdr->e_shentsize) != sizeof(Elf64_Shdr)) {
342385 fprintf(stderr,
343386 "unrecognized ET_REL file: %s\n", fname);
344387 fail_file();
345388 }
346− if (EM_S390 == w2(ghdr->e_machine))
389+ if (w2(ghdr->e_machine) == EM_S390) {
347390 reltype = R_390_64;
348− if (EM_MIPS == w2(ghdr->e_machine)) {
391+ mcount_adjust_64 = -8;
392+ }
393+ if (w2(ghdr->e_machine) == EM_MIPS) {
349394 reltype = R_MIPS_64;
350395 Elf64_r_sym = MIPS64_r_sym;
351396 Elf64_r_info = MIPS64_r_info;
352397 is_fake_mcount64 = MIPS64_is_fake_mcount;
353398 }
354399 do64(ghdr, fname, reltype);
355− } break;
400+ break;
401+ }
356402 } /* end switch */
357403
358404 cleanup();
359405 }
360406
361407 int
362−main(int argc, char const *argv[])
408+main(int argc, char *argv[])
363409 {
364410 const char ftrace[] = "/ftrace.o";
365411 int ftrace_size = sizeof(ftrace) - 1;
366412 int n_error = 0; /* gcc-4.3.0 false positive complaint */
413+ int c;
414+ int i;
415+
416+ while ((c = getopt(argc, argv, "w")) >= 0) {
417+ switch (c) {
418+ case 'w':
419+ warn_on_notrace_sect = 1;
420+ break;
421+ default:
422+ fprintf(stderr, "usage: recordmcount [-w] file.o...\n");
423+ return 0;
424+ }
425+ }
367426
368− if (argc <= 1) {
369− fprintf(stderr, "usage: recordmcount file.o...\n");
427+ if ((argc - optind) < 1) {
428+ fprintf(stderr, "usage: recordmcount [-w] file.o...\n");
370429 return 0;
371430 }
372431
373432 /* Process each file in turn, allowing deep failure. */
374− for (--argc, ++argv; 0 < argc; --argc, ++argv) {
433+ for (i = optind; i < argc; i++) {
434+ char *file = argv[i];
375435 int const sjval = setjmp(jmpenv);
376436 int len;
377437
@@ -380,29 +440,29 @@ main(int argc, char const *argv[]) · 2 unmodified lines
380440 * function but does not call it. Since ftrace.o should
381441 * not be traced anyway, we just skip it.
382442 */
383− len = strlen(argv[0]);
443+ len = strlen(file);
384444 if (len >= ftrace_size &&
385− strcmp(argv[0] + (len - ftrace_size), ftrace) == 0)
445+ strcmp(file + (len - ftrace_size), ftrace) == 0)
386446 continue;
387447
388448 switch (sjval) {
389− default: {
390− fprintf(stderr, "internal error: %s\n", argv[0]);
449+ default:
450+ fprintf(stderr, "internal error: %s\n", file);
391451 exit(1);
392− } break;
393− case SJ_SETJMP: { /* normal sequence */
452+ break;
453+ case SJ_SETJMP: /* normal sequence */
394454 /* Avoid problems if early cleanup() */
395455 fd_map = -1;
396456 ehdr_curr = NULL;
397457 mmap_failed = 1;
398− do_file(argv[0]);
399− } break;
400− case SJ_FAIL: { /* error in do_file or below */
458+ do_file(file);
459+ break;
460+ case SJ_FAIL: /* error in do_file or below */
401461 ++n_error;
402− } break;
403− case SJ_SUCCEED: { /* premature success */
462+ break;
463+ case SJ_SUCCEED: /* premature success */
404464 /* do nothing */
405− } break;
465+ break;
406466 } /* end switch */
407467 }
408468 return !!n_error;
scripts/recordmcount.h+146−36
@@ -22,11 +22,15 @@ · 21 unmodified lines
2222 #undef is_fake_mcount
2323 #undef fn_is_fake_mcount
2424 #undef MIPS_is_fake_mcount
25+#undef mcount_adjust
2526 #undef sift_rel_mcount
27+#undef nop_mcount
2628 #undef find_secsym_ndx
2729 #undef __has_rel_mcount
2830 #undef has_rel_mcount
2931 #undef tot_relsize
32+#undef get_mcountsym
33+#undef get_sym_str_and_relp
3034 #undef do_func
3135 #undef Elf_Addr
3236 #undef Elf_Ehdr
@@ -39,6 +43,7 @@ · 6 unmodified lines
3943 #undef ELF_R_INFO
4044 #undef Elf_r_info
4145 #undef ELF_ST_BIND
46+#undef ELF_ST_TYPE
4247 #undef fn_ELF_R_SYM
4348 #undef fn_ELF_R_INFO
4449 #undef uint_t
@@ -49,14 +54,18 @@ · 4 unmodified lines
4954 #ifdef RECORD_MCOUNT_64
5055 # define append_func append64
5156 # define sift_rel_mcount sift64_rel_mcount
57+# define nop_mcount nop_mcount_64
5258 # define find_secsym_ndx find64_secsym_ndx
5359 # define __has_rel_mcount __has64_rel_mcount
5460 # define has_rel_mcount has64_rel_mcount
5561 # define tot_relsize tot64_relsize
62+# define get_sym_str_and_relp get_sym_str_and_relp_64
5663 # define do_func do64
64+# define get_mcountsym get_mcountsym_64
5765 # define is_fake_mcount is_fake_mcount64
5866 # define fn_is_fake_mcount fn_is_fake_mcount64
5967 # define MIPS_is_fake_mcount MIPS64_is_fake_mcount
68+# define mcount_adjust mcount_adjust_64
6069 # define Elf_Addr Elf64_Addr
6170 # define Elf_Ehdr Elf64_Ehdr
6271 # define Elf_Shdr Elf64_Shdr
@@ -68,6 +77,7 @@ · 5 unmodified lines
6877 # define ELF_R_INFO ELF64_R_INFO
6978 # define Elf_r_info Elf64_r_info
7079 # define ELF_ST_BIND ELF64_ST_BIND
80+# define ELF_ST_TYPE ELF64_ST_TYPE
7181 # define fn_ELF_R_SYM fn_ELF64_R_SYM
7282 # define fn_ELF_R_INFO fn_ELF64_R_INFO
7383 # define uint_t uint64_t
@@ -77,14 +87,18 @@ · 3 unmodified lines
7787 #else
7888 # define append_func append32
7989 # define sift_rel_mcount sift32_rel_mcount
90+# define nop_mcount nop_mcount_32
8091 # define find_secsym_ndx find32_secsym_ndx
8192 # define __has_rel_mcount __has32_rel_mcount
8293 # define has_rel_mcount has32_rel_mcount
8394 # define tot_relsize tot32_relsize
95+# define get_sym_str_and_relp get_sym_str_and_relp_32
8496 # define do_func do32
97+# define get_mcountsym get_mcountsym_32
8598 # define is_fake_mcount is_fake_mcount32
8699 # define fn_is_fake_mcount fn_is_fake_mcount32
87100 # define MIPS_is_fake_mcount MIPS32_is_fake_mcount
101+# define mcount_adjust mcount_adjust_32
88102 # define Elf_Addr Elf32_Addr
89103 # define Elf_Ehdr Elf32_Ehdr
90104 # define Elf_Shdr Elf32_Shdr
@@ -96,6 +110,7 @@ · 5 unmodified lines
96110 # define ELF_R_INFO ELF32_R_INFO
97111 # define Elf_r_info Elf32_r_info
98112 # define ELF_ST_BIND ELF32_ST_BIND
113+# define ELF_ST_TYPE ELF32_ST_TYPE
99114 # define fn_ELF_R_SYM fn_ELF32_R_SYM
100115 # define fn_ELF_R_INFO fn_ELF32_R_INFO
101116 # define uint_t uint32_t
@@ -123,6 +138,8 @@ static void fn_ELF_R_INFO(Elf_Rel *const rp, unsigned sym, unsigned type) · 21 unmodified lines
123138 }
124139 static void (*Elf_r_info)(Elf_Rel *const rp, unsigned sym, unsigned type) = fn_ELF_R_INFO;
125140
141+static int mcount_adjust = 0;
142+
126143 /*
127144 * MIPS mcount long call has 2 _mcount symbols, only the position of the 1st
128145 * _mcount symbol is needed for dynamic function tracer, with it, to disable
@@ -234,6 +251,49 @@ static void append_func(Elf_Ehdr *const ehdr, · 105 unmodified lines
234251 uwrite(fd_map, ehdr, sizeof(*ehdr));
235252 }
236253
254+static unsigned get_mcountsym(Elf_Sym const *const sym0,
255+ Elf_Rel const *relp,
256+ char const *const str0)
257+{
258+ unsigned mcountsym = 0;
259+
260+ Elf_Sym const *const symp =
261+ &sym0[Elf_r_sym(relp)];
262+ char const *symname = &str0[w(symp->st_name)];
263+ char const *mcount = gpfx == '_' ? "_mcount" : "mcount";
264+
265+ if (symname[0] == '.')
266+ ++symname; /* ppc64 hack */
267+ if (strcmp(mcount, symname) == 0 ||
268+ (altmcount && strcmp(altmcount, symname) == 0))
269+ mcountsym = Elf_r_sym(relp);
270+
271+ return mcountsym;
272+}
273+
274+static void get_sym_str_and_relp(Elf_Shdr const *const relhdr,
275+ Elf_Ehdr const *const ehdr,
276+ Elf_Sym const **sym0,
277+ char const **str0,
278+ Elf_Rel const **relp)
279+{
280+ Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff)
281+ + (void *)ehdr);
282+ unsigned const symsec_sh_link = w(relhdr->sh_link);
283+ Elf_Shdr const *const symsec = &shdr0[symsec_sh_link];
284+ Elf_Shdr const *const strsec = &shdr0[w(symsec->sh_link)];
285+ Elf_Rel const *const rel0 = (Elf_Rel const *)(_w(relhdr->sh_offset)
286+ + (void *)ehdr);
287+
288+ *sym0 = (Elf_Sym const *)(_w(symsec->sh_offset)
289+ + (void *)ehdr);
290+
291+ *str0 = (char const *)(_w(strsec->sh_offset)
292+ + (void *)ehdr);
293+
294+ *relp = rel0;
295+}
296+
237297 /*
238298 * Look at the relocations in order to find the calls to mcount.
239299 * Accumulate the section offsets that are found, and their relocation info,
@@ -250,47 +310,27 @@ static uint_t *sift_rel_mcount(uint_t *mlocp, · 10 unmodified lines
250310 {
251311 uint_t *const mloc0 = mlocp;
252312 Elf_Rel *mrelp = *mrelpp;
253− Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff)
254− + (void *)ehdr);
255− unsigned const symsec_sh_link = w(relhdr->sh_link);
256− Elf_Shdr const *const symsec = &shdr0[symsec_sh_link];
257− Elf_Sym const *const sym0 = (Elf_Sym const *)(_w(symsec->sh_offset)
258− + (void *)ehdr);
259−
260− Elf_Shdr const *const strsec = &shdr0[w(symsec->sh_link)];
261− char const *const str0 = (char const *)(_w(strsec->sh_offset)
262− + (void *)ehdr);
263−
264− Elf_Rel const *const rel0 = (Elf_Rel const *)(_w(relhdr->sh_offset)
265− + (void *)ehdr);
313+ Elf_Sym const *sym0;
314+ char const *str0;
315+ Elf_Rel const *relp;
266316 unsigned rel_entsize = _w(relhdr->sh_entsize);
267317 unsigned const nrel = _w(relhdr->sh_size) / rel_entsize;
268− Elf_Rel const *relp = rel0;
269−
270318 unsigned mcountsym = 0;
271319 unsigned t;
272320
321+ get_sym_str_and_relp(relhdr, ehdr, &sym0, &str0, &relp);
322+
273323 for (t = nrel; t; --t) {
274− if (!mcountsym) {
275− Elf_Sym const *const symp =
276− &sym0[Elf_r_sym(relp)];
277− char const *symname = &str0[w(symp->st_name)];
278− char const *mcount = '_' == gpfx ? "_mcount" : "mcount";
279−
280− if ('.' == symname[0])
281− ++symname; /* ppc64 hack */
282− if (0 == strcmp(mcount, symname) ||
283− (altmcount && 0 == strcmp(altmcount, symname)))
284− mcountsym = Elf_r_sym(relp);
285− }
324+ if (!mcountsym)
325+ mcountsym = get_mcountsym(sym0, relp, str0);
286326
287327 if (mcountsym == Elf_r_sym(relp) && !is_fake_mcount(relp)) {
288− uint_t const addend = _w(_w(relp->r_offset) - recval);
289−
328+ uint_t const addend =
329+ _w(_w(relp->r_offset) - recval + mcount_adjust);
290330 mrelp->r_offset = _w(offbase
291331 + ((void *)mlocp - (void *)mloc0));
292332 Elf_r_info(mrelp, recsym, reltype);
293− if (sizeof(Elf_Rela) == rel_entsize) {
333+ if (rel_entsize == sizeof(Elf_Rela)) {
294334 ((Elf_Rela *)mrelp)->r_addend = addend;
295335 *mlocp++ = 0;
296336 } else
@@ -304,6 +344,63 @@ static uint_t *sift_rel_mcount(uint_t *mlocp, · 7 unmodified lines
304344 return mlocp;
305345 }
306346
347+/*
348+ * Read the relocation table again, but this time its called on sections
349+ * that are not going to be traced. The mcount calls here will be converted
350+ * into nops.
351+ */
352+static void nop_mcount(Elf_Shdr const *const relhdr,
353+ Elf_Ehdr const *const ehdr,
354+ const char *const txtname)
355+{
356+ Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff)
357+ + (void *)ehdr);
358+ Elf_Sym const *sym0;
359+ char const *str0;
360+ Elf_Rel const *relp;
361+ Elf_Shdr const *const shdr = &shdr0[w(relhdr->sh_info)];
362+ unsigned rel_entsize = _w(relhdr->sh_entsize);
363+ unsigned const nrel = _w(relhdr->sh_size) / rel_entsize;
364+ unsigned mcountsym = 0;
365+ unsigned t;
366+ int once = 0;
367+
368+ get_sym_str_and_relp(relhdr, ehdr, &sym0, &str0, &relp);
369+
370+ for (t = nrel; t; --t) {
371+ int ret = -1;
372+
373+ if (!mcountsym)
374+ mcountsym = get_mcountsym(sym0, relp, str0);
375+
376+ if (mcountsym == Elf_r_sym(relp) && !is_fake_mcount(relp)) {
377+ if (make_nop)
378+ ret = make_nop((void *)ehdr, shdr->sh_offset + relp->r_offset);
379+ if (warn_on_notrace_sect && !once) {
380+ printf("Section %s has mcount callers being ignored\n",
381+ txtname);
382+ once = 1;
383+ /* just warn? */
384+ if (!make_nop)
385+ return;
386+ }
387+ }
388+
389+ /*
390+ * If we successfully removed the mcount, mark the relocation
391+ * as a nop (don't do anything with it).
392+ */
393+ if (!ret) {
394+ Elf_Rel rel;
395+ rel = *(Elf_Rel *)relp;
396+ Elf_r_info(&rel, Elf_r_sym(relp), rel_type_nop);
397+ ulseek(fd_map, (void *)relp - (void *)ehdr, SEEK_SET);
398+ uwrite(fd_map, &rel, sizeof(rel));
399+ }
400+ relp = (Elf_Rel const *)(rel_entsize + (void *)relp);
401+ }
402+}
403+
307404
308405 /*
309406 * Find a symbol in the given section, to be used as the base for relocating
@@ -333,6 +430,11 @@ static unsigned find_secsym_ndx(unsigned const txtndx, · 23 unmodified lines
333430 if (txtndx == w2(symp->st_shndx)
334431 /* avoid STB_WEAK */
335432 && (STB_LOCAL == st_bind || STB_GLOBAL == st_bind)) {
433+ /* function symbols on ARM have quirks, avoid them */
434+ if (w2(ehdr->e_machine) == EM_ARM
435+ && ELF_ST_TYPE(symp->st_info) == STT_FUNC)
436+ continue;
437+
336438 *recvalp = _w(symp->st_value);
337439 return symp - sym0;
338440 }
@@ -354,13 +456,13 @@ __has_rel_mcount(Elf_Shdr const *const relhdr, /* is SHT_REL or SHT_RELA */ · 15 unmodified lines
354456 Elf_Shdr const *const txthdr = &shdr0[w(relhdr->sh_info)];
355457 char const *const txtname = &shstrtab[w(txthdr->sh_name)];
356458
357− if (0 == strcmp("__mcount_loc", txtname)) {
459+ if (strcmp("__mcount_loc", txtname) == 0) {
358460 fprintf(stderr, "warning: __mcount_loc already exists: %s\n",
359461 fname);
360462 succeed_file();
361463 }
362− if (SHT_PROGBITS != w(txthdr->sh_type) ||
363− !is_mcounted_section_name(txtname))
464+ if (w(txthdr->sh_type) != SHT_PROGBITS ||
465+ !(w(txthdr->sh_flags) & SHF_EXECINSTR))
364466 return NULL;
365467 return txtname;
366468 }
@@ -370,7 +472,7 @@ static char const *has_rel_mcount(Elf_Shdr const *const relhdr, · 3 unmodified lines
370472 char const *const shstrtab,
371473 char const *const fname)
372474 {
373− if (SHT_REL != w(relhdr->sh_type) && SHT_RELA != w(relhdr->sh_type))
475+ if (w(relhdr->sh_type) != SHT_REL && w(relhdr->sh_type) != SHT_RELA)
374476 return NULL;
375477 return __has_rel_mcount(relhdr, shdr0, shstrtab, fname);
376478 }
@@ -383,9 +485,11 @@ static unsigned tot_relsize(Elf_Shdr const *const shdr0, · 6 unmodified lines
383485 {
384486 unsigned totrelsz = 0;
385487 Elf_Shdr const *shdrp = shdr0;
488+ char const *txtname;
386489
387490 for (; nhdr; --nhdr, ++shdrp) {
388− if (has_rel_mcount(shdrp, shdr0, shstrtab, fname))
491+ txtname = has_rel_mcount(shdrp, shdr0, shstrtab, fname);
492+ if (txtname && is_mcounted_section_name(txtname))
389493 totrelsz += _w(shdrp->sh_size);
390494 }
391495 return totrelsz;
@@ -421,7 +525,7 @@ do_func(Elf_Ehdr *const ehdr, char const *const fname, unsigned const reltype) · 29 unmodified lines
421525 for (relhdr = shdr0, k = nhdr; k; --k, ++relhdr) {
422526 char const *const txtname = has_rel_mcount(relhdr, shdr0,
423527 shstrtab, fname);
424− if (txtname) {
528+ if (txtname && is_mcounted_section_name(txtname)) {
425529 uint_t recval = 0;
426530 unsigned const recsym = find_secsym_ndx(
427531 w(relhdr->sh_info), txtname, &recval,
@@ -432,6 +536,12 @@ do_func(Elf_Ehdr *const ehdr, char const *const fname, unsigned const reltype) · 4 unmodified lines
432536 mlocp = sift_rel_mcount(mlocp,
433537 (void *)mlocp - (void *)mloc0, &mrelp,
434538 relhdr, ehdr, recsym, recval, reltype);
539+ } else if (txtname && (warn_on_notrace_sect || make_nop)) {
540+ /*
541+ * This section is ignored by ftrace, but still
542+ * has mcount calls. Convert them to nops now.
543+ */
544+ nop_mcount(relhdr, ehdr, txtname);
435545 }
436546 }
437547 if (mloc0 != mlocp) {
scripts/recordmcount.pl+5−0
@@ -134,6 +134,7 @@ my %text_sections = ( · 133 unmodified lines
134134 ".sched.text" => 1,
135135 ".spinlock.text" => 1,
136136 ".irqentry.text" => 1,
137+ ".kprobes.text" => 1,
137138 ".text.unlikely" => 1,
138139 );
139140
@@ -222,6 +223,7 @@ if ($arch eq "x86_64") { · 82 unmodified lines
222223 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$";
223224 $type = ".quad";
224225 $alignment = 8;
226+ $mcount_adjust = -1;
225227
226228 # force flags for this arch
227229 $ld .= " -m elf_x86_64";
@@ -231,6 +233,7 @@ if ($arch eq "x86_64") { · 3 unmodified lines
231233
232234 } elsif ($arch eq "i386") {
233235 $alignment = 4;
236+ $mcount_adjust = -1;
234237
235238 # force flags for this arch
236239 $ld .= " -m elf_i386";
@@ -240,12 +243,14 @@ if ($arch eq "x86_64") { · 3 unmodified lines
240243
241244 } elsif ($arch eq "s390" && $bits == 32) {
242245 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$";
246+ $mcount_adjust = -4;
243247 $alignment = 4;
244248 $ld .= " -m elf_s390";
245249 $cc .= " -m31";
246250
247251 } elsif ($arch eq "s390" && $bits == 64) {
248252 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
253+ $mcount_adjust = -8;
249254 $alignment = 8;
250255 $type = ".quad";
251256 $ld .= " -m elf64_s390";
scripts/rt-tester/rt-tester.py+1−1
@@ -180,7 +180,7 @@ while 1: · 179 unmodified lines
180180 for s in stat:
181181 s = s.strip()
182182 if s.startswith(testop[0]):
183− # Seperate status value
183+ # Separate status value
184184 val = s[2:].strip()
185185 query = analyse(val, testop, dat)
186186 break
scripts/selinux/README+1−1
@@ -1,2 +1,2 @@
1−Please see Documentation/SELinux.txt for information on
1+Please see Documentation/security/SELinux.txt for information on
22 installing a dummy SELinux policy.
scripts/tags.sh+4−2
@@ -132,7 +132,7 @@ exuberant() · 131 unmodified lines
132132 --regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \
133133 --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
134134 --regex-c++='/^TRACE_EVENT\(([^,)]*).*/trace_\1/' \
135− --regex-c++='/^DEFINE_EVENT\(([^,)]*).*/trace_\1/'
135+ --regex-c++='/^DEFINE_EVENT\([^,)]*, *([^,)]*).*/trace_\1/'
136136
137137 all_kconfigs | xargs $1 -a \
138138 --langdef=kconfig --language-force=kconfig \
@@ -152,7 +152,9 @@ emacs() · 13 unmodified lines
152152 {
153153 all_sources | xargs $1 -a \
154154 --regex='/^ENTRY(\([^)]*\)).*/\1/' \
155− --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/'
155+ --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/' \
156+ --regex='/^TRACE_EVENT(\([^,)]*\).*/trace_\1/' \
157+ --regex='/^DEFINE_EVENT([^,)]*, *\([^,)]*\).*/trace_\1/'
156158
157159 all_kconfigs | xargs $1 -a \
158160 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'