Commit c2baf133 by Michael Meissner

Define _RELOCATABLE if -mrelocatable; Rewrite eabi.asm for use with -mrelocatable.

From-SVN: r9130
parent 8a552066
...@@ -5,19 +5,25 @@ ...@@ -5,19 +5,25 @@
.section ".text" .section ".text"
.globl __eabi .globl __eabi
.long 0x4000 # traceback table .section ".got2","aw"
__eabi: mflr 0 .LCTOC1 = .+32768
bl .Laddr # get current address
# Table of addresses # Table of addresses
.Ltable: .Ltable = .-.LCTOC1
.long .Ltable # address we are really at .long .Laddr # address we are really at
.long _GLOBAL_OFFSET_TABLE_ # normal GOT address .long _GLOBAL_OFFSET_TABLE_ # normal GOT address
.long _GOT2_START_ # -mrelocatable GOT pointers start .long _GOT2_START_ # -mrelocatable GOT pointers start
.long _GOT2_END_ # -mrelocatable GOT pointers end .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 .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 subf. 12,12,11 # calculate difference
bc 4,2,.Lreloc # skip if we need to relocate bc 4,2,.Lreloc # skip if we need to relocate
......
...@@ -262,8 +262,34 @@ extern int rs6000_pic_labelno; ...@@ -262,8 +262,34 @@ extern int rs6000_pic_labelno;
#undef TARGET_VERSION #undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)"); #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 #undef CPP_PREDEFINES
#define CPP_PREDEFINES \ #define CPP_PREDEFINES \
"-DPPC -Dunix -D__svr4__ -Asystem(unix) -Asystem(svr4) -Acpu(powerpc) -Amachine(powerpc)" "-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}"
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