]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Simplify code for accessing powerpc GOT
authorWill Schmidt <will_schmidt@vnet.ibm.com>
Sat, 17 Dec 2011 20:07:31 +0000 (15:07 -0500)
committerUlrich Drepper <drepper@gmail.com>
Sat, 17 Dec 2011 20:07:31 +0000 (15:07 -0500)
32 files changed:
ChangeLog
sysdeps/powerpc/powerpc32/a2/memcpy.S
sysdeps/powerpc/powerpc32/dl-start.S
sysdeps/powerpc/powerpc32/elf/start.S
sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
sysdeps/powerpc/powerpc32/fpu/s_ceil.S
sysdeps/powerpc/powerpc32/fpu/s_ceilf.S
sysdeps/powerpc/powerpc32/fpu/s_floor.S
sysdeps/powerpc/powerpc32/fpu/s_floorf.S
sysdeps/powerpc/powerpc32/fpu/s_lround.S
sysdeps/powerpc/powerpc32/fpu/s_rint.S
sysdeps/powerpc/powerpc32/fpu/s_rintf.S
sysdeps/powerpc/powerpc32/fpu/s_round.S
sysdeps/powerpc/powerpc32/fpu/s_roundf.S
sysdeps/powerpc/powerpc32/fpu/s_trunc.S
sysdeps/powerpc/powerpc32/fpu/s_truncf.S
sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
sysdeps/powerpc/powerpc32/memset.S
sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
sysdeps/powerpc/powerpc32/power4/fpu/w_sqrt.S
sysdeps/powerpc/powerpc32/power4/fpu/w_sqrtf.S
sysdeps/powerpc/powerpc32/power5/fpu/w_sqrt.S
sysdeps/powerpc/powerpc32/power5/fpu/w_sqrtf.S
sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
sysdeps/powerpc/powerpc32/sysdep.h
sysdeps/unix/sysv/linux/powerpc/powerpc32/____longjmp_chk.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S

index 50c86e21076067b978cc05530d5e3c89679ed2d1..4aad7eec6ed09e2d407cc4f42a2e935124bc3091 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2011-11-21  Will Schmidt  <will_schmidt@vnet.ibm.com>
+
+       * powerpc/powerpc32/sysdep.h: Define SETUP_GOT_ACCESS() macro.
+       * powerpc/powerpc32/a2/memcpy.S: Use SETUP_GOT_ACCESS() macro.
+       * powerpc/powerpc32/dl-start.S: Likewise.
+       * powerpc/powerpc32/elf/start.S: Likewise.
+       * powerpc/powerpc32/fpu/__longjmp-common.S: Likewise.
+       * powerpc/powerpc32/fpu/s_ceil.S: Likewise.
+       * powerpc/powerpc32/fpu/s_ceilf.S: Likewise.
+       * powerpc/powerpc32/fpu/s_floor.S: Likewise.
+       * powerpc/powerpc32/fpu/s_floorf.S: Likewise.
+       * powerpc/powerpc32/fpu/s_lround.S: Likewise.
+       * powerpc/powerpc32/fpu/s_rint.S: Likewise.
+       * powerpc/powerpc32/fpu/s_rintf.S: Likewise.
+       * powerpc/powerpc32/fpu/s_round.S: Likewise.
+       * powerpc/powerpc32/fpu/s_roundf.S: Likewise.
+       * powerpc/powerpc32/fpu/s_trunc.S: Likewise.
+       * powerpc/powerpc32/fpu/s_truncf.S: Likewise.
+       * powerpc/powerpc32/fpu/setjmp-common.S: Likewise.
+       * powerpc/powerpc32/memset.S: Likewise.
+       * powerpc/powerpc32/power4/fpu/s_llround.S: Likewise.
+       * powerpc/powerpc32/power4/fpu/w_sqrt.S: Likewise.
+       * powerpc/powerpc32/power4/fpu/w_sqrtf.S: Likewise.
+       * powerpc/powerpc32/power5/fpu/w_sqrt.S: Likewise.
+       * powerpc/powerpc32/power5/fpu/w_sqrtf.S: Likewise.
+       * powerpc/powerpc32/power7/fpu/s_finite.S: Likewise.
+       * powerpc/powerpc32/power7/fpu/s_isinf.S: Likewise.
+       * powerpc/powerpc32/power7/fpu/s_isnan.S: Likewise.
+       * unix/sysv/linux/powerpc/powerpc32/____longjmp_chk.S: Likewise.
+       * unix/sysv/linux/powerpc/powerpc32/brk.S: Likewise.
+       * unix/sysv/linux/powerpc/powerpc32/getcontext-common.S: Likewise.
+       * unix/sysv/linux/powerpc/powerpc32/setcontext-common.S: Likewise.
+       * unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S: Likewise.
+
 2011-11-18  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
        * math/libm-test.inc: Added more nearbyint tests.
index 472f7a393b79e3cdba5df765ef577c02944c6781..f4c3c18414a988c04c456a935c748488a4ac670e 100644 (file)
@@ -1,5 +1,5 @@
 /* Optimized memcpy implementation for PowerPC A2.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
    Contributed by Michael Brutman <brutman@us.ibm.com>.
    This file is part of the GNU C Library.
 
@@ -113,11 +113,9 @@ L(dst_aligned):
        mflr    r0
 /* Establishes GOT addressability so we can load __cache_line_size
    from static. This value was set from the aux vector during startup.  */
-       bcl     20,31,1f
-1:
-       mflr    r9
-       addis   r9,r9,__cache_line_size-1b@ha
-       lwz     r9,__cache_line_size-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,__cache_line_size-got_label@ha
+       lwz     r9,__cache_line_size-got_label@l(r9)
        mtlr    r0
 #else
 /* Load __cache_line_size from static. This value was set from the
index ae41f47ede595f885fc3c348413b09e461369362..c2fcc374659533d1768eee737db9584ac537189b 100644 (file)
@@ -1,5 +1,6 @@
 /* Machine-dependent ELF startup code.  PowerPC version.
-   Copyright (C) 1995-2000, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-2000, 2002, 2004, 2005, 2006, 2011
+       Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -47,10 +48,9 @@ _dl_start_user:
    passed by value!).  */
 
 /*  Put our GOT pointer in r31, */
-       bcl     20,31,1f
-1:     mflr    r31
-       addis   r31,r31,_GLOBAL_OFFSET_TABLE_-1b@ha
-       addi    r31,r31,_GLOBAL_OFFSET_TABLE_-1b@l
+       SETUP_GOT_ACCESS(r31,got_label)
+       addis   r31,r31,_GLOBAL_OFFSET_TABLE_-got_label@ha
+       addi    r31,r31,_GLOBAL_OFFSET_TABLE_-got_label@l
 /*  the address of _start in r30, */
        mr      r30,r3
 /*  &_dl_argc in 29, &_dl_argv in 27, and _dl_loaded in 28.  */
index dc89a5e1095c8e1a2cb4a875bf3b2de2d27d9465..65e747fe9ba13b881e5d4170cbc8ac4ee1c996d7 100644 (file)
@@ -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)
index e1ac064a59ed5d072c28876c06b6afe4d9308698..b509ef3b31d8db38654e5324a3158c788f7fc409 100644 (file)
@@ -1,5 +1,6 @@
 /* longjmp for PowerPC.
-   Copyright (C) 1995-99, 2000, 2003-2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1995-99, 2000, 2003-2006, 2009, 2011
+       Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -34,10 +35,9 @@ ENTRY (BP_SYM (__longjmp))
 # ifdef PIC
        mflr    r6
        cfi_register (lr,r6)
-       bcl     20,31,1f
-1:     mflr    r5
-       addis   r5,r5,_GLOBAL_OFFSET_TABLE_-1b@ha
-       addi    r5,r5,_GLOBAL_OFFSET_TABLE_-1b@l
+       SETUP_GOT_ACCESS(r5,got_label)
+       addis   r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@ha
+       addi    r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@l
 #  ifdef SHARED
        lwz     r5,_rtld_global_ro@got(r5)
        mtlr    r6
index 80e72ca2bd3385f9c148441a046df64bcdf1c60a..a231448d37376368a6de68065f91e445ae774704 100644 (file)
@@ -1,5 +1,5 @@
 /* ceil function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -31,10 +31,9 @@ ENTRY (__ceil)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfs     fp13,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfs     fp13,.LC0-got_label@l(r9)
        mtlr    r11
        cfi_same_value (lr)
 #else
index ce6d71e4f8f0b0b9d46a6b6efb2b795c2d5fb6d2..bfd5c61e6db250cb51e24583538e6eb4c921dfee 100644 (file)
@@ -1,5 +1,5 @@
 /* float ceil function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -30,10 +30,9 @@ ENTRY (__ceilf)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfs     fp13,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfs     fp13,.LC0-got_label@l(r9)
        mtlr    r11
        cfi_same_value (lr)
 #else
index 0dd0dbe6c086ed0a481fc120aea0fb5887a7d2df..73971acb464f521216170bd50e80be10f2196d2b 100644 (file)
@@ -1,5 +1,5 @@
 /* Floor function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -31,10 +31,9 @@ ENTRY (__floor)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfs     fp13,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfs     fp13,.LC0-got_label@l(r9)
        mtlr    r11
        cfi_same_value (lr)
 #else
index 98a47458bc8f09fced7962bbd9a2effcb3db504d..562349e172ea17b43f9608af8b221e9ef3ced4a4 100644 (file)
@@ -1,5 +1,5 @@
 /* float Floor function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -30,10 +30,9 @@ ENTRY (__floorf)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfs     fp13,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfs     fp13,.LC0-got_label@l(r9)
        mtlr    r11
        cfi_same_value (lr)
 #else
index 3bf1ffaea16b9139bddd034ac17f877dfec765d3..b29ee9d28890bcc53c7d40c90f78642776cb02d1 100644 (file)
@@ -1,5 +1,5 @@
 /* lround function.  PowerPC32 version.
-   Copyright (C) 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2007, 2008, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -45,10 +45,9 @@ ENTRY (__lround)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfs     fp10,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfs     fp10,.LC0-got_label@l(r9)
        mtlr    r11
        cfi_same_value (lr)
 #else
index 93133718addc6a967a42c70e7e969bde81373f80..17cd0bd90d44b3e1fc20cf2a32717c4ff5dba750 100644 (file)
@@ -1,5 +1,5 @@
 /* Round to int floating-point values.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -33,10 +33,9 @@ ENTRY (__rint)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfs     fp13,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfs     fp13,.LC0-got_label@l(r9)
        mtlr    r11
        cfi_same_value (lr)
 #else
index 1e0fbb1f0dd29f5bc45164c4d34122e105c7335f..d5115bc253836d968cbe923504fed28de91e28a3 100644 (file)
@@ -1,5 +1,5 @@
 /* Round float to int floating-point values.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -29,10 +29,9 @@ ENTRY (__rintf)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfs     fp13,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfs     fp13,.LC0-got_label@l(r9)
        mtlr    r11
        cfi_same_value (lr)
 #else
index 48b346e651fd85bbd59a87f3873149adddd2fa59..dcb8dbedc2434a523866f244160595a8987327e0 100644 (file)
@@ -1,5 +1,5 @@
 /* round function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -43,10 +43,9 @@ ENTRY (__round)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       addi    r9,r9,.LC0-1b@l
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       addi    r9,r9,.LC0-got_label@l
        mtlr    r11
        cfi_same_value (lr)
        lfs     fp13,0(r9)
index 88125aad06f102ea5bdbd707696bba3d12f920fe..0da92512472559b5a85d4300e09e3695eb59fc1d 100644 (file)
@@ -1,5 +1,5 @@
 /* roundf  function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -42,10 +42,9 @@ ENTRY (__roundf )
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       addi    r9,r9,.LC0-1b@l
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       addi    r9,r9,.LC0-got_label@l
        mtlr    r11
        cfi_same_value (lr)
        lfs     fp13,0(r9)
index c3c021716a92f1408ea473d79fba545cae1ee95f..b731cb7c829fe7d6e245c3155e901c253d83caa2 100644 (file)
@@ -1,5 +1,5 @@
 /* trunc function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -38,10 +38,9 @@ ENTRY (__trunc)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfs     fp13,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfs     fp13,.LC0-got_label@l(r9)
        mtlr    r11
        cfi_same_value (lr)
 #else
index eddef070cd9460833ee4438cb8048defe06fd182..e14ec1b5d2e5e028f49a0e761f0950cc6226c2a3 100644 (file)
@@ -1,5 +1,5 @@
 /* truncf function.  PowerPC32 version.
-   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -37,10 +37,9 @@ ENTRY (__truncf)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfs     fp13,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfs     fp13,.LC0-got_label@l(r9)
        mtlr    r11
        cfi_same_value (lr)
 #else
index 131e7a332e7116c463e1c404e36c9667324a4bfb..90e20ba57af10e195cc0352a85c43e22c6e36fec 100644 (file)
@@ -1,5 +1,5 @@
 /* setjmp for PowerPC.
-   Copyright (C) 1995-2000, 2003-2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-2000, 2003-2005, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -85,10 +85,9 @@ ENTRY (BP_SYM (__sigsetjmp))
 # ifdef PIC
        mflr    r6
        cfi_register(lr,r6)
-       bcl     20,31,1f
-1:     mflr    r5
-       addis   r5,r5,_GLOBAL_OFFSET_TABLE_-1b@ha
-       addi    r5,r5,_GLOBAL_OFFSET_TABLE_-1b@l
+       SETUP_GOT_ACCESS(r5,got_label)
+       addis   r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@ha
+       addi    r5,r5,_GLOBAL_OFFSET_TABLE_-got_label@l
        mtlr    r6
        cfi_same_value (lr)
 #  ifdef SHARED
index b4ce218e24a828d721c8167abb6bfb6e286e66c3..9803e7efd847f00323fbd237e88c699afae5620c 100644 (file)
@@ -1,5 +1,6 @@
 /* Optimized memset implementation for PowerPC.
-   Copyright (C) 1997, 1999, 2000, 2003, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2000, 2003, 2007, 2011
+       Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -256,10 +257,9 @@ L(checklinesize):
        beq     L(medium)
 /* Establishes GOT addressability so we can load __cache_line_size
    from static. This value was set from the aux vector during startup.  */
-       bcl     20,31,1f
-1:     mflr    rGOT
-       addis   rGOT,rGOT,__cache_line_size-1b@ha
-       lwz     rCLS,__cache_line_size-1b@l(rGOT)
+       SETUP_GOT_ACCESS(rGOT,got_label)
+       addis   rGOT,rGOT,__cache_line_size-got_label@ha
+       lwz     rCLS,__cache_line_size-got_label@l(rGOT)
        mtlr    rTMP
 #else
 /* Load __cache_line_size from static. This value was set from the
index b03e041d8af2c67e4f6448794d008db8b5125f5e..591fcfb3c2694d56423f914cbb6bb783c2476836 100644 (file)
@@ -1,5 +1,5 @@
 /* llround function.  PowerPC32 on PowerPC64 version.
-   Copyright (C) 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2007, 2008, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -53,10 +53,9 @@ ENTRY (__llround)
 #ifdef SHARED
        mflr    r11
        cfi_register(lr,r11)
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       addi    r9,r9,.LC0-1b@l
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       addi    r9,r9,.LC0-got_label@l
        mtlr    r11
        cfi_same_value (lr)
        lfd     fp9,0(r9)
index c03dfa37f7caa68d629a4ce97e866e177ecf49eb..e04968e6fed4b64fb4184646f0f46e3b2b0aa077 100644 (file)
@@ -63,11 +63,9 @@ EALIGN (__sqrt, 5, 0)
        cfi_offset(lr,20-16)
        cfi_offset(r30,8-16)
 #ifdef SHARED
-       bcl     20,31,.LCF1
-.LCF1:
-       mflr    r30
-       addis   r30,r30,_GLOBAL_OFFSET_TABLE_-.LCF1@ha
-       addi    r30,r30,_GLOBAL_OFFSET_TABLE_-.LCF1@l
+       SETUP_GOT_ACCESS(r30,got_label)
+       addis   r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@ha
+       addi    r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@l
        lwz     r9,_LIB_VERSION@got(30)
        lwz     r0,0(r9)
 #else
index 050323da59bdfe880dfedb4d303db19750374148..356d3edacb7f585dbf2111e1c5e935ce0cbc01c7 100644 (file)
@@ -63,11 +63,9 @@ EALIGN (__sqrtf, 5, 0)
        cfi_offset(lr,20-16)
        cfi_offset(r30,8-16)
 #ifdef SHARED
-       bcl     20,31,.LCF1
-.LCF1:
-       mflr    r30
-       addis   r30,r30,_GLOBAL_OFFSET_TABLE_-.LCF1@ha
-       addi    r30,r30,_GLOBAL_OFFSET_TABLE_-.LCF1@l
+       SETUP_GOT_ACCESS(r30,got_label)
+       addis   r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@ha
+       addi    r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@l
        lwz     r9,_LIB_VERSION@got(30)
        lwz     r0,0(r9)
 #else
index 1c0f70dc54e4bd20ddfb628844608387a48a960d..f89b651e41f51aa05e5015b806afe03399feb62f 100644 (file)
@@ -63,11 +63,9 @@ EALIGN (__sqrt, 5, 0)
        cfi_offset(lr,20-16)
        cfi_offset(r30,8-16)
 #ifdef SHARED
-       bcl     20,31,.LCF1
-.LCF1:
-       mflr    r30
-       addis   r30,r30,_GLOBAL_OFFSET_TABLE_-.LCF1@ha
-       addi    r30,r30,_GLOBAL_OFFSET_TABLE_-.LCF1@l
+       SETUP_GOT_ACCESS(r30,got_label)
+       addis   r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@ha
+       addi    r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@l
        lwz     r9,_LIB_VERSION@got(30)
        lwz     r0,0(r9)
 #else
index e638cc102b78238dd0058ef558d75377aa0f1972..e9dde1676b17ab8f6467a3d15931c3a4e8b38a55 100644 (file)
@@ -63,11 +63,9 @@ EALIGN (__sqrtf, 5, 0)
        cfi_offset(lr,20-16)
        cfi_offset(r30,8-16)
 #ifdef SHARED
-       bcl     20,31,.LCF1
-.LCF1:
-       mflr    r30
-       addis   r30,r30,_GLOBAL_OFFSET_TABLE_-.LCF1@ha
-       addi    r30,r30,_GLOBAL_OFFSET_TABLE_-.LCF1@l
+       SETUP_GOT_ACCESS(r30,got_label)
+       addis   r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@ha
+       addi    r30,r30,_GLOBAL_OFFSET_TABLE_-got_label@l
        lwz     r9,_LIB_VERSION@got(30)
        lwz     r0,0(r9)
 #else
index 5b0d950c74ce79ffb3bfdf89e013790976b4c119..40e6679d116baf70ef02c67074cac2a239b965c6 100644 (file)
@@ -1,5 +1,5 @@
 /* finite().  PowerPC32/POWER7 version.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
    Contributed by Luis Machado <luisgpm@br.ibm.com>.
    This file is part of the GNU C Library.
 
@@ -35,10 +35,9 @@ ENTRY (__finite)
        mflr    r11
        cfi_register(lr,r11)
 
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfd     fp0,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfd     fp0,.LC0-got_label@l(r9)
 
        mtlr    r11
        cfi_same_value (lr)
index 29795349116d9b959733de6d651532c0bc4b8d96..a026583a1f0be7d52881961e8ea6197634c5cec3 100644 (file)
@@ -1,5 +1,5 @@
 /* isinf().  PowerPC32/POWER7 version.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
    Contributed by Luis Machado <luisgpm@br.ibm.com>.
    This file is part of the GNU C Library.
 
@@ -35,10 +35,9 @@ ENTRY (__isinf)
        mflr    r11
        cfi_register(lr,r11)
 
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfd     fp0,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfd     fp0,.LC0-got_label@l(r9)
 
        mtlr    r11
        cfi_same_value (lr)
index 852539f24b0c3ab53616c2c1305911fac754c2cb..123260bbbaa10a3dea589b89ddaf795d4a8b79f9 100644 (file)
@@ -1,5 +1,5 @@
 /* isnan().  PowerPC32/POWER7 version.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
    Contributed by Luis Machado <luisgpm@br.ibm.com>.
    This file is part of the GNU C Library.
 
@@ -35,10 +35,9 @@ ENTRY (__isnan)
        mflr    r11
        cfi_register(lr,r11)
 
-       bcl     20,31,1f
-1:     mflr    r9
-       addis   r9,r9,.LC0-1b@ha
-       lfd     fp0,.LC0-1b@l(r9)
+       SETUP_GOT_ACCESS(r9,got_label)
+       addis   r9,r9,.LC0-got_label@ha
+       lfd     fp0,.LC0-got_label@l(r9)
 
        mtlr    r11
        cfi_same_value (lr)
index 88cfe71e0bb88339be0a8b818ee2375c88dbc4ea..c824c0a85d1632c775e6a2451f4ea89e028fee71 100644 (file)
@@ -1,5 +1,6 @@
 /* Assembly macros for 32-bit PowerPC.
-   Copyright (C) 1999, 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002, 2003, 2006, 2011
+       Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
   cfi_startproc;                                                             \
   CALL_MCOUNT
 
+/* helper macro for accessing the 32-bit powerpc GOT. */
+
+#define        SETUP_GOT_ACCESS(regname,GOT_LABEL)                                   \
+       bcl     20,31,GOT_LABEL ;                                             \
+GOT_LABEL:                     ;                                             \
+       mflr    (regname)
+
 #define EALIGN_W_0  /* No words to insert.  */
 #define EALIGN_W_1  nop
 #define EALIGN_W_2  nop;nop
index cfd9864f63515517dfdbe0277bf48113dab1db97..2b97f01b471e8345a53be87a67d145e3b86e72ff 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2009, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 
 #ifdef PIC
 #  define LOAD_ARG \
-       bcl     20,31,1f;                               \
-1:     mflr    r3;                                     \
-       addis   r3,r3,_GLOBAL_OFFSET_TABLE_-1b@ha;      \
-       addi    r3,r3,_GLOBAL_OFFSET_TABLE_-1b@l;       \
+       SETUP_GOT_ACCESS(r3,got_label2);                        \
+       addis   r3,r3,_GLOBAL_OFFSET_TABLE_-got_label2@ha;      \
+       addi    r3,r3,_GLOBAL_OFFSET_TABLE_-got_label2@l;       \
        lwz     r3,.LC0@got(r3)
 #else
 # define LOAD_ARG \
index 4c8c6b433b1538cdbc52c87a06e7d5cdb2d952aa..928ba217bcbcf1f26c28c68a0b05d43fa6084473 100644 (file)
@@ -1,5 +1,5 @@
 /* brk system call for Linux/ppc.
-   Copyright (C) 1995-97, 1999, 2000, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-97, 1999, 2000, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -36,10 +36,9 @@ ENTRY (BP_SYM (__brk))
        DO_CALL(SYS_ify(brk))
        lwz     r6,8(r1)
 #ifdef PIC
-       bcl     20,31,1f
-1:     mflr    r5
-       addis   r5,r5,__curbrk-1b@ha
-       stw     r3,__curbrk-1b@l(r5)
+       SETUP_GOT_ACCESS(r5,got_label)
+       addis   r5,r5,__curbrk-got_label@ha
+       stw     r3,__curbrk-got_label@l(r5)
 #else
        lis     r4,__curbrk@ha
        stw     r3,__curbrk@l(r4)
index 27285ed4a53fabcafd7c161e4a90cf5de64deca1..f55c0730f1b94852bc52bfdb67658748543cf932 100644 (file)
@@ -1,5 +1,5 @@
 /* Save current context, powerpc32 common.
-   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -145,10 +145,9 @@ ENTRY(__CONTEXT_FUNC_NAME)
 # ifdef __CONTEXT_ENABLE_VRS
 #  ifdef PIC
        mflr    r8
-       bcl     20,31,1f
-1:     mflr    r7
-       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
-       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+       SETUP_GOT_ACCESS(r7,got_label)
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@l
 #   ifdef SHARED
        lwz     r7,_rtld_global_ro@got(r7)
        mtlr    r8
index f30409086808b8e3832ac11c4f3c1da42371e865..a2f419b0e18bb36657ce18323adc5a868c632542 100644 (file)
@@ -1,5 +1,5 @@
 /* Jump to a new context powerpc32 common.
-   Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -73,10 +73,9 @@ ENTRY(__CONTEXT_FUNC_NAME)
 
 #ifdef PIC
        mflr    r8
-       bcl     20,31,1f
-1:     mflr    r7
-       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
-       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+       SETUP_GOT_ACCESS(r7,got_label)
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@l
 # ifdef SHARED
        lwz     r7,_rtld_global_ro@got(r7)
        mtlr    r8
index 62efee2dcee4fffd5cb13520fe790453277a77ce..19dfcf840241a52f59144551ca84efafd12c0f01 100644 (file)
@@ -1,5 +1,5 @@
 /* Save current context and jump to a new context.
-   Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -146,10 +146,9 @@ ENTRY(__CONTEXT_FUNC_NAME)
 
 # ifdef PIC
        mflr    r8
-       bcl     20,31,1f
-1:     mflr    r7
-       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
-       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+       SETUP_GOT_ACCESS(r7,got_label)
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@l
 #  ifdef SHARED
        lwz     r7,_rtld_global_ro@got(r7)
        mtlr    r8
@@ -299,10 +298,9 @@ ENTRY(__CONTEXT_FUNC_NAME)
 #  ifdef PIC
        mflr    r8
 #   ifdef HAVE_ASM_PPC_REL16
-       bcl     20,31,5f
-5:     mflr    r7
-       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-5b@ha
-       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-5b@l
+       SETUP_GOT_ACCESS(r7,got_label)
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-got_label@l
 #   else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r7