gcc-patches@gcc.gnu.org
[Top] [All Lists]

More files multilibbed on the Blackfin

Subject: More files multilibbed on the Blackfin
From: Bernd Schmidt
Date: Wed, 16 Nov 2005 14:27:57 +0100
I've committed this patch to trunk and gcc-4_0-branch. It adds a couple of start files to the set of files that need to be multilibbed on the Blackfin, which is necessary to get shared libraries to work on our uClinux port.


Bernd
        * 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__.

Index: config/bfin/crti.s
===================================================================
--- config/bfin/crti.s  (revision 107082)
+++ config/bfin/crti.s  (working copy)
@@ -38,10 +38,21 @@
        .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: config/bfin/t-bfin-elf
===================================================================
--- config/bfin/t-bfin-elf      (revision 107082)
+++ config/bfin/t-bfin-elf      (working copy)
@@ -32,3 +32,5 @@
 $(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
Index: config/bfin/bfin.h
===================================================================
--- config/bfin/bfin.h  (revision 107082)
+++ config/bfin/bfin.h  (working copy)
@@ -41,6 +41,11 @@
     {                                           \
       builtin_define ("bfin");                  \
       builtin_define ("BFIN");                  \
+      if (flag_pic)                            \
+       {                                       \
+         builtin_define ("__PIC__");           \
+         builtin_define ("__pic__");           \
+       }                                       \
     }                                           \
   while (0)
 #endif
Index: config/bfin/crtn.s
===================================================================
--- config/bfin/crtn.s  (revision 107082)
+++ config/bfin/crtn.s  (working copy)
@@ -36,8 +36,14 @@
 
        .section .init
        unlink; 
+#if defined __PIC__
+       P5 = [SP++];
+#endif
        rts;
 
        .section .fini
        unlink;
+#if defined __PIC__
+       P5 = [SP++];
+#endif
        rts;
<Prev in Thread] Current Thread [Next in Thread>
  • More files multilibbed on the Blackfin, Bernd Schmidt <=