summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/rs6000/eabi.asm18
-rw-r--r--gcc/config/rs6000/sysv4.h30
2 files changed, 40 insertions, 8 deletions
diff --git a/gcc/config/rs6000/eabi.asm b/gcc/config/rs6000/eabi.asm
index 996f600b3ef..b903d2bb4d0 100644
--- a/gcc/config/rs6000/eabi.asm
+++ b/gcc/config/rs6000/eabi.asm
@@ -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
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index a51988d8182..4a4ee0ac2a0 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -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}"