diff options
author | David S. Miller <davem@davemloft.net> | 2012-02-21 15:42:42 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-20 17:51:53 -0800 |
commit | 3d2b3019e0efa9735370498122ac80298deff8c7 (patch) | |
tree | 693771bb0b1fba08098558d99613ce80bc36a923 /sysdeps/sparc/sparc64/elf/start.S | |
parent | c80098a9a05b7d5f8ad1488135f2cee613998c50 (diff) | |
download | glibc-3d2b3019e0efa9735370498122ac80298deff8c7.tar.gz glibc-3d2b3019e0efa9735370498122ac80298deff8c7.tar.xz glibc-3d2b3019e0efa9735370498122ac80298deff8c7.zip |
Use sparc GOTDATA relocations whenever possible.
* sysdeps/sparc/crti.S: Try to use GOTDATA relocs. * sysdeps/sparc/sparc32/dl-machine.h (RTLD_START): Likewise. * sysdeps/sparc/sparc32/elf/start.S: Likewise. * sysdeps/sparc/sparc64/dl-machine.h (RTLD_START): Likewise. * sysdeps/sparc/sparc64/elf/start.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memcpy.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memset.S: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/____longjmp_chk.S: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (SYSCALL_ERROR_HANDLER): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/____longjmp_chk.S: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (SYSCALL_ERROR_HANDLER): Likewise.
Diffstat (limited to 'sysdeps/sparc/sparc64/elf/start.S')
-rw-r--r-- | sysdeps/sparc/sparc64/elf/start.S | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/sysdeps/sparc/sparc64/elf/start.S b/sysdeps/sparc/sparc64/elf/start.S index afae70b4ba..50f2df2c7e 100644 --- a/sysdeps/sparc/sparc64/elf/start.S +++ b/sysdeps/sparc/sparc64/elf/start.S @@ -40,18 +40,11 @@ .section ".text" .align 4 -#ifdef SHARED -.LLGETPC0: - retl - add %o7, %l7, %l7 -#endif .global _start .type _start,#function _start: #ifdef SHARED - sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7 - call .LLGETPC0 - add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7 + SETUP_PIC_REG(l7) #endif /* Terminate the stack frame, and reserve space for functions to @@ -66,17 +59,36 @@ _start: add %sp, STACK_BIAS+23*8, %o2 /* Load the addresses of the user entry points. */ - sethi %hi(main), %o0 - sethi %hi(__libc_csu_init), %o3 - sethi %hi(__libc_csu_fini), %o4 - or %o0, %lo(main), %o0 - or %o3, %lo(__libc_csu_init), %o3 - or %o4, %lo(__libc_csu_fini), %o4 -#ifdef SHARED +#ifndef SHARED + sethi %hi(main), %o0 + sethi %hi(__libc_csu_init), %o3 + sethi %hi(__libc_csu_fini), %o4 + or %o0, %lo(main), %o0 + or %o3, %lo(__libc_csu_init), %o3 + or %o4, %lo(__libc_csu_fini), %o4 +#else +#ifdef HAVE_BINUTILS_GOTDATA + sethi %gdop_hix22(main), %o0 + sethi %gdop_hix22(__libc_csu_init), %o3 + sethi %gdop_hix22(__libc_csu_fini), %o4 + xor %o0, %gdop_lox10(main), %o0 + xor %o3, %gdop_lox10(__libc_csu_init), %o3 + xor %o4, %gdop_lox10(__libc_csu_fini), %o4 + ldx [%l7 + %o0], %o0, %gdop(main) + ldx [%l7 + %o3], %o3, %gdop(__libc_csu_init) + ldx [%l7 + %o4], %o4, %gdop(__libc_csu_fini) +#else + sethi %hi(main), %o0 + sethi %hi(__libc_csu_init), %o3 + sethi %hi(__libc_csu_fini), %o4 + or %o0, %lo(main), %o0 + or %o3, %lo(__libc_csu_init), %o3 + or %o4, %lo(__libc_csu_fini), %o4 ldx [%l7 + %o0], %o0 ldx [%l7 + %o3], %o3 ldx [%l7 + %o4], %o4 #endif +#endif /* When starting a binary via the dynamic linker, %g1 contains the address of the shared library termination function, which will be |