]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/sparc/sparc32/dl-trampoline.S
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / sparc / sparc32 / dl-trampoline.S
index 1253a33774c6d1883e0fdfb8cb2f6dd3548befa1..b8916d5ef0e74118b42e1f20b42c3a81359a196e 100644 (file)
@@ -1,5 +1,5 @@
 /* PLT trampolines.  Sparc 32-bit version.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005-2016 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
@@ -13,9 +13,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
 
        .globl  _dl_runtime_resolve
        .type   _dl_runtime_resolve, @function
 _dl_runtime_resolve:
+       cfi_startproc
+
        save    %sp, -104, %sp
+       cfi_def_cfa_register(%fp)
+       cfi_window_save
+       cfi_register (%o7, %i7)
+
        ld      [%g2 + 8], %o0
        srl     %g1, 10, %o1
        call    _dl_fixup
         sub    %o1, 4*12, %o1
        jmp     %o0
         restore
+
+       cfi_endproc
+
        .size   _dl_runtime_resolve, .-_dl_runtime_resolve
 
        /* For the profiling cases we pass in our stack frame
-        * as the base of the La_sparc64_regs, so it looks
+        * as the base of the La_sparc32_regs, so it looks
         * like:
-        *      %l0                     %sp
+        *      %l0                     %sp + (0 * 8)
+        *      %l1                     %sp + (0 * 8) + 4
         *      ...
-        *      %l7                     %sp + (7 * 8)
-        *      %i0                     %sp + (8 * 8)
+        *      %l6                     %sp + (3 * 8)
+        *      %l7                     %sp + (3 * 8) + 4
+        *      %i0                     %sp + (4 * 8)
+        *      %i1                     %sp + (4 * 8) + 4
         *      ...
-        *      %i7                     %sp + (15 * 8)
-        *      %f0                     %sp + (16 * 8)
-        *      %f16                    %sp + (31 * 8)
-        *      framesize               %sp + (32 * 8)
+        *      %i6                     %sp + (7 * 8)
+        *      %i7                     %sp + (7 * 8) + 4
+        *      struct_ret_ptr          %sp + (8 * 8)
+        *      framesize               %sp + (9 * 8)
         */
 
        .globl  _dl_profile_save_regs
        .type   _dl_profile_save_regs, @function
 _dl_profile_save_regs:
+       cfi_startproc
+
        std     %l0, [%sp + ( 0 * 8)]
        std     %l2, [%sp + ( 1 * 8)]
        std     %l4, [%sp + ( 2 * 8)]
@@ -64,9 +77,12 @@ _dl_profile_save_regs:
        std     %i2, [%sp + ( 5 * 8)]
        std     %i4, [%sp + ( 6 * 8)]
        std     %i6, [%sp + ( 7 * 8)]
-       ld      [%sp + (8 * 8)], %l4
+       ld      [%fp + (8 * 8)], %l4
        retl
         st     %l4, [%sp + (8 * 8)]
+
+       cfi_endproc
+
        .size   _dl_profile_save_regs, .-_dl_profile_save_regs
 
        /* If we are going to call pltexit, then we must replicate
@@ -76,8 +92,13 @@ _dl_profile_save_regs:
        .globl  _dl_profile_invoke
        .type   _dl_profile_invoke, @function
 _dl_profile_invoke:
-       sub     %sp, %l0, %sp
-1:
+       cfi_startproc
+
+       add     %l0, 7, %l0
+       andn    %l0, 7, %l0
+       add     %l0, 2 * 8, %g1
+
+       sub     %sp, %g1, %sp
        srl     %l0, 3, %l7
        mov     %o0, %l1
        mov     %i0, %o0
@@ -86,16 +107,18 @@ _dl_profile_invoke:
        mov     %i3, %o3
        mov     %i4, %o4
        mov     %i5, %o5
+       cmp     %l0, 0
        mov     %fp, %l2
-       mov     %sp, %l3
+       be      2f
+        add    %sp, (11 * 8), %l3
 1:     ldd     [%l2], %g2
        add     %l2, 0x8, %l2
        subcc   %l7, 1, %l7
-       stx     %g2, [%l3]
+       std     %g2, [%l3]
        bne     1b
         add    %l3, 0x8, %l3
 
-       jmpl    %l1, %o7
+2:     jmpl    %l1, %o7
         nop
 
        std     %o0, [%sp + ( 9 * 8)]
@@ -103,15 +126,20 @@ _dl_profile_invoke:
 
        mov     %l5, %o0
        mov     %l6, %o1
-       add     %sp, %l0, %o2
+       add     %sp, (11 * 8), %o2
        call    _dl_call_pltexit
-        add    %sp, (16 * 8), %o3
+        add    %sp, ( 9 * 8), %o3
 
-       ldd     [%sp + (9 * 8)], %i0
+       ldd     [%sp + ( 9 * 8)], %i0
+       ldd     [%sp + (10 * 8)], %f0
 
        jmpl    %i7 + 8, %g0
         restore
 
+       cfi_endproc
+
+       .size   _dl_profile_invoke, .-_dl_profile_invoke
+
        /* %g1: PLT offset loaded by PLT entry
         * %g2: callers PC, which is PLT0 + 4, and we store the
         *      link map at PLT0 + 12, therefore we add 8 to get
@@ -121,35 +149,39 @@ _dl_profile_invoke:
        .globl  _dl_runtime_profile
        .type   _dl_runtime_profile, @function
 _dl_runtime_profile:
-       cmp     %fp, 0
-       be,a    1f
-        mov    104, %g3
-       sub     %fp, %sp, %g3
-1:     save    %sp, -104, %sp
+       cfi_startproc
+
+       save    %sp, -104, %sp
+       cfi_def_cfa_register(%fp)
+       cfi_window_save
+       cfi_register(%o7, %i7)
+
        ld      [%g2 + 8], %o0
        srl     %g1, 10, %o1
        mov     %i7, %o2
        sub     %o1, 4*12, %o1
 
-       mov     %g3, %l0
        mov     %o0, %l5
        mov     %o1, %l6
 
-       call _dl_profile_save_regs
+       call    _dl_profile_save_regs
         nop
 
        mov     %sp, %o3
        call    _dl_profile_fixup
         add    %sp, (9 * 8), %o4
 
-       ld      [%sp + (9 * 8)], %o1
-       cmp     %o1, 0
-       bgeu    1f
+       ld      [%sp + (9 * 8)], %l0
+       cmp     %l0, 0
+       bl      1f
         nop
-       
+
        call    _dl_profile_invoke
         nop
 
 1:     jmp     %o0
         restore
+
+       cfi_endproc
+
        .size   _dl_runtime_profile, .-_dl_runtime_profile