* sysdeps/unix/sparc/sysdep.h (SPARC_PIC_THUNK): New macro.
(SETUP_PIC_REG): Use SPARC_PIC_THUNK and don't save and restore
%o7 across the call.
(SETUP_PIC_REG_LEAF): Do %o7 save/restore in this new macro
instead.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Use
SETUP_PIC_REG_LEAF.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
* sysdeps/sparc/crti.S: Use SETUP_PIC_REG.
* sysdeps/sparc/crtn.S: Likewise.
+2012-02-18 David S. Miller <davem@davemloft.net>
+
+ * sysdeps/unix/sparc/sysdep.h (SPARC_PIC_THUNK): New macro.
+ (SETUP_PIC_REG): Use SPARC_PIC_THUNK and don't save and restore
+ %o7 across the call.
+ (SETUP_PIC_REG_LEAF): Do %o7 save/restore in this new macro
+ instead.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Use
+ SETUP_PIC_REG_LEAF.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise.
+ * sysdeps/sparc/crti.S: Use SETUP_PIC_REG.
+ * sysdeps/sparc/crtn.S: Likewise.
+
2012-02-17 Ulrich Drepper <drepper@gmail.com>
* aout/Makefile: Remove.
_init:
save %sp, -STACKFRAME_SIZE, %sp
#if PREINIT_FUNCTION_WEAK
- sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
- call __sparc_get_pc_thunk.l7
- add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
+ SETUP_PIC_REG(l7)
sethi %hi(PREINIT_FUNCTION), %g1
or %g1, %lo(PREINIT_FUNCTION), %g1
GOT_LOAD [%l7 + %g1], %g1
.type _fini, @function
_fini:
save %sp, -STACKFRAME_SIZE, %sp
-
- .section .text.__sparc_get_pc_thunk.l7,"axG",@progbits,__sparc_get_pc_thunk.l7,comdat
- .p2align 2
- .weak __sparc_get_pc_thunk.l7
- .hidden __sparc_get_pc_thunk.l7
- .type __sparc_get_pc_thunk.l7, #function
-__sparc_get_pc_thunk.l7:
- jmp %o7 + 8
- add %o7, %l7, %l7
C name space. Make sure we use an innocuous name. */
#define syscall_error C_SYMBOL_NAME(__syscall_error)
-#ifdef PIC
-#define SETUP_PIC_REG(reg, tmp) \
+#define SPARC_PIC_THUNK(reg) \
.ifndef __sparc_get_pc_thunk.reg; \
.section .text.__sparc_get_pc_thunk.reg,"axG",@progbits,__sparc_get_pc_thunk.reg,comdat; \
.align 32; \
jmp %o7 + 8; \
add %o7, %reg, %##reg; \
.previous; \
- .endif; \
+ .endif;
+
+#define SETUP_PIC_REG(reg) \
+ SPARC_PIC_THUNK(reg) \
+ sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %##reg; \
+ call __sparc_get_pc_thunk.reg; \
+ or %##reg, %lo(_GLOBAL_OFFSET_TABLE_+4), %##reg;
+
+#define SETUP_PIC_REG_LEAF(reg, tmp) \
+ SPARC_PIC_THUNK(reg) \
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %##reg; \
mov %o7, %##tmp; \
call __sparc_get_pc_thunk.reg; \
or %##reg, %lo(_GLOBAL_OFFSET_TABLE_+4), %##reg; \
mov %##tmp, %o7;
-#endif
#define ENTRY(name) \
.global C_SYMBOL_NAME(name); \
-/* Copyright (C) 1997, 2002, 2003, 2004, 2006, 2008, 2011
+/* Copyright (C) 1997, 2002, 2003, 2004, 2006, 2008, 2011, 2012
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997.
#else
# if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG(o2,g1) \
+0: SETUP_PIC_REG_LEAF(o2,g1) \
sethi %hi(rtld_errno), %g1; \
or %g1, %lo(rtld_errno), %g1; \
ld [%o2 + %g1], %g1; \
# else
# define SYSCALL_ERROR_ERRNO errno
# endif
-# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG(o2,g1) \
+# define SYSCALL_ERROR_HANDLER \
+0: SETUP_PIC_REG_LEAF(o2,g1) \
sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
ld [%o2 + %g1], %g1, %tie_ld(SYSCALL_ERROR_ERRNO); \
mov -1, %o0;
# else
# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG(o2,g1) \
+0: SETUP_PIC_REG_LEAF(o2,g1) \
sethi %hi(errno), %g1; \
or %g1, %lo(errno), %g1; \
ld [%o2 + %g1], %g1; \
-/* Copyright (C) 1997, 2000, 2002, 2003, 2004, 2006, 2008, 2011
+/* Copyright (C) 1997, 2000, 2002, 2003, 2004, 2006, 2008, 2011, 2012
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
#else
# if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG(o2,g1) \
+0: SETUP_PIC_REG_LEAF(o2,g1) \
sethi %hi(rtld_errno), %g1; \
or %g1, %lo(rtld_errno), %g1; \
ldx [%o2 + %g1], %g1; \
# else
# define SYSCALL_ERROR_ERRNO errno
# endif
-# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG(o2,g1) \
+# define SYSCALL_ERROR_HANDLER \
+0: SETUP_PIC_REG_LEAF(o2,g1) \
sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
ldx [%o2 + %g1], %g1, %tie_ldx(SYSCALL_ERROR_ERRNO);\
mov -1, %o0;
# else
# define SYSCALL_ERROR_HANDLER \
-0: SETUP_PIC_REG(o2,g1) \
+0: SETUP_PIC_REG_LEAF(o2,g1) \
sethi %hi(errno), %g1; \
or %g1, %lo(errno), %g1; \
ldx [%o2 + %g1], %g1; \