We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 389ce98 commit 108c682Copy full SHA for 108c682
lib/std/start.zig
@@ -316,6 +316,24 @@ fn _start() callconv(.Naked) noreturn {
316
\\ and sp, #-16
317
\\ b %[posixCallMainAndExit]
318
,
319
+ // zig fmt: off
320
+ .csky =>
321
+ if (builtin.position_independent_code)
322
+ // The CSKY ABI assumes that `gb` is set to the address of the GOT in order for
323
+ // position-independent code to work. We depend on this in `std.os.linux.start_pie`
324
+ // to locate `_DYNAMIC` as well.
325
+ \\ grs t0, 1f
326
+ \\ 1:
327
+ \\ lrw gb, 1b@GOTPC
328
+ \\ addu gb, t0
329
+ else ""
330
+ ++
331
+ \\ movi lr, 0
332
+ \\ mov a0, sp
333
+ \\ andi sp, sp, -8
334
+ \\ jmpi %[posixCallMainAndExit]
335
+ ,
336
+ // zig fmt: on
337
.hexagon =>
338
// r29 = SP, r30 = FP
339
\\ r30 = #0
0 commit comments