Skip to content

Commit 8449a4c

Browse files
leitaompe
authored andcommitted
scripts: Add ppc64le support for checkstack.pl
64-bit ELF v2 ABI specification for POWER describes, on section "General Stack Frame Requirements", that the stack should use the following instructions when compiled with backchain: mflr r0 std r0, 16(r1) stdu r1, -XX(r1) Where XX is the frame size for that function, and this is the value checkstack.pl will find the stack size for each function. This patch also simplifies the entire Powerpc section, since just two type of instructions are used, 'stdu' for 64 bits and 'stwu' for 32 bits platform. Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 8272f59 commit 8449a4c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

scripts/checkstack.pl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# M68k port by Geert Uytterhoeven and Andreas Schwab
1616
# AArch64, PARISC ports by Kyle McMartin
1717
# sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
18+
# ppc64le port by Breno Leitao <leitao@debian.org>
1819
#
1920
# Usage:
2021
# objdump -d vmlinux | scripts/checkstack.pl [arch]
@@ -78,13 +79,9 @@
7879
$re = qr/.*l\.addi.*r1,r1,-(([0-9]{2}|[3-9])[0-9]{2})/o;
7980
} elsif ($arch eq 'parisc' || $arch eq 'parisc64') {
8081
$re = qr/.*ldo ($x{1,8})\(sp\),sp/o;
81-
} elsif ($arch eq 'ppc') {
82-
#c00029f4: 94 21 ff 30 stwu r1,-208(r1)
83-
$re = qr/.*stwu.*r1,-($x{1,8})\(r1\)/o;
84-
} elsif ($arch eq 'ppc64') {
85-
#XXX
86-
$re = qr/.*stdu.*r1,-($x{1,8})\(r1\)/o;
87-
} elsif ($arch eq 'powerpc') {
82+
} elsif ($arch eq 'powerpc' || $arch =~ /^ppc(64)?(le)?$/ ) {
83+
# powerpc : 94 21 ff 30 stwu r1,-208(r1)
84+
# ppc64(le) : 81 ff 21 f8 stdu r1,-128(r1)
8885
$re = qr/.*st[dw]u.*r1,-($x{1,8})\(r1\)/o;
8986
} elsif ($arch =~ /^s390x?$/) {
9087
# 11160: a7 fb ff 60 aghi %r15,-160

0 commit comments

Comments
 (0)