aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-07-24 17:36:34 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2024-07-24 21:56:54 +0200
commitce81525f3f3057e4239332b2152bf60f75c5f52a (patch)
treea7e5852b3ea78c86bf38cfffd13ff21e04121f61 /lib
parent52653ec82bcc8e10fee9b6d9997b2de41a22a93a (diff)
downloadzig-ce81525f3f3057e4239332b2152bf60f75c5f52a.tar.gz
zig-ce81525f3f3057e4239332b2152bf60f75c5f52a.zip
start: Align the stack on s390x just in case.
The kernel does this as required, but we cannot trust dynamic linkers to do it.
Diffstat (limited to 'lib')
-rw-r--r--lib/std/start.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig
index 015f2c077f..437498d1d8 100644
--- a/lib/std/start.zig
+++ b/lib/std/start.zig
@@ -373,8 +373,9 @@ fn _start() callconv(.Naked) noreturn {
,
.s390x =>
// Set up the stack frame (register save area and cleared back-chain slot).
- // Note: Stack pointer is guaranteed by ABI to be 8-byte aligned as required.
\\ lgr %r2, %r15
+ \\ lghi %r0, -16
+ \\ ngr %r15, %r0
\\ aghi %r15, -160
\\ lghi %r0, 0
\\ stg %r0, 0(%r15)