| ... | ... | @@ -259,6 +259,15 @@ fn _start() callconv(.Naked) noreturn { |
| 259 | 259 | \\ and sp, x0, #-16 |
| 260 | 260 | \\ b %[posixCallMainAndExit] |
| 261 | 261 | , |
| 262 | .arc => |
| 263 | // The `arc` tag currently means ARCv2, which has an unusually low stack alignment |
| 264 | // requirement. ARCv3 increases it from 4 to 16, but we don't support ARCv3 yet. |
| 265 | \\ mov fp, 0 |
| 266 | \\ mov blink, 0 |
| 267 | \\ mov r0, sp |
| 268 | \\ and sp, sp, -4 |
| 269 | \\ b %[posixCallMainAndExit] |
| 270 | , |
| 262 | 271 | .arm, .armeb, .thumb, .thumbeb => |
| 263 | 272 | \\ mov fp, #0 |
| 264 | 273 | \\ mov lr, #0 |
| ... | ... | @@ -266,6 +275,33 @@ fn _start() callconv(.Naked) noreturn { |
| 266 | 275 | \\ and sp, #-16 |
| 267 | 276 | \\ b %[posixCallMainAndExit] |
| 268 | 277 | , |
| 278 | // zig fmt: off |
| 279 | .csky => |
| 280 | if (builtin.position_independent_code) |
| 281 | // The CSKY ABI assumes that `gb` is set to the address of the GOT in order for |
| 282 | // position-independent code to work. We depend on this in `std.os.linux.start_pie` |
| 283 | // to locate `_DYNAMIC` as well. |
| 284 | \\ grs t0, 1f |
| 285 | \\ 1: |
| 286 | \\ lrw gb, 1b@GOTPC |
| 287 | \\ addu gb, t0 |
| 288 | else "" |
| 289 | ++ |
| 290 | \\ movi lr, 0 |
| 291 | \\ mov a0, sp |
| 292 | \\ andi sp, sp, -8 |
| 293 | \\ jmpi %[posixCallMainAndExit] |
| 294 | , |
| 295 | // zig fmt: on |
| 296 | .hexagon => |
| 297 | // r29 = SP, r30 = FP |
| 298 | \\ r30 = #0 |
| 299 | \\ r0 = r29 |
| 300 | \\ r29 = and(r29, #-16) |
| 301 | \\ memw(r29 + #-8) = r29 |
| 302 | \\ r29 = add(r29, #-8) |
| 303 | \\ call %[posixCallMainAndExit] |
| 304 | , |
| 269 | 305 | .loongarch32, .loongarch64 => |
| 270 | 306 | \\ move $fp, $zero |
| 271 | 307 | \\ move $a0, $sp |