summaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/eabi.asm
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/rs6000/eabi.asm')
-rw-r--r--gcc/config/rs6000/eabi.asm18
1 files changed, 12 insertions, 6 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