authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-24 17:38:54+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-24 20:12:14+02:00
log5c96192c196c3a43f43de26c8256ed9a784f5140
treea0a7ba035a22f8e0596360551c2771b8b201746c
parent4de8bba648c6ab9e2f3a05f3f90ba6524520d3c0
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

start: Add a comment explaining our paranoid stance on ABI guarantees.


1 files changed, 6 insertions(+), 0 deletions(-)

lib/std/start.zig+6
......@@ -272,6 +272,12 @@ fn _start() callconv(.Naked) noreturn {
272272 : [tos] "={rax}" (-> *std.os.plan9.Tos),
273273 );
274274 }
275
276 // Note that we maintain a very low level of trust with regards to ABI guarantees at this point.
277 // We will redundantly align the stack, clear the link register, etc. While e.g. the Linux
278 // kernel is usually good about upholding the ABI guarantees, the same cannot be said of dynamic
279 // linkers; musl's ldso, for example, opts to not align the stack when invoking the dynamic
280 // linker explicitly.
275281 asm volatile (switch (native_arch) {
276282 .x86_64 =>
277283 \\ xorl %%ebp, %%ebp