Commit 0d88914b by Bernd Schmidt Committed by Bernd Schmidt

crti.s (__init, __fini): Use appropriate prologue if __PIC__ is defined.

	* config/bfin/crti.s (__init, __fini): Use appropriate prologue if
	__PIC__ is defined.
	* config/bfin/crtn.s: Change epilogues to match.
	* config/bfin/t-bfin-elf (EXTRA_MULTILIB_PARTS): Define.
	* config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): If flag_pic, define
	__PIC__ and __pic__.

From-SVN: r107083
parent b381d30b
2005-11-16 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/crti.s (__init, __fini): Use appropriate prologue if
__PIC__ is defined.
* config/bfin/crtn.s: Change epilogues to match.
* config/bfin/t-bfin-elf (EXTRA_MULTILIB_PARTS): Define.
* config/bfin/bfin.h (TARGET_CPU_CPP_BUILTINS): If flag_pic, define
__PIC__ and __pic__.
2005-11-16 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> 2005-11-16 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR 24357 PR 24357
......
...@@ -41,6 +41,11 @@ extern int target_flags; ...@@ -41,6 +41,11 @@ extern int target_flags;
{ \ { \
builtin_define ("bfin"); \ builtin_define ("bfin"); \
builtin_define ("BFIN"); \ builtin_define ("BFIN"); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
builtin_define ("__pic__"); \
} \
} \ } \
while (0) while (0)
#endif #endif
......
...@@ -38,10 +38,21 @@ Boston, MA 02110-1301, USA. */ ...@@ -38,10 +38,21 @@ Boston, MA 02110-1301, USA. */
.globl __init .globl __init
.type __init,@function .type __init,@function
__init: __init:
LINK 0; #if defined __PIC__
[--SP] = P5;
#endif
LINK 12;
#if defined __PIC__
P5 = [P5 + _current_shared_library_p5_offset_]
#endif
.section .fini .section .fini
.globl __fini .globl __fini
.type __fini,@function .type __fini,@function
__fini: __fini:
LINK 0; #if defined __PIC__
[--SP] = P5;
#endif
LINK 12;
#if defined __PIC__
P5 = [P5 + _current_shared_library_p5_offset_]
#endif
...@@ -36,8 +36,14 @@ Boston, MA 02110-1301, USA. */ ...@@ -36,8 +36,14 @@ Boston, MA 02110-1301, USA. */
.section .init .section .init
unlink; unlink;
#if defined __PIC__
P5 = [SP++];
#endif
rts; rts;
.section .fini .section .fini
unlink; unlink;
#if defined __PIC__
P5 = [SP++];
#endif
rts; rts;
...@@ -32,3 +32,5 @@ $(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES) ...@@ -32,3 +32,5 @@ $(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES)
$(T)crtn.o: $(srcdir)/config/bfin/crtn.s $(GCC_PASSES) $(T)crtn.o: $(srcdir)/config/bfin/crtn.s $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/bfin/crtn.s -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/bfin/crtn.s
EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crti.o crtn.o
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment