]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
crti.s (__init, __fini): Use appropriate prologue if __PIC__ is defined.
authorBernd Schmidt <bernd.schmidt@analog.com>
Wed, 16 Nov 2005 13:20:06 +0000 (13:20 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Wed, 16 Nov 2005 13:20:06 +0000 (13:20 +0000)
* 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

gcc/ChangeLog
gcc/config/bfin/bfin.h
gcc/config/bfin/crti.s
gcc/config/bfin/crtn.s
gcc/config/bfin/t-bfin-elf

index 86d9228e4947a6e36bdd94c2dd4c09468c919aa2..dc84b221de79972deb7610234292ee9e45334bdf 100644 (file)
@@ -1,3 +1,12 @@
+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>
 
        PR 24357
index 0e6da5c08a887d7fe4ec60db0c3228cae4410f42..be4e565c37eb0f63a325d620afa1e8319a56c320 100644 (file)
@@ -41,6 +41,11 @@ extern int target_flags;
     {                                           \
       builtin_define ("bfin");                  \
       builtin_define ("BFIN");                  \
+      if (flag_pic)                            \
+       {                                       \
+         builtin_define ("__PIC__");           \
+         builtin_define ("__pic__");           \
+       }                                       \
     }                                           \
   while (0)
 #endif
index 7324e27ff88fab442c66959cf2f557fe37a922c7..84a98597c23b44b59923e5478cd5d39ff36b8130 100644 (file)
@@ -38,10 +38,21 @@ Boston, MA 02110-1301, USA.  */
        .globl  __init
        .type   __init,@function
 __init:
-       LINK 0;
-
+#if defined __PIC__
+       [--SP] = P5;
+#endif
+       LINK 12;
+#if defined __PIC__
+       P5 = [P5 + _current_shared_library_p5_offset_]
+#endif 
        .section .fini
        .globl  __fini
        .type   __fini,@function
 __fini:
-       LINK 0; 
+#if defined __PIC__
+       [--SP] = P5; 
+#endif
+       LINK 12; 
+#if defined __PIC__
+       P5 = [P5 + _current_shared_library_p5_offset_]
+#endif 
index 78ad7bb122136bd6a3cb7683da7d644da650f6be..69421fcfa582f762cb4a7bfafcf495d25dfd3077 100644 (file)
@@ -36,8 +36,14 @@ Boston, MA 02110-1301, USA.  */
 
        .section .init
        unlink; 
+#if defined __PIC__
+       P5 = [SP++];
+#endif
        rts;
 
        .section .fini
        unlink;
+#if defined __PIC__
+       P5 = [SP++];
+#endif
        rts;
index 928129c4331fcad2fd72d52492ba892d123445b5..aab2a1b7b5ae2cdd926d1af15eaaee0d41bae6ec 100644 (file)
@@ -32,3 +32,5 @@ $(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES)
 $(T)crtn.o: $(srcdir)/config/bfin/crtn.s $(GCC_PASSES)
        $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
        -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