|
@@ -11,10 +11,13 @@
|
|
|
#if defined(__FDPIC__)
|
|
|
#if !defined(__thumb__) || defined(__thumb2__)
|
|
|
__asm__(
|
|
|
- " .arm\n"
|
|
|
" .text\n"
|
|
|
" .globl _start\n"
|
|
|
" .type _start,%function\n"
|
|
|
+#if defined(__thumb2__)
|
|
|
+ " .thumb_func\n"
|
|
|
+#endif
|
|
|
+ " .align 2\n"
|
|
|
"_start:\n"
|
|
|
/* We compute the parameters for __self_reloc:
|
|
|
- r0 is a pointer to the loadmap (either from r8 or r7 if rtld is
|
|
@@ -25,12 +28,17 @@ __asm__(
|
|
|
__self_reloc will fix indirect addresses in .rofixup
|
|
|
section and will return the relocated GOT value.
|
|
|
*/
|
|
|
+#if defined(__thumb2__)
|
|
|
+ " sub r4, pc, #4\n"
|
|
|
+#else
|
|
|
" sub r4, pc, #8\n"
|
|
|
+#endif
|
|
|
" ldr r1, .L__ROFIXUP_LIST__\n"
|
|
|
" add r1, r1, r4\n"
|
|
|
" ldr r2, .L__ROFIXUP_END__\n"
|
|
|
" add r2, r2, r4\n"
|
|
|
" movs r0, r8\n"
|
|
|
+ " it eq\n"
|
|
|
" moveq r0, r7\n"
|
|
|
" push {r7, r8, r9, r10}\n"
|
|
|
" bl __self_reloc;\n"
|