about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc32/elf
diff options
context:
space:
mode:
authorWill Schmidt <will_schmidt@vnet.ibm.com>2011-12-17 15:07:31 -0500
committerUlrich Drepper <drepper@gmail.com>2011-12-17 15:07:31 -0500
commit91d2a8453f501c4fc6cadde9cf00e6cced17a40c (patch)
tree512de598cd4294aa681266dad0dfea09f9ca8570 /sysdeps/powerpc/powerpc32/elf
parenta1267ba1c6967afdc9ed9af16e3b42f5a240988e (diff)
downloadglibc-91d2a8453f501c4fc6cadde9cf00e6cced17a40c.tar.gz
glibc-91d2a8453f501c4fc6cadde9cf00e6cced17a40c.tar.xz
glibc-91d2a8453f501c4fc6cadde9cf00e6cced17a40c.zip
Simplify code for accessing powerpc GOT
Diffstat (limited to 'sysdeps/powerpc/powerpc32/elf')
-rw-r--r--sysdeps/powerpc/powerpc32/elf/start.S14
1 files changed, 6 insertions, 8 deletions
diff --git a/sysdeps/powerpc/powerpc32/elf/start.S b/sysdeps/powerpc/powerpc32/elf/start.S
index dc89a5e109..65e747fe9b 100644
--- a/sysdeps/powerpc/powerpc32/elf/start.S
+++ b/sysdeps/powerpc/powerpc32/elf/start.S
@@ -1,5 +1,5 @@
 /* Startup code for programs linked with GNU libc.
-   Copyright (C) 1998,1999,2000,2001,2002,2003,2009
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2009, 2011
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -59,10 +59,8 @@ ENTRY(_start)
  /* Set up an initial stack frame, and clear the LR.  */
 	clrrwi	r1,r1,4
 #ifdef PIC
-	bcl	20,31,L(branch)
-L(branch):
+	SETUP_GOT_ACCESS(r13,got_label)
 	li	r0,0
-	mflr	r13
 #else
 	li	r0,0
 #endif
@@ -73,10 +71,10 @@ L(branch):
     start_addresses in r8.  Also load the GOT pointer so that new PLT
     calls work, like the one to __libc_start_main.  */
 #ifdef PIC
-	addis	r30,r13,_GLOBAL_OFFSET_TABLE_-L(branch)@ha
-	addis	r8,r13,L(start_addresses)-L(branch)@ha
-	addi	r30,r30,_GLOBAL_OFFSET_TABLE_-L(branch)@l
-	lwzu	r13,L(start_addresses)-L(branch)@l(r8)
+	addis	r30,r13,_GLOBAL_OFFSET_TABLE_-got_label@ha
+	addis	r8,r13,L(start_addresses)-got_label@ha
+	addi	r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@l
+	lwzu	r13, L(start_addresses)-got_label@l(r8) 
 #else
 	lis	r8,L(start_addresses)@ha
 	lwzu	r13,L(start_addresses)@l(r8)