musl/arch/powerpc/crt_arch.h
Rich Felker 63caf1d207 add .text section directive to all crt_arch.h files missing it
i386 and x86_64 versions already had the .text directive; other archs
did not. normally, top-level (file scope) __asm__ starts in the .text
section anyway, but problems were reported with some versions of
clang, and it seems preferable to set it explicitly anyway, at least
for the sake of consistency between archs.
2015-05-22 01:50:05 -04:00

21 lines
343 B
C

__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"
);