mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-07 14:24:43 +00:00
This is from Qualcomm's fork: https://github.com/quic/musl I maintain a fork of musl where I rebase Qualcomm's changes on top of the latest musl release, which I then use as the basis for musl updates in Zig. My fork can be found here: https://github.com/alexrp/musl/tree/hexagon
22 lines
567 B
C
Vendored
22 lines
567 B
C
Vendored
__asm__(
|
|
".weak _DYNAMIC \n"
|
|
".hidden _DYNAMIC \n"
|
|
".text \n"
|
|
".global " START " \n"
|
|
".type " START ", %function \n"
|
|
START ": \n"
|
|
" // Find _DYNAMIC\n"
|
|
" jump 1f\n"
|
|
".word _DYNAMIC - .\n"
|
|
"1: r2 = pc\n"
|
|
" r2 = add(r2, #-4)\n"
|
|
" r1 = memw(r2)\n"
|
|
" r1 = add(r2, r1)\n"
|
|
" r30 = #0 // Signals the end of backtrace\n"
|
|
" r0 = r29 // Pointer to argc/argv\n"
|
|
" r29 = and(r29, #-16) // Align\n"
|
|
" memw(r29+#-8) = r29\n"
|
|
" r29 = add(r29, #-8)\n"
|
|
" call " START "_c \n"
|
|
".size " START ", .-" START "\n"
|
|
);
|