authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-30 04:02:32+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-30 17:58:22+02:00
log78e581b86f11bfc8da277cbad7b7a30941e55e95
treefcbb7c27552d4e28903fd16a95385d3fdb35301c
parent38e0f049c531e83ec2eec80d50b624e6c3b8c486
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

start: Copy the mips64 comment about gp to the mips32 code.

Also, don't incorrectly claim that it's only needed for dynamic linking/PIC.

1 files changed, 1 insertions(+), 2 deletions(-)

lib/std/start.zig+1-2
......@@ -293,6 +293,7 @@ fn _start() callconv(.Naked) noreturn {
293293 \\ .gpword .
294294 \\ .gpword %[posixCallMainAndExit]
295295 \\ 1:
296 // The `gp` register on MIPS serves a similar purpose to `r2` (ToC pointer) on PPC64.
296297 \\ lw $gp, 0($ra)
297298 \\ subu $gp, $ra, $gp
298299 \\ lw $25, 4($ra)
......@@ -314,8 +315,6 @@ fn _start() callconv(.Naked) noreturn {
314315 \\ .gpdword %[posixCallMainAndExit]
315316 \\ 1:
316317 // The `gp` register on MIPS serves a similar purpose to `r2` (ToC pointer) on PPC64.
317 // We need to set it up in order for dynamically-linked / position-independent code to
318 // work.
319318 \\ ld $gp, 0($ra)
320319 \\ dsubu $gp, $ra, $gp
321320 \\ ld $25, 8($ra)