2015-09-12 03:18:08 +00:00
|
|
|
#ifdef __SH_FDPIC__
|
|
|
|
|
|
|
|
__asm__(
|
|
|
|
".text \n"
|
|
|
|
".global " START " \n"
|
|
|
|
START ": \n"
|
2015-09-22 20:51:59 +00:00
|
|
|
" tst r8, r8 \n"
|
|
|
|
" bf 1f \n"
|
|
|
|
" mov #68, r3 \n"
|
|
|
|
" add r3, r3 \n"
|
|
|
|
" mov #8, r4 \n"
|
|
|
|
" swap.w r4, r4 \n"
|
|
|
|
" trapa #31 \n"
|
|
|
|
" nop \n"
|
|
|
|
" nop \n"
|
|
|
|
" nop \n"
|
|
|
|
" nop \n"
|
|
|
|
"1: nop \n"
|
2015-09-22 04:14:07 +00:00
|
|
|
#ifndef SHARED
|
2015-09-12 03:18:08 +00:00
|
|
|
" mov r8, r4 \n"
|
|
|
|
" mova 1f, r0 \n"
|
|
|
|
" mov.l 1f, r5 \n"
|
|
|
|
" mov.l 1f+4, r6 \n"
|
|
|
|
" add r0, r5 \n"
|
2015-11-02 23:11:36 +00:00
|
|
|
" mov.l 4f, r1 \n"
|
|
|
|
"5: bsrf r1 \n"
|
2015-09-12 03:18:08 +00:00
|
|
|
" add r0, r6 \n"
|
|
|
|
" mov r0, r12 \n"
|
2015-09-22 04:14:07 +00:00
|
|
|
#endif
|
2015-09-22 03:54:42 +00:00
|
|
|
" mov r10, r5 \n"
|
2015-09-12 03:18:08 +00:00
|
|
|
" mov r15, r4 \n"
|
2015-09-22 03:54:42 +00:00
|
|
|
" mov.l r9, @-r15 \n"
|
|
|
|
" mov.l r8, @-r15 \n"
|
2015-09-12 03:18:08 +00:00
|
|
|
" mov #-16, r0 \n"
|
2015-11-02 23:11:36 +00:00
|
|
|
" mov.l 2f, r1 \n"
|
|
|
|
"3: bsrf r1 \n"
|
2015-09-12 03:18:08 +00:00
|
|
|
" and r0, r15 \n"
|
|
|
|
".align 2 \n"
|
|
|
|
"1: .long __ROFIXUP_LIST__@PCREL \n"
|
|
|
|
" .long __ROFIXUP_END__@PCREL + 4 \n"
|
2015-11-02 23:11:36 +00:00
|
|
|
"2: .long " START "_c@PCREL - (3b+4-.) \n"
|
|
|
|
#ifndef SHARED
|
|
|
|
"4: .long __fdpic_fixup@PCREL - (5b+4-.) \n"
|
|
|
|
#endif
|
2015-09-12 03:18:08 +00:00
|
|
|
);
|
|
|
|
|
2015-09-22 04:14:07 +00:00
|
|
|
#ifndef SHARED
|
2015-09-12 03:18:08 +00:00
|
|
|
#include "fdpic_crt.h"
|
2015-09-22 04:14:07 +00:00
|
|
|
#endif
|
2015-09-12 03:18:08 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
2015-04-13 06:56:26 +00:00
|
|
|
__asm__(
|
2015-05-22 05:50:05 +00:00
|
|
|
".text \n"
|
2015-04-13 06:56:26 +00:00
|
|
|
".global " START " \n"
|
|
|
|
START ": \n"
|
|
|
|
" mova 1f, r0 \n"
|
|
|
|
" mov.l 1f, r5 \n"
|
|
|
|
" add r0, r5 \n"
|
|
|
|
" mov r15, r4 \n"
|
|
|
|
" mov #-16, r0 \n"
|
2015-11-02 23:11:36 +00:00
|
|
|
" mov.l 2f, r1 \n"
|
|
|
|
"3: bsrf r1 \n"
|
|
|
|
" and r0, r15 \n"
|
2015-04-13 06:56:26 +00:00
|
|
|
".align 2 \n"
|
|
|
|
".weak _DYNAMIC \n"
|
|
|
|
".hidden _DYNAMIC \n"
|
|
|
|
"1: .long _DYNAMIC-. \n"
|
2015-11-02 23:11:36 +00:00
|
|
|
"2: .long " START "_c@PCREL - (3b+4-.) \n"
|
2015-04-13 06:56:26 +00:00
|
|
|
);
|
2014-03-16 21:17:28 +00:00
|
|
|
|
2015-09-12 03:18:08 +00:00
|
|
|
#endif
|
|
|
|
|
2014-03-16 21:17:28 +00:00
|
|
|
/* used by gcc for switching the FPU between single and double precision */
|
2015-04-13 06:56:26 +00:00
|
|
|
#ifdef SHARED
|
|
|
|
__attribute__((__visibility__("hidden")))
|
|
|
|
#endif
|
2014-03-16 21:17:28 +00:00
|
|
|
const unsigned long __fpscr_values[2] = { 0, 0x80000 };
|