aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2018-12-17 11:46:26 -0500
committerIngo Molnar <mingo@kernel.org>2018-12-17 11:46:26 -0500
commit76aea1eeb98d2d75d9297fda777efeffe3657aeb (patch)
tree18fdf94ec846b553f1e60438279a3b449897189b /scripts
parent43b9e4febc66b98d83cc1560196d56ac7fef3c32 (diff)
parent7566ec393f4161572ba6f11ad5171fd5d59b0fbd (diff)
Merge tag 'v4.20-rc7' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkstack.pl4
-rw-r--r--scripts/gcc-plugins/stackleak_plugin.c8
-rwxr-xr-xscripts/spdxcheck.py6
3 files changed, 11 insertions, 7 deletions
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index 8081b6cf67d2..34414c6efad6 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -47,8 +47,8 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
47 $xs = "[0-9a-f ]"; # hex character or space 47 $xs = "[0-9a-f ]"; # hex character or space
48 $funcre = qr/^$x* <(.*)>:$/; 48 $funcre = qr/^$x* <(.*)>:$/;
49 if ($arch eq 'aarch64') { 49 if ($arch eq 'aarch64') {
50 #ffffffc0006325cc: a9bb7bfd stp x29, x30, [sp,#-80]! 50 #ffffffc0006325cc: a9bb7bfd stp x29, x30, [sp, #-80]!
51 $re = qr/^.*stp.*sp,\#-([0-9]{1,8})\]\!/o; 51 $re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o;
52 } elsif ($arch eq 'arm') { 52 } elsif ($arch eq 'arm') {
53 #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64 53 #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64
54 $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o; 54 $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o;
diff --git a/scripts/gcc-plugins/stackleak_plugin.c b/scripts/gcc-plugins/stackleak_plugin.c
index 2f48da98b5d4..dbd37460c573 100644
--- a/scripts/gcc-plugins/stackleak_plugin.c
+++ b/scripts/gcc-plugins/stackleak_plugin.c
@@ -363,10 +363,12 @@ __visible int plugin_init(struct plugin_name_args *plugin_info,
363 PASS_POS_INSERT_BEFORE); 363 PASS_POS_INSERT_BEFORE);
364 364
365 /* 365 /*
366 * The stackleak_cleanup pass should be executed after the 366 * The stackleak_cleanup pass should be executed before the "*free_cfg"
367 * "reload" pass, when the stack frame size is final. 367 * pass. It's the moment when the stack frame size is already final,
368 * function prologues and epilogues are generated, and the
369 * machine-dependent code transformations are not done.
368 */ 370 */
369 PASS_INFO(stackleak_cleanup, "reload", 1, PASS_POS_INSERT_AFTER); 371 PASS_INFO(stackleak_cleanup, "*free_cfg", 1, PASS_POS_INSERT_BEFORE);
370 372
371 if (!plugin_default_version_check(version, &gcc_version)) { 373 if (!plugin_default_version_check(version, &gcc_version)) {
372 error(G_("incompatible gcc/plugin versions")); 374 error(G_("incompatible gcc/plugin versions"));
diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py
index 5056fb3b897d..e559c6294c39 100755
--- a/scripts/spdxcheck.py
+++ b/scripts/spdxcheck.py
@@ -168,6 +168,7 @@ class id_parser(object):
168 self.curline = 0 168 self.curline = 0
169 try: 169 try:
170 for line in fd: 170 for line in fd:
171 line = line.decode(locale.getpreferredencoding(False), errors='ignore')
171 self.curline += 1 172 self.curline += 1
172 if self.curline > maxlines: 173 if self.curline > maxlines:
173 break 174 break
@@ -249,12 +250,13 @@ if __name__ == '__main__':
249 250
250 try: 251 try:
251 if len(args.path) and args.path[0] == '-': 252 if len(args.path) and args.path[0] == '-':
252 parser.parse_lines(sys.stdin, args.maxlines, '-') 253 stdin = os.fdopen(sys.stdin.fileno(), 'rb')
254 parser.parse_lines(stdin, args.maxlines, '-')
253 else: 255 else:
254 if args.path: 256 if args.path:
255 for p in args.path: 257 for p in args.path:
256 if os.path.isfile(p): 258 if os.path.isfile(p):
257 parser.parse_lines(open(p), args.maxlines, p) 259 parser.parse_lines(open(p, 'rb'), args.maxlines, p)
258 elif os.path.isdir(p): 260 elif os.path.isdir(p):
259 scan_git_subtree(repo.head.reference.commit.tree, p) 261 scan_git_subtree(repo.head.reference.commit.tree, p)
260 else: 262 else: