Define _RELOCATABLE if -mrelocatable; Rewrite eabi.asm for use with -mrelocatable.
authorMichael Meissner <meissner@gcc.gnu.org>
Wed, 8 Mar 1995 16:42:26 +0000 (16:42 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Wed, 8 Mar 1995 16:42:26 +0000 (16:42 +0000)
From-SVN: r9130

gcc/config/rs6000/eabi.asm
gcc/config/rs6000/sysv4.h

index 996f600b3ef0db2161863333bed6c70ba61ff01f..b903d2bb4d079a2325bc7fb41711085c62cb913c 100644 (file)
@@ -5,19 +5,25 @@
        .section ".text"
        .globl   __eabi
 
-       .long   0x4000                          # traceback table
-__eabi:        mflr    0
-       bl      .Laddr                          # get current address
+        .section ".got2","aw"
+.LCTOC1 = .+32768
 
 # Table of addresses
-.Ltable:
-       .long   .Ltable                         # address we are really at
+.Ltable = .-.LCTOC1
+       .long   .Laddr                          # address we are really at
        .long   _GLOBAL_OFFSET_TABLE_           # normal GOT address
        .long   _GOT2_START_                    # -mrelocatable GOT pointers start
        .long   _GOT2_END_                      # -mrelocatable GOT pointers end
 
+       .text
+.Lptr: .long   .LCTOC1-.Laddr                  # PC relative pointer to .got2
+       .long   0x4000                          # traceback table
+
+__eabi:        mflr    0
+       bl      .Laddr                          # get current address
 .Laddr:        mflr    11                              # real address of .Ltable
-       lwz     12,0(11)                        # linker generated address of .Ltable
+       lwz     12,(.Laddr-.Lptr)(11)           # linker generated address of .Ltable
+       add     12,12,11                        # correct to real pointer
        subf.   12,12,11                        # calculate difference
        bc      4,2,.Lreloc                     # skip if we need to relocate
 
index a51988d81827100d2a9800885c4fbbe3b3848770..4a4ee0ac2a093516fe068e393bacc4990a01de8c 100644 (file)
@@ -262,8 +262,34 @@ extern int rs6000_pic_labelno;
 #undef TARGET_VERSION
 #define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
 
-/* FIXME: These should actually indicate PowerPC, when there is some
-   standard way of expressing that.  */
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES \
   "-DPPC -Dunix -D__svr4__ -Asystem(unix) -Asystem(svr4) -Acpu(powerpc) -Amachine(powerpc)"
+
+#undef CPP_SPEC
+#define CPP_SPEC "\
+%{posix: -D_POSIX_SOURCE} \
+%{mrelocatable: -D_RELOCATABLE} \
+%{!mcpu*: \
+  %{mpower: %{!mpower2: -D_ARCH_PWR}} \
+  %{mpower2: -D_ARCH_PWR2} \
+  %{mpowerpc*: -D_ARCH_PPC} \
+  %{mno-powerpc: %{!mpower: %{!mpower2: -D_ARCH_COM}}} \
+  %{!mno-powerpc: -D_ARCH_PPC}} \
+%{mcpu=common: -D_ARCH_COM} \
+%{mcpu=power: -D_ARCH_PWR} \
+%{mcpu=powerpc: -D_ARCH_PPC} \
+%{mcpu=rios: -D_ARCH_PWR} \
+%{mcpu=rios1: -D_ARCH_PWR} \
+%{mcpu=rios2: -D_ARCH_PWR2} \
+%{mcpu=rsc: -D_ARCH_PWR} \
+%{mcpu=rsc1: -D_ARCH_PWR} \
+%{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
+%{mcpu=mpc601: -D_ARCH_PPC -D_ARCH_PWR} \
+%{mcpu=ppc601: -D_ARCH_PPC -D_ARCH_PWR} \
+%{mcpu=603: -D_ARCH_PPC} \
+%{mcpu=mpc603: -D_ARCH_PPC} \
+%{mcpu=ppc603: -D_ARCH_PPC} \
+%{mcpu=604: -D_ARCH_PPC} \
+%{mcpu=mpc604: -D_ARCH_PPC} \
+%{mcpu=ppc604: -D_ARCH_PPC}"