| ... | ... | @@ -272,21 +272,27 @@ fn _start() callconv(.Naked) noreturn { |
| 272 | 272 | \\ bstrins.d $sp, $zero, 3, 0 |
| 273 | 273 | \\ b %[posixCallMainAndExit] |
| 274 | 274 | , |
| 275 | // zig fmt: off |
| 275 | 276 | .riscv32, .riscv64 => |
| 276 | | // The RISC-V ELF ABI assumes that `gp` is set to the value of `__global_pointer$` at |
| 277 | | // startup in order for GP relaxation to work, even in static builds. |
| 278 | | \\ .weak __global_pointer$ |
| 279 | | \\ .hidden __global_pointer$ |
| 280 | | \\ .option push |
| 281 | | \\ .option norelax |
| 282 | | \\ lla gp, __global_pointer$ |
| 283 | | \\ .option pop |
| 277 | // The self-hosted riscv64 backend is not able to assemble this yet. |
| 278 | if (builtin.zig_backend != .stage2_riscv64) |
| 279 | // The RISC-V ELF ABI assumes that `gp` is set to the value of `__global_pointer$` at |
| 280 | // startup in order for GP relaxation to work, even in static builds. |
| 281 | \\ .weak __global_pointer$ |
| 282 | \\ .hidden __global_pointer$ |
| 283 | \\ .option push |
| 284 | \\ .option norelax |
| 285 | \\ lla gp, __global_pointer$ |
| 286 | \\ .option pop |
| 287 | else "" |
| 288 | ++ |
| 284 | 289 | \\ li s0, 0 |
| 285 | 290 | \\ li ra, 0 |
| 286 | 291 | \\ mv a0, sp |
| 287 | 292 | \\ andi sp, sp, -16 |
| 288 | 293 | \\ tail %[posixCallMainAndExit]@plt |
| 289 | 294 | , |
| 295 | // zig fmt: off |
| 290 | 296 | .m68k => |
| 291 | 297 | // Note that the - 8 is needed because pc in the jsr instruction points into the middle |
| 292 | 298 | // of the jsr instruction. (The lea is 6 bytes, the jsr is 4 bytes.) |