aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <koct9i@gmail.com>2014-08-08 17:23:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:27 -0400
commitfda9f9903be6c3b590472c175c514b0834bb3c83 (patch)
tree02209b01041024c8f3ac21175292e25ff236187e /scripts
parentc965526a82a62a97363ea7f3caae0e4a8a809bb9 (diff)
scripts/checkstack.pl: automatically handle 32-bit and 64-bit mode for ARCH=x86
This patch adds support for ARCH=x86 into checkstack. Commit ffee0de411fd ("x86: Default to ARCH=x86 to avoid overriding CONFIG_64BIT") had merged ARCH=i386 and ARCH=x86_64 into one ARCH=x86. checkstack.pl searches patterns of machine instructions which are usually used for allocating stack frames. checkstalk.pl needs either i386 or x86_64, x86 isn't enough: $ make checkstack objdump -d vmlinux $(find . -name '*.ko') | \ perl linux/scripts/checkstack.pl x86 wrong or unknown architecture "x86" Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Richard Weinberger <richard@nod.at> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkstack.pl12
1 files changed, 5 insertions, 7 deletions
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
index c05d586b1fee..899b4230320e 100755
--- a/scripts/checkstack.pl
+++ b/scripts/checkstack.pl
@@ -52,14 +52,12 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
52 #8000008a: 20 1d sub sp,4 52 #8000008a: 20 1d sub sp,4
53 #80000ca8: fa cd 05 b0 sub sp,sp,1456 53 #80000ca8: fa cd 05 b0 sub sp,sp,1456
54 $re = qr/^.*sub.*sp.*,([0-9]{1,8})/o; 54 $re = qr/^.*sub.*sp.*,([0-9]{1,8})/o;
55 } elsif ($arch =~ /^i[3456]86$/) { 55 } elsif ($arch =~ /^x86(_64)?$/ || $arch =~ /^i[3456]86$/) {
56 #c0105234: 81 ec ac 05 00 00 sub $0x5ac,%esp 56 #c0105234: 81 ec ac 05 00 00 sub $0x5ac,%esp
57 $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%esp$/o; 57 # or
58 $dre = qr/^.*[as][du][db] (%.*),\%esp$/o; 58 # 2f60: 48 81 ec e8 05 00 00 sub $0x5e8,%rsp
59 } elsif ($arch eq 'x86_64') { 59 $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%(e|r)sp$/o;
60 # 2f60: 48 81 ec e8 05 00 00 sub $0x5e8,%rsp 60 $dre = qr/^.*[as][du][db] (%.*),\%(e|r)sp$/o;
61 $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%rsp$/o;
62 $dre = qr/^.*[as][du][db] (\%.*),\%rsp$/o;
63 } elsif ($arch eq 'ia64') { 61 } elsif ($arch eq 'ia64') {
64 #e0000000044011fc: 01 0f fc 8c adds r12=-384,r12 62 #e0000000044011fc: 01 0f fc 8c adds r12=-384,r12
65 $re = qr/.*adds.*r12=-(([0-9]{2}|[3-9])[0-9]{2}),r12/o; 63 $re = qr/.*adds.*r12=-(([0-9]{2}|[3-9])[0-9]{2}),r12/o;