summaryrefslogtreecommitdiff
path: root/arch/powerpc/crt_arch.h
diff options
context:
space:
mode:
authorVladimir Azarov <avm@intermediate-node.net>2024-10-01 15:47:05 +0200
committerVladimir Azarov <avm@intermediate-node.net>2024-10-01 15:47:05 +0200
commit4abab5ad6c8465a7528ccdd5f49367da05f78bbd (patch)
treeebf009bf1376a5a223a915bc27cbbd791a1316bc /arch/powerpc/crt_arch.h
Initial version
Diffstat (limited to 'arch/powerpc/crt_arch.h')
-rw-r--r--arch/powerpc/crt_arch.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/powerpc/crt_arch.h b/arch/powerpc/crt_arch.h
new file mode 100644
index 0000000..9b65886
--- /dev/null
+++ b/arch/powerpc/crt_arch.h
@@ -0,0 +1,20 @@
+__asm__(
+".text \n"
+".global " START " \n"
+".type " START ", %function \n"
+START ": \n"
+" bl 1f \n"
+".weak _DYNAMIC \n"
+".hidden _DYNAMIC \n"
+" .long _DYNAMIC-. \n"
+"1: mflr 4 \n"
+" lwz 3, 0(4) \n"
+" add 4, 3, 4 \n"
+" mr 3, 1 \n"
+" clrrwi 1, 1, 4 \n"
+" li 0, 0 \n"
+" stwu 1, -16(1) \n"
+" mtlr 0 \n"
+" stw 0, 0(1) \n"
+" bl " START "_c \n"
+);