* shlib-versions: Use sparc64.*- for CPU patterns.

This commit is contained in:
Roland McGrath 2006-03-06 01:34:09 +00:00
parent a26c855c73
commit 043cee3700
34 changed files with 451 additions and 471 deletions

View file

@ -1,3 +1,7 @@
2006-03-05 David S. Miller <davem@sunset.davemloft.net>
* shlib-versions: Use sparc64.*- for CPU patterns.
2006-03-05 Roland McGrath <roland@frob.com> 2006-03-05 Roland McGrath <roland@frob.com>
* bits/resource.h (RLIMIT_SBSIZE, RLIMIT_AS, RLIMIT_VMEM): Define. * bits/resource.h (RLIMIT_SBSIZE, RLIMIT_AS, RLIMIT_VMEM): Define.

View file

@ -1,3 +1,14 @@
2006-03-05 David S. Miller <davem@sunset.davemloft.net>
* sysdeps/unix/sysv/linux/sparc/sparc32/pt-vfork.S:
Use __syscall_error.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/vfork.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/pt-vfork.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/vfork.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/Makefile: New file.
2006-03-02 Ulrich Drepper <drepper@redhat.com> 2006-03-02 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups. * sysdeps/unix/sysv/linux/aio_misc.h: Various cleanups.

View file

@ -40,14 +40,14 @@ s390x-.*-.* WORDSIZE32 s390-@VENDOR@-@OS@
s390-.*-.* WORDSIZE64 s390x-@VENDOR@-@OS@ s390-.*-.* WORDSIZE64 s390x-@VENDOR@-@OS@
powerpc64-.*-.* WORDSIZE32 powerpc-@VENDOR@-@OS@ powerpc64-.*-.* WORDSIZE32 powerpc-@VENDOR@-@OS@
powerpc.*-.*-.* WORDSIZE64 powerpc64-@VENDOR@-@OS@ powerpc.*-.*-.* WORDSIZE64 powerpc64-@VENDOR@-@OS@
sparc64-.*-.* WORDSIZE32 sparc-@VENDOR@-@OS@ sparc64.*-.*-.* WORDSIZE32 sparc-@VENDOR@-@OS@
sparc.*-.*-.* WORDSIZE64 sparc64-@VENDOR@-@OS@ sparc.*-.*-.* WORDSIZE64 sparc64-@VENDOR@-@OS@
# Configuration Library=version Earliest symbol set (optional) # Configuration Library=version Earliest symbol set (optional)
# ------------- --------------- ------------------------------ # ------------- --------------- ------------------------------
# The interface to -lm depends mostly only on cpu, not on operating system. # The interface to -lm depends mostly only on cpu, not on operating system.
sparc64-.*-linux.* libm=6 GLIBC_2.2 sparc64.*-.*-linux.* libm=6 GLIBC_2.2
alpha.*-.*-linux.* libm=6.1 alpha.*-.*-linux.* libm=6.1
ia64-.*-linux.* libm=6.1 GLIBC_2.2 ia64-.*-linux.* libm=6.1 GLIBC_2.2
sh.*-.*-linux.* libm=6 GLIBC_2.2 sh.*-.*-linux.* libm=6 GLIBC_2.2
@ -58,7 +58,7 @@ sh.*-.*-linux.* libm=6 GLIBC_2.2
alpha.*-.*-linux.* libc=6.1 alpha.*-.*-linux.* libc=6.1
ia64-.*-linux.* libc=6.1 GLIBC_2.2 ia64-.*-linux.* libc=6.1 GLIBC_2.2
sh.*-.*-linux.* libc=6 GLIBC_2.2 sh.*-.*-linux.* libc=6 GLIBC_2.2
sparc64-.*-linux.* libc=6 GLIBC_2.2 sparc64.*-.*-linux.* libc=6 GLIBC_2.2
.*-.*-linux.* libc=6 .*-.*-linux.* libc=6
# libmachuser.so.1 corresponds to mach/*.defs as of Utah's UK22 release. # libmachuser.so.1 corresponds to mach/*.defs as of Utah's UK22 release.
@ -72,7 +72,7 @@ sparc64-.*-linux.* libc=6 GLIBC_2.2
# The dynamic loader also requires different names. # The dynamic loader also requires different names.
i.86-.*-linux.* ld=ld-linux.so.2 i.86-.*-linux.* ld=ld-linux.so.2
sparc64-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2 sparc64.*-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2
sparc.*-.*-linux.* ld=ld-linux.so.2 sparc.*-.*-linux.* ld=ld-linux.so.2
alpha.*-.*-linux.* ld=ld-linux.so.2 alpha.*-.*-linux.* ld=ld-linux.so.2
sh.*-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2 sh.*-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2
@ -121,7 +121,7 @@ alpha.*-.*-linux.* libcrypt=1.1
alpha.*-.*-linux.* libBrokenLocale=1.1 alpha.*-.*-linux.* libBrokenLocale=1.1
ia64-.*-.* libBrokenLocale=1 GLIBC_2.2 ia64-.*-.* libBrokenLocale=1 GLIBC_2.2
sh.*-.*-.* libBrokenLocale=1 GLIBC_2.2 sh.*-.*-.* libBrokenLocale=1 GLIBC_2.2
sparc64-.*-.* libBrokenLocale=1 GLIBC_2.2 sparc64.*-.*-.* libBrokenLocale=1 GLIBC_2.2
.*-.*-.* libBrokenLocale=1 .*-.*-.* libBrokenLocale=1
# The real-time library from POSIX.1b. # The real-time library from POSIX.1b.

View file

@ -30,13 +30,22 @@
.globl _dl_runtime_resolve .globl _dl_runtime_resolve
.type _dl_runtime_resolve, @function .type _dl_runtime_resolve, @function
_dl_runtime_resolve: _dl_runtime_resolve:
cfi_startproc
save %sp, -104, %sp save %sp, -104, %sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register (%o7, %i7)
ld [%g2 + 8], %o0 ld [%g2 + 8], %o0
srl %g1, 10, %o1 srl %g1, 10, %o1
call _dl_fixup call _dl_fixup
sub %o1, 4*12, %o1 sub %o1, 4*12, %o1
jmp %o0 jmp %o0
restore restore
cfi_endproc
.size _dl_runtime_resolve, .-_dl_runtime_resolve .size _dl_runtime_resolve, .-_dl_runtime_resolve
/* For the profiling cases we pass in our stack frame /* For the profiling cases we pass in our stack frame
@ -56,6 +65,8 @@ _dl_runtime_resolve:
.globl _dl_profile_save_regs .globl _dl_profile_save_regs
.type _dl_profile_save_regs, @function .type _dl_profile_save_regs, @function
_dl_profile_save_regs: _dl_profile_save_regs:
cfi_startproc
std %l0, [%sp + ( 0 * 8)] std %l0, [%sp + ( 0 * 8)]
std %l2, [%sp + ( 1 * 8)] std %l2, [%sp + ( 1 * 8)]
std %l4, [%sp + ( 2 * 8)] std %l4, [%sp + ( 2 * 8)]
@ -67,6 +78,9 @@ _dl_profile_save_regs:
ld [%sp + (8 * 8)], %l4 ld [%sp + (8 * 8)], %l4
retl retl
st %l4, [%sp + (8 * 8)] st %l4, [%sp + (8 * 8)]
cfi_endproc
.size _dl_profile_save_regs, .-_dl_profile_save_regs .size _dl_profile_save_regs, .-_dl_profile_save_regs
/* If we are going to call pltexit, then we must replicate /* If we are going to call pltexit, then we must replicate
@ -76,6 +90,8 @@ _dl_profile_save_regs:
.globl _dl_profile_invoke .globl _dl_profile_invoke
.type _dl_profile_invoke, @function .type _dl_profile_invoke, @function
_dl_profile_invoke: _dl_profile_invoke:
cfi_startproc
sub %sp, %l0, %sp sub %sp, %l0, %sp
1: 1:
srl %l0, 3, %l7 srl %l0, 3, %l7
@ -112,6 +128,10 @@ _dl_profile_invoke:
jmpl %i7 + 8, %g0 jmpl %i7 + 8, %g0
restore restore
cfi_endproc
.size _dl_profile_invoke, .-_dl_profile_invoke
/* %g1: PLT offset loaded by PLT entry /* %g1: PLT offset loaded by PLT entry
* %g2: callers PC, which is PLT0 + 4, and we store the * %g2: callers PC, which is PLT0 + 4, and we store the
* link map at PLT0 + 12, therefore we add 8 to get * link map at PLT0 + 12, therefore we add 8 to get
@ -121,11 +141,17 @@ _dl_profile_invoke:
.globl _dl_runtime_profile .globl _dl_runtime_profile
.type _dl_runtime_profile, @function .type _dl_runtime_profile, @function
_dl_runtime_profile: _dl_runtime_profile:
cfi_startproc
cmp %fp, 0 cmp %fp, 0
be,a 1f be,a 1f
mov 104, %g3 mov 104, %g3
sub %fp, %sp, %g3 sub %fp, %sp, %g3
1: save %sp, -104, %sp 1: save %sp, -104, %sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
ld [%g2 + 8], %o0 ld [%g2 + 8], %o0
srl %g1, 10, %o1 srl %g1, 10, %o1
mov %i7, %o2 mov %i7, %o2
@ -152,4 +178,7 @@ _dl_runtime_profile:
1: jmp %o0 1: jmp %o0
restore restore
cfi_endproc
.size _dl_runtime_profile, .-_dl_runtime_profile .size _dl_runtime_profile, .-_dl_runtime_profile

View file

@ -48,6 +48,7 @@
.global _start .global _start
.type _start,#function .type _start,#function
_start: _start:
cfi_startproc
#ifdef SHARED #ifdef SHARED
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7 sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
@ -59,6 +60,7 @@ _start:
drop their arguments. */ drop their arguments. */
mov %g0, %fp mov %g0, %fp
sub %sp, 6*4, %sp sub %sp, 6*4, %sp
cfi_adjust_cfa_offset(6*4)
/* Extract the arguments and environment as encoded on the stack. The /* Extract the arguments and environment as encoded on the stack. The
argument info starts after one register window (16 words) past the SP. */ argument info starts after one register window (16 words) past the SP. */
@ -91,6 +93,8 @@ _start:
/* Die very horribly if exit returns. */ /* Die very horribly if exit returns. */
unimp unimp
cfi_endproc
.size _start, .-_start .size _start, .-_start
/* Define a symbol for the first piece of initialized data. */ /* Define a symbol for the first piece of initialized data. */

View file

@ -32,7 +32,15 @@
.text .text
.align 4 .align 4
0: cmp %o2, 0 ENTRY(__memchr)
andcc %o1, 0xff, %o1
sll %o1, 8, %g6
andcc %o0, 3, %g0
or %o1, %g6, %g6
sll %g6, 16, %o3
be 10f
or %o3, %g6, %g2
cmp %o2, 0
be 9f be 9f
sethi %hi(0x80808080), %o4 sethi %hi(0x80808080), %o4
ldub [%o0], %g4 ldub [%o0], %g4
@ -64,16 +72,7 @@
clr %o0 clr %o0
1: retl 1: retl
sub %o0, 1, %o0 sub %o0, 1, %o0
10: sethi %hi(0x80808080), %o4
ENTRY(__memchr)
andcc %o1, 0xff, %o1
sll %o1, 8, %g6
andcc %o0, 3, %g0
or %o1, %g6, %g6
sll %g6, 16, %o3
bne 0b
or %o3, %g6, %g2
sethi %hi(0x80808080), %o4
or %o4, %lo(0x80808080), %o3 or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o5 4: sethi %hi(0x01010101), %o5
5: and %o2, 3, %g1 5: and %o2, 3, %g1

View file

@ -146,28 +146,12 @@
.text .text
.align 4 .align 4
70: andcc %o1, 1, %g0
be 4f
andcc %o1, 2, %g0
ldub [%o1 - 1], %g2
sub %o1, 1, %o1
stb %g2, [%o0 - 1]
sub %o2, 1, %o2
be 3f
sub %o0, 1, %o0
4: lduh [%o1 - 2], %g2
sub %o1, 2, %o1
sth %g2, [%o0 - 2]
sub %o2, 2, %o2
b 3f
sub %o0, 2, %o0
ENTRY(bcopy) ENTRY(bcopy)
mov %o0, %o3 mov %o0, %o3
mov %o1, %o0 mov %o1, %o0
mov %o3, %o1 mov %o3, %o1
END(bcopy) END(bcopy)
ENTRY(memmove) ENTRY(memmove)
cmp %o0, %o1 cmp %o0, %o1
st %o0, [%sp + 64] st %o0, [%sp + 64]
@ -185,8 +169,26 @@ ENTRY(memmove)
cmp %o2, 15 cmp %o2, 15
bleu 91f bleu 91f
andcc %o1, 3, %g0 andcc %o1, 3, %g0
bne 70b be 3f
3: andcc %o1, 4, %g0 nop
andcc %o1, 1, %g0
be 4f
andcc %o1, 2, %g0
ldub [%o1 - 1], %g2
sub %o1, 1, %o1
stb %g2, [%o0 - 1]
sub %o2, 1, %o2
be 3f
sub %o0, 1, %o0
4: lduh [%o1 - 2], %g2
sub %o1, 2, %o1
sth %g2, [%o0 - 2]
sub %o2, 2, %o2
sub %o0, 2, %o0
3: andcc %o1, 4, %g0
be 2f be 2f
mov %o2, %g1 mov %o2, %g1

View file

@ -38,7 +38,13 @@
.text .text
.align 4 .align 4
10: ldub [%o1], %o5
ENTRY(__stpcpy)
andcc %o1, 3, %g0
be 20f
sethi %hi(0x80808080), %o4
ldub [%o1], %o5
stb %o5, [%o0] stb %o5, [%o0]
cmp %o5, 0 cmp %o5, 0
add %o0, 1, %o0 add %o0, 1, %o0
@ -67,11 +73,7 @@
1: retl 1: retl
add %o0, -1, %o0 add %o0, -1, %o0
ENTRY(__stpcpy) 20: or %o4, %lo(0x80808080), %o3
andcc %o1, 3, %g0
bne 10b
sethi %hi(0x80808080), %o4
or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o4 4: sethi %hi(0x01010101), %o4
5: or %o4, %lo(0x01010101), %o2 5: or %o4, %lo(0x01010101), %o2
6: andcc %o0, 3, %g0 6: andcc %o0, 3, %g0

View file

@ -38,36 +38,14 @@
.text .text
.align 4 .align 4
10: cmp %o4, 2
be 1f
cmp %o4, 3
ldub [%o1], %o5
add %o1, 1, %o1
stb %o5, [%o0]
be 3f
cmp %o5, 0
be 0f
add %o0, 1, %o0
1: lduh [%o1], %o5
add %o1, 2, %o1
srl %o5, 8, %o4
cmp %o4, 0
stb %o4, [%o0]
bne,a 2f
stb %o5, [%o0 + 1]
retl
mov %g2, %o0
2: andcc %o5, 0xff, %o5
bne 4f
add %o0, 2, %o0
retl
mov %g2, %o0
3: bne 4f
add %o0, 1, %o0
retl
mov %g2, %o0
11: ldub [%o0], %o5 ENTRY(strcat)
mov %o0, %g2
andcc %o0, 3, %g0
be 30f
sethi %hi(0x80808080), %o4
ldub [%o0], %o5
cmp %o5, 0 cmp %o5, 0
be 1f be 1f
add %o0, 1, %o0 add %o0, 1, %o0
@ -93,12 +71,7 @@
b 3f b 3f
sub %o0, 1, %o0 sub %o0, 1, %o0
ENTRY(strcat) 30: or %o4, %lo(0x80808080), %o3
mov %o0, %g2
andcc %o0, 3, %g0
bne 11b
sethi %hi(0x80808080), %o4
or %o4, %lo(0x80808080), %o3
7: sethi %hi(0x01010101), %o4 7: sethi %hi(0x01010101), %o4
8: or %o4, %lo(0x01010101), %o2 8: or %o4, %lo(0x01010101), %o2
9: ld [%o0], %o5 9: ld [%o0], %o5
@ -128,8 +101,39 @@ ENTRY(strcat)
ld [%o0], %o5 ld [%o0], %o5
sub %o0, 1, %o0 sub %o0, 1, %o0
3: andcc %o1, 3, %o4 3: andcc %o1, 3, %o4
bne 10b be 4f
4: andcc %o0, 3, %g3 nop
cmp %o4, 2
be 11f
cmp %o4, 3
ldub [%o1], %o5
add %o1, 1, %o1
stb %o5, [%o0]
be 13f
cmp %o5, 0
be 0f
add %o0, 1, %o0
11: lduh [%o1], %o5
add %o1, 2, %o1
srl %o5, 8, %o4
cmp %o4, 0
stb %o4, [%o0]
bne,a 12f
stb %o5, [%o0 + 1]
retl
mov %g2, %o0
12: andcc %o5, 0xff, %o5
bne 4f
add %o0, 2, %o0
retl
mov %g2, %o0
13: bne 4f
add %o0, 1, %o0
retl
mov %g2, %o0
4: andcc %o0, 3, %g3
bne 12f bne 12f
1: ld [%o1], %o5 1: ld [%o1], %o5
add %o1, 4, %o1 add %o1, 4, %o1

View file

@ -39,36 +39,6 @@
.text .text
.align 4 .align 4
10: ldub [%o0], %g4
cmp %g4, %o1
be 1f
add %o0, 1, %o0
cmp %g4, 0
be 9f
andcc %o0, 3, %g0
be 4f
or %o4, %lo(0x80808080), %o3
ldub [%o0], %g4
cmp %g4, %o1
be 1f
add %o0, 1, %o0
cmp %g4, 0
be 9f
andcc %o0, 3, %g0
be 5f
sethi %hi(0x01010101), %o5
ldub [%o0], %g4
cmp %g4, %o1
be 1f
add %o0, 1, %o0
cmp %g4, 0
be 9f
or %o5, %lo(0x01010101), %o2
b 6f
ld [%o0], %g4
1: retl
sub %o0, 1, %o0
ENTRY(strchr) ENTRY(strchr)
andcc %o1, 0xff, %o1 andcc %o1, 0xff, %o1
be 12f be 12f
@ -77,9 +47,40 @@ ENTRY(strchr)
or %o1, %o2, %o2 or %o1, %o2, %o2
sethi %hi(0x80808080), %o4 sethi %hi(0x80808080), %o4
sll %o2, 16, %o3 sll %o2, 16, %o3
bne 10b be 13f
or %o3, %o2, %g2 or %o3, %o2, %g2
or %o4, %lo(0x80808080), %o3
ldub [%o0], %g4
cmp %g4, %o1
be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
andcc %o0, 3, %g0
be 4f
or %o4, %lo(0x80808080), %o3
ldub [%o0], %g4
cmp %g4, %o1
be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
andcc %o0, 3, %g0
be 5f
sethi %hi(0x01010101), %o5
ldub [%o0], %g4
cmp %g4, %o1
be 11f
add %o0, 1, %o0
cmp %g4, 0
be 9f
or %o5, %lo(0x01010101), %o2
b 6f
ld [%o0], %g4
11: retl
sub %o0, 1, %o0
13: or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o5 4: sethi %hi(0x01010101), %o5
5: or %o5, %lo(0x01010101), %o2 5: or %o5, %lo(0x01010101), %o2
7: ld [%o0], %g4 7: ld [%o0], %g4

View file

@ -38,7 +38,13 @@
.text .text
.align 4 .align 4
10: ldub [%o0], %o4
ENTRY(strcmp)
andcc %o0, 3, %g0
be 13f
sethi %hi(0x80808080), %g1
ldub [%o0], %o4
add %o0, 1, %o0 add %o0, 1, %o0
ldub [%o1], %o5 ldub [%o1], %o5
cmp %o4, 0 cmp %o4, 0
@ -76,11 +82,7 @@
2: retl 2: retl
mov %o4, %o0 mov %o4, %o0
ENTRY(strcmp) 13: or %g1, %lo(0x80808080), %o3
andcc %o0, 3, %g0
bne 10b
sethi %hi(0x80808080), %g1
or %g1, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %g1 4: sethi %hi(0x01010101), %g1
5: andcc %o1, 3, %g2 5: andcc %o1, 3, %g2
bne 12f bne 12f

View file

@ -38,7 +38,14 @@
.text .text
.align 4 .align 4
1: ldub [%o1], %o5
ENTRY(strcpy)
mov %o0, %g2
andcc %o1, 3, %g0
be 10f
sethi %hi(0x80808080), %o4
ldub [%o1], %o5
stb %o5, [%o0] stb %o5, [%o0]
cmp %o5, 0 cmp %o5, 0
add %o0, 1, %o0 add %o0, 1, %o0
@ -65,12 +72,7 @@
b 6f b 6f
andcc %o0, 3, %g3 andcc %o0, 3, %g3
ENTRY(strcpy) 10: or %o4, %lo(0x80808080), %o3
mov %o0, %g2
andcc %o1, 3, %g0
bne 1b
sethi %hi(0x80808080), %o4
or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o4 4: sethi %hi(0x01010101), %o4
5: andcc %o0, 3, %g3 5: andcc %o0, 3, %g3
6: bne 10f 6: bne 10f

View file

@ -38,39 +38,41 @@
.text .text
.align 4 .align 4
10: ldub [%o0], %o5
ENTRY(strlen)
mov %o0, %o1
andcc %o0, 3, %g0
be 20f
sethi %hi(0x80808080), %o4
ldub [%o0], %o5
cmp %o5, 0 cmp %o5, 0
be 1f be 21f
add %o0, 1, %o0 add %o0, 1, %o0
andcc %o0, 3, %g0 andcc %o0, 3, %g0
be 4f be 4f
or %o4, %lo(0x80808080), %o3 or %o4, %lo(0x80808080), %o3
ldub [%o0], %o5 ldub [%o0], %o5
cmp %o5, 0 cmp %o5, 0
be 2f be 22f
add %o0, 1, %o0 add %o0, 1, %o0
andcc %o0, 3, %g0 andcc %o0, 3, %g0
be 5f be 5f
sethi %hi(0x01010101), %o4 sethi %hi(0x01010101), %o4
ldub [%o0], %o5 ldub [%o0], %o5
cmp %o5, 0 cmp %o5, 0
be 3f be 23f
add %o0, 1, %o0 add %o0, 1, %o0
b 11f b 11f
or %o4, %lo(0x01010101), %o2 or %o4, %lo(0x01010101), %o2
1: retl 21: retl
mov 0, %o0 mov 0, %o0
2: retl 22: retl
mov 1, %o0 mov 1, %o0
3: retl 23: retl
mov 2, %o0 mov 2, %o0
ENTRY(strlen) 20: or %o4, %lo(0x80808080), %o3
mov %o0, %o1
andcc %o0, 3, %g0
bne 10b
sethi %hi(0x80808080), %o4
or %o4, %lo(0x80808080), %o3
4: sethi %hi(0x01010101), %o4 4: sethi %hi(0x01010101), %o4
5: or %o4, %lo(0x01010101), %o2 5: or %o4, %lo(0x01010101), %o2
11: ld [%o0], %o5 11: ld [%o0], %o5

View file

@ -30,7 +30,13 @@
.globl _dl_runtime_resolve_0 .globl _dl_runtime_resolve_0
.type _dl_runtime_resolve_0, @function .type _dl_runtime_resolve_0, @function
_dl_runtime_resolve_0: _dl_runtime_resolve_0:
cfi_startproc
save %sp, -192, %sp save %sp, -192, %sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
sethi %hi(1047552), %l2 sethi %hi(1047552), %l2
ldx [%g4 + 32 + 8], %o0 ldx [%g4 + 32 + 8], %o0
sub %g1, %g4, %l0 sub %g1, %g4, %l0
@ -54,6 +60,9 @@ _dl_runtime_resolve_0:
sllx %l0, 3, %o1 sllx %l0, 3, %o1
jmp %o0 jmp %o0
restore restore
cfi_endproc
.size _dl_runtime_resolve_0, .-_dl_runtime_resolve_0 .size _dl_runtime_resolve_0, .-_dl_runtime_resolve_0
/* %g1: PLT offset loaded by PLT entry /* %g1: PLT offset loaded by PLT entry
@ -64,7 +73,13 @@ _dl_runtime_resolve_0:
.globl _dl_runtime_resolve_1 .globl _dl_runtime_resolve_1
.type _dl_runtime_resolve_1, @function .type _dl_runtime_resolve_1, @function
_dl_runtime_resolve_1: _dl_runtime_resolve_1:
cfi_startproc
save %sp, -192, %sp save %sp, -192, %sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
srlx %g1, 12, %o1 srlx %g1, 12, %o1
ldx [%g4 + 8], %o0 ldx [%g4 + 8], %o0
add %o1, %o1, %o3 add %o1, %o1, %o3
@ -73,6 +88,9 @@ _dl_runtime_resolve_1:
add %o1, %o3, %o1 add %o1, %o3, %o1
jmp %o0 jmp %o0
restore restore
cfi_endproc
.size _dl_runtime_resolve_1, .-_dl_runtime_resolve_1 .size _dl_runtime_resolve_1, .-_dl_runtime_resolve_1
/* For the profiling cases we pass in our stack frame /* For the profiling cases we pass in our stack frame
@ -92,6 +110,8 @@ _dl_runtime_resolve_1:
.globl _dl_profile_save_regs .globl _dl_profile_save_regs
.type _dl_profile_save_regs, @function .type _dl_profile_save_regs, @function
_dl_profile_save_regs: _dl_profile_save_regs:
cfi_startproc
stx %l0, [%sp + STACK_BIAS + ( 0 * 8)] stx %l0, [%sp + STACK_BIAS + ( 0 * 8)]
stx %l1, [%sp + STACK_BIAS + ( 1 * 8)] stx %l1, [%sp + STACK_BIAS + ( 1 * 8)]
stx %l2, [%sp + STACK_BIAS + ( 2 * 8)] stx %l2, [%sp + STACK_BIAS + ( 2 * 8)]
@ -125,6 +145,9 @@ _dl_profile_save_regs:
std %f28, [%sp + STACK_BIAS + (30 * 8)] std %f28, [%sp + STACK_BIAS + (30 * 8)]
retl retl
std %f30, [%sp + STACK_BIAS + (31 * 8)] std %f30, [%sp + STACK_BIAS + (31 * 8)]
cfi_endproc
.size _dl_profile_save_regs, .-_dl_profile_save_regs .size _dl_profile_save_regs, .-_dl_profile_save_regs
/* If we are going to call pltexit, then we must replicate /* If we are going to call pltexit, then we must replicate
@ -134,6 +157,8 @@ _dl_profile_save_regs:
.globl _dl_profile_invoke .globl _dl_profile_invoke
.type _dl_profile_invoke, @function .type _dl_profile_invoke, @function
_dl_profile_invoke: _dl_profile_invoke:
cfi_startproc
sub %sp, %l0, %sp sub %sp, %l0, %sp
1: 1:
srlx %l0, 3, %l7 srlx %l0, 3, %l7
@ -180,6 +205,10 @@ _dl_profile_invoke:
jmpl %i7 + 8, %g0 jmpl %i7 + 8, %g0
restore restore
cfi_endproc
.size _dl_profile_invoke, .-_dl_profile_invoke
/* %g1: PLT offset loaded by PLT entry /* %g1: PLT offset loaded by PLT entry
* %g4: callers PC, which is PLT0 + 24, therefore we * %g4: callers PC, which is PLT0 + 24, therefore we
* add (32 + 8) to get the address of PLT2 which * add (32 + 8) to get the address of PLT2 which
@ -189,10 +218,16 @@ _dl_profile_invoke:
.globl _dl_runtime_profile_0 .globl _dl_runtime_profile_0
.type _dl_runtime_profile_0, @function .type _dl_runtime_profile_0, @function
_dl_runtime_profile_0: _dl_runtime_profile_0:
cfi_startproc
brz,a,pn %fp, 1f brz,a,pn %fp, 1f
mov 192, %g5 mov 192, %g5
sub %fp, %sp, %g5 sub %fp, %sp, %g5
1: save %sp, -336, %sp 1: save %sp, -336, %sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
sethi %hi(1047552), %l2 sethi %hi(1047552), %l2
ldx [%g4 + 32 + 8], %o0 ldx [%g4 + 32 + 8], %o0
sub %g1, %g4, %l0 sub %g1, %g4, %l0
@ -236,6 +271,9 @@ _dl_runtime_profile_0:
1: jmp %o0 1: jmp %o0
restore restore
cfi_endproc
.size _dl_runtime_profile_0, .-_dl_runtime_profile_0 .size _dl_runtime_profile_0, .-_dl_runtime_profile_0
/* %g1: PLT offset loaded by PLT entry /* %g1: PLT offset loaded by PLT entry
@ -246,10 +284,16 @@ _dl_runtime_profile_0:
.globl _dl_runtime_profile_1 .globl _dl_runtime_profile_1
.type _dl_runtime_profile_1, @function .type _dl_runtime_profile_1, @function
_dl_runtime_profile_1: _dl_runtime_profile_1:
cfi_startproc
brz,a,pn %fp, 1f brz,a,pn %fp, 1f
mov 192, %g5 mov 192, %g5
sub %fp, %sp, %g5 sub %fp, %sp, %g5
1: save %sp, -336, %sp 1: save %sp, -336, %sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
srlx %g1, 12, %o1 srlx %g1, 12, %o1
ldx [%g4 + 8], %o0 ldx [%g4 + 8], %o0
add %o1, %o1, %o3 add %o1, %o1, %o3
@ -277,4 +321,7 @@ _dl_runtime_profile_1:
1: jmp %o0 1: jmp %o0
restore restore
cfi_endproc
.size _dl_runtime_resolve_1, .-_dl_runtime_resolve_1 .size _dl_runtime_resolve_1, .-_dl_runtime_resolve_1

View file

@ -48,6 +48,7 @@
.global _start .global _start
.type _start,#function .type _start,#function
_start: _start:
cfi_startproc
#ifdef SHARED #ifdef SHARED
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7 sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
@ -59,6 +60,7 @@ _start:
drop their arguments. */ drop their arguments. */
mov %g0, %fp mov %g0, %fp
sub %sp, 6*8, %sp sub %sp, 6*8, %sp
cfi_adjust_cfa_offset(6*8)
/* Extract the arguments and environment as encoded on the stack. The /* Extract the arguments and environment as encoded on the stack. The
argument info starts after one register window (16 words) past the SP, argument info starts after one register window (16 words) past the SP,
@ -92,6 +94,8 @@ _start:
/* Die very horribly if exit returns. */ /* Die very horribly if exit returns. */
illtrap 0 illtrap 0
cfi_endproc
.size _start, .-_start .size _start, .-_start
/* Define a symbol for the first piece of initialized data. */ /* Define a symbol for the first piece of initialized data. */

View file

@ -209,6 +209,7 @@ ENTRY(bcopy)
END(bcopy) END(bcopy)
.align 32 .align 32
ENTRY(__memcpy_large)
200: be,pt %xcc, 201f /* CTI */ 200: be,pt %xcc, 201f /* CTI */
andcc %o0, 0x38, %g5 /* IEU1 Group */ andcc %o0, 0x38, %g5 /* IEU1 Group */
mov 8, %g1 /* IEU0 */ mov 8, %g1 /* IEU0 */
@ -443,6 +444,7 @@ END(bcopy)
stb %o5, [%o0 - 1] /* Store */ stb %o5, [%o0 - 1] /* Store */
209: retl 209: retl
mov %g4, %o0 mov %g4, %o0
END(__memcpy_large)
#ifdef USE_BPR #ifdef USE_BPR
@ -698,6 +700,7 @@ ENTRY(memcpy)
END(memcpy) END(memcpy)
.align 32 .align 32
ENTRY(__memmove_slowpath)
228: andcc %o2, 1, %g0 /* IEU1 Group */ 228: andcc %o2, 1, %g0 /* IEU1 Group */
be,pt %icc, 2f+4 /* CTI */ be,pt %icc, 2f+4 /* CTI */
1: ldub [%o1 - 1], %o5 /* LOAD Group */ 1: ldub [%o1 - 1], %o5 /* LOAD Group */
@ -718,6 +721,7 @@ END(memcpy)
mov %g4, %o0 mov %g4, %o0
219: retl 219: retl
nop nop
END(__memmove_slowpath)
.align 32 .align 32
ENTRY(memmove) ENTRY(memmove)

View file

@ -45,6 +45,7 @@ ENTRY(memset)
sllx %o2, 32, %g1 sllx %o2, 32, %g1
ba,pt %XCC, 1f ba,pt %XCC, 1f
or %g1, %o2, %o2 or %g1, %o2, %o2
END(memset)
ENTRY(__bzero) ENTRY(__bzero)
clr %o2 clr %o2
@ -121,7 +122,6 @@ ENTRY(__bzero)
retl retl
mov %o3, %o0 mov %o3, %o0
END(__bzero) END(__bzero)
END(memset)
libc_hidden_builtin_def (memset) libc_hidden_builtin_def (memset)
weak_alias (__bzero, bzero) weak_alias (__bzero, bzero)

View file

@ -1 +1,5 @@
64bit-predefine = __sparc_v9__ __arch64__ 64bit-predefine = __sparc_v9__ __arch64__
ifeq ($(subdir),rt)
librt-routines += rt-sysdep
endif

View file

@ -0,0 +1 @@
#include <sysdep.c>

View file

@ -24,6 +24,7 @@
#include <asm/errno.h> #include <asm/errno.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <tcb-offsets.h> #include <tcb-offsets.h>
#include <sysdep.h>
#define CLONE_VM 0x00000100 #define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000 #define CLONE_THREAD 0x00010000
@ -32,12 +33,11 @@
pid_t *ptid, void *tls, pid_t *ctid); */ pid_t *ptid, void *tls, pid_t *ctid); */
.text .text
.align 4 ENTRY (__clone)
.globl __clone
.type __clone,@function
__clone:
save %sp,-96,%sp save %sp,-96,%sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
/* sanity check arguments */ /* sanity check arguments */
orcc %i0,%g0,%g2 orcc %i0,%g0,%g2
@ -67,21 +67,21 @@ __clone:
tst %o1 tst %o1
bne __thread_start bne __thread_start
nop nop
ret jmpl %i7 + 8, %g0
restore %o0,%g0,%o0 restore %o0,%g0,%o0
.Lerror: .Lerror:
call __errno_location call __errno_location
or %g0,EINVAL,%i0 or %g0,EINVAL,%i0
st %i0,[%o0] st %i0,[%o0]
ret jmpl %i7 + 8, %g0
restore %g0,-1,%o0 restore %g0,-1,%o0
END(__clone)
.size __clone, .-__clone
.type __thread_start,@function .type __thread_start,@function
__thread_start: __thread_start:
cfi_startproc
#ifdef RESET_PID #ifdef RESET_PID
sethi %hi(CLONE_THREAD), %l0 sethi %hi(CLONE_THREAD), %l0
andcc %g4, %l0, %g0 andcc %g4, %l0, %g0
@ -102,6 +102,8 @@ __thread_start:
call _exit,0 call _exit,0
nop nop
cfi_endproc
.size __thread_start, .-__thread_start .size __thread_start, .-__thread_start
weak_alias (__clone, clone) weak_alias (__clone, clone)

View file

@ -19,20 +19,22 @@
#include <sysdep.h> #include <sysdep.h>
.globl __libc_pipe .text
ENTRY (__libc_pipe) .globl __syscall_error
mov %o0, %o2 /* Save PIPEDES. */ ENTRY(__libc_pipe)
mov SYS_ify(pipe),%g1 mov %o0, %o2 /* Save PIPEDES. */
ta 0x10 mov SYS_ify(pipe),%g1
bcs __syscall_error_handler ta 0x10
nop bcc 1f
st %o0, [%o2] /* PIPEDES[0] = %o0; */ mov %o7, %g1
st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */ call __syscall_error
mov %g1, %o7
1: st %o0, [%o2] /* PIPEDES[0] = %o0; */
st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */
retl retl
clr %o0 clr %o0
SYSCALL_ERROR_HANDLER END(__libc_pipe)
PSEUDO_END (__libc_pipe)
weak_alias (__libc_pipe, __pipe) weak_alias (__libc_pipe, __pipe)
libc_hidden_def (__pipe) libc_hidden_def (__pipe)
weak_alias (__libc_pipe, pipe) weak_alias (__libc_pipe, pipe)

View file

@ -47,7 +47,7 @@
# endif # endif
#endif #endif
.globl __socket .globl __syscall_error
ENTRY (__socket) ENTRY (__socket)
/* Drop up to 6 arguments (recvfrom) into the memory allocated by /* Drop up to 6 arguments (recvfrom) into the memory allocated by
@ -76,18 +76,19 @@ ENTRY (__socket)
add %sp, 68, %o1 /* arg 2: parameter block */ add %sp, 68, %o1 /* arg 2: parameter block */
LOADSYSCALL(socketcall) LOADSYSCALL(socketcall)
t 0x10 t 0x10
bcs __syscall_error_handler bcc 1f
nop mov %o7, %g1
retl call __syscall_error
mov %g1, %o7
1: jmpl %o7 + 8, %g0
nop nop
#if defined NEED_CANCELLATION && defined CENABLE #if defined NEED_CANCELLATION && defined CENABLE
.Lsocket_cancel: .Lsocket_cancel:
cfi_startproc
save %sp, -96, %sp save %sp, -96, %sp
cfi_def_cfa_register (%fp) cfi_def_cfa_register(%fp)
cfi_window_save cfi_window_save
cfi_register (%o7, %i7) cfi_register(%o7, %i7)
CENABLE CENABLE
nop nop
mov %o0, %l0 mov %o0, %l0
@ -95,18 +96,20 @@ ENTRY (__socket)
mov P(SOCKOP_,socket), %o0 mov P(SOCKOP_,socket), %o0
LOADSYSCALL(socketcall) LOADSYSCALL(socketcall)
t 0x10 t 0x10
bcs __syscall_error_handler2 bcc 1f
mov %o0, %l1 mov %o0, %l1
CDISABLE CDISABLE;
mov %l0, %o0;
call __syscall_error;
mov %l1, %o0;
b 1f
mov -1, %l1;
1: CDISABLE
mov %l0, %o0 mov %l0, %o0
jmpl %i7 + 8, %g0 2: jmpl %i7 + 8, %g0
restore %g0, %l1, %o0 restore %g0, %l1, %o0
cfi_endproc
SYSCALL_ERROR_HANDLER2
#endif #endif
SYSCALL_ERROR_HANDLER
END (__socket) END (__socket)
#ifndef NO_WEAK_ALIAS #ifndef NO_WEAK_ALIAS

View file

@ -17,8 +17,10 @@
02111-1307 USA. */ 02111-1307 USA. */
#include <sysdep.h> #include <sysdep.h>
.text .text
ENTRY (syscall) .globl __syscall_error
ENTRY(syscall)
mov %o0, %g1 mov %o0, %g1
mov %o1, %o0 mov %o1, %o0
mov %o2, %o1 mov %o2, %o1
@ -26,10 +28,10 @@ ENTRY (syscall)
mov %o4, %o3 mov %o4, %o3
mov %o5, %o4 mov %o5, %o4
ta 0x10 ta 0x10
bcs __syscall_error_handler bcc 1f
mov %o7, %g1
call __syscall_error
mov %g1, %o7
1: retl
nop nop
retl END(syscall)
nop
SYSCALL_ERROR_HANDLER
PSEUDO_END (syscall)

View file

@ -38,131 +38,54 @@
#undef PSEUDO #undef PSEUDO
#undef PSEUDO_NOERRNO #undef PSEUDO_NOERRNO
#undef PSEUDO_ERRVAL #undef PSEUDO_ERRVAL
#undef PSEUDO_END
#undef ENTRY #undef ENTRY
#undef END #undef END
#undef LOC #undef LOC
#define ENTRY(name) \ #define ENTRY(name) \
.global C_SYMBOL_NAME(name); \ .align 4; \
.align 4;\ .global C_SYMBOL_NAME(name); \
C_LABEL(name);\ .type name, @function; \
.type name,@function; C_LABEL(name) \
cfi_startproc;
#define END(name) \ #define END(name) \
cfi_endproc; \
.size name, . - name .size name, . - name
#define LOC(name) .L##name #define LOC(name) .L##name
#ifdef LINKER_HANDLES_R_SPARC_WDISP22 /* If the offset to __syscall_error fits into a signed 22-bit
/* Unfortunately, we cannot do this yet. Linker doesn't seem to * immediate branch offset, the linker will relax the call into
handle R_SPARC_WDISP22 against non-STB_LOCAL symbols properly . */ * a normal branch.
# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \ */
.section .gnu.linkonce.t.handler,"ax",@progbits; \ #define PSEUDO(name, syscall_name, args) \
.globl handler; \ .text; \
.hidden handler; \ .globl __syscall_error; \
.type handler,@function; \ ENTRY(name); \
handler: LOADSYSCALL(syscall_name); \
#else ta 0x10; \
# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \ bcc 1f; \
.subsection 3; \ mov %o7, %g1; \
handler: call __syscall_error; \
#endif mov %g1, %o7; \
1:
#if RTLD_PRIVATE_ERRNO #define PSEUDO_NOERRNO(name, syscall_name, args)\
# define SYSCALL_ERROR_HANDLER \ .text; \
.section .gnu.linkonce.t.__sparc_get_pic_l7,"ax",@progbits; \ ENTRY(name); \
.globl __sparc_get_pic_l7; \ LOADSYSCALL(syscall_name); \
.hidden __sparc_get_pic_l7; \ ta 0x10;
.type __sparc_get_pic_l7,@function; \
__sparc_get_pic_l7: \
retl; \
add %o7, %l7, %l7; \
.previous; \
SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
save %sp,-96,%sp; \
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
call __sparc_get_pic_l7; \
add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
ld [%l7 + rtld_errno], %l0; \
st %i0, [%l0]; \
jmpl %i7+8, %g0; \
restore %g0, -1, %o0; \
.previous;
#elif USE___THREAD
# ifndef NOT_IN_libc
# define SYSCALL_ERROR_ERRNO __libc_errno
# else
# define SYSCALL_ERROR_ERRNO errno
# endif
# ifdef SHARED
# define SYSCALL_ERROR_HANDLER \
.section .gnu.linkonce.t.__sparc_get_pic_l7,"ax",@progbits; \
.globl __sparc_get_pic_l7; \
.hidden __sparc_get_pic_l7; \
.type __sparc_get_pic_l7,@function; \
__sparc_get_pic_l7: \
retl; \
add %o7, %l7, %l7; \
.previous; \
SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
save %sp,-96,%sp; \
sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %l1; \
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
call __sparc_get_pic_l7; \
add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
add %l1, %tie_lo10(SYSCALL_ERROR_ERRNO), %l1; \
ld [%l7 + %l1], %l1, %tie_ld(SYSCALL_ERROR_ERRNO); \
st %i0, [%g7 + %l1], %tie_add(SYSCALL_ERROR_ERRNO); \
jmpl %i7+8, %g0; \
restore %g0, -1, %o0; \
.previous;
# else
# define SYSCALL_ERROR_HANDLER \
SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
sethi %hi(_GLOBAL_OFFSET_TABLE_), %g2; \
add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
add %g2, %lo(_GLOBAL_OFFSET_TABLE_), %g2; \
ld [%g2 + %g1], %g1, %tie_ld(SYSCALL_ERROR_ERRNO); \
st %o0, [%g7 + %g1], %tie_add(SYSCALL_ERROR_ERRNO); \
jmpl %o7+8, %g0; \
mov -1, %o0; \
.previous;
# endif
#else
# define SYSCALL_ERROR_HANDLER \
SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
.global __errno_location; \
.type __errno_location,@function; \
save %sp, -96, %sp; \
call __errno_location; \
nop; \
st %i0, [%o0]; \
jmpl %i7+8, %g0; \
restore %g0, -1, %o0; \
.previous;
#endif
#define PSEUDO(name, syscall_name, args) \ #define PSEUDO_ERRVAL(name, syscall_name, args) \
.text; \ .text; \
ENTRY(name); \ ENTRY(name); \
LOADSYSCALL(syscall_name); \ LOADSYSCALL(syscall_name); \
ta 0x10; \ ta 0x10;
bcs __syscall_error_handler; \
nop; \
SYSCALL_ERROR_HANDLER
#define PSEUDO_NOERRNO(name, syscall_name, args) \ #define PSEUDO_END(name) \
.text; \ END(name)
ENTRY(name); \
LOADSYSCALL(syscall_name); \
ta 0x10
#define PSEUDO_ERRVAL(name, syscall_name, args) \
.text; \
ENTRY(name); \
LOADSYSCALL(syscall_name); \
ta 0x10
#else /* __ASSEMBLER__ */ #else /* __ASSEMBLER__ */

View file

@ -37,8 +37,11 @@ __curbrk: .skip 8
#endif #endif
.text .text
ENTRY(__brk) ENTRY (__brk)
save %sp, -192, %sp save %sp, -192, %sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
#ifdef PIC #ifdef PIC
1: call 2f 1: call 2f
sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7 sethi %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
@ -90,7 +93,6 @@ ENTRY(__brk)
sub %g0, 1, %i0 sub %g0, 1, %i0
jmpl %i7+8, %g0 jmpl %i7+8, %g0
restore restore
END (__brk)
.size __brk, .-__brk
weak_alias (__brk, brk) weak_alias (__brk, brk)

View file

@ -23,6 +23,7 @@
#include <asm/errno.h> #include <asm/errno.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <tcb-offsets.h> #include <tcb-offsets.h>
#include <sysdep.h>
#define CLONE_VM 0x00000100 #define CLONE_VM 0x00000100
#define CLONE_THREAD 0x00010000 #define CLONE_THREAD 0x00010000
@ -34,12 +35,12 @@
.register %g3,#scratch .register %g3,#scratch
.text .text
.align 4
.globl __clone
.type __clone,@function
__clone: ENTRY (__clone)
save %sp, -192, %sp save %sp, -192, %sp
cfi_def_cfa_register(%fp)
cfi_window_save
cfi_register(%o7, %i7)
/* sanity check arguments */ /* sanity check arguments */
brz,pn %i0, 99f /* fn non-NULL? */ brz,pn %i0, 99f /* fn non-NULL? */
@ -65,7 +66,7 @@ __clone:
nop nop
brnz,pn %o1, __thread_start brnz,pn %o1, __thread_start
nop nop
ret jmpl %i7 + 8, %g0
restore %o0, %g0, %o0 restore %o0, %g0, %o0
99: 99:
#ifndef _LIBC_REENTRANT #ifndef _LIBC_REENTRANT
@ -88,12 +89,13 @@ __clone:
nop nop
st %i0, [%o0] st %i0, [%o0]
#endif #endif
ret jmpl %i7 + 8, %g0
restore %g0,-1,%o0 restore %g0,-1,%o0
.size __clone, .-__clone END(__clone)
.type __thread_start,@function .type __thread_start,@function
__thread_start: __thread_start:
cfi_startproc
#ifdef RESET_PID #ifdef RESET_PID
sethi %hi(CLONE_THREAD), %l0 sethi %hi(CLONE_THREAD), %l0
andcc %g4, %l0, %g0 andcc %g4, %l0, %g0
@ -112,6 +114,8 @@ __thread_start:
mov %g3,%o0 mov %g3,%o0
call _exit,0 call _exit,0
nop nop
.size __thread_start, .-__thread_start cfi_endproc
.size __thread_start, .-__thread_start
weak_alias (__clone, clone) weak_alias (__clone, clone)

View file

@ -19,18 +19,22 @@
#include <sysdep.h> #include <sysdep.h>
ENTRY (__libc_pipe) .text
.globl __syscall_error
ENTRY(__libc_pipe)
mov %o0, %o2 /* Save PIPEDES. */ mov %o0, %o2 /* Save PIPEDES. */
LOADSYSCALL(pipe) LOADSYSCALL(pipe)
ta 0x6d ta 0x6d
bcs,pn %xcc, __syscall_error_handler bcc,pt %xcc, 1f
nop mov %o7, %g1
st %o0, [%o2] /* PIPEDES[0] = %o0; */ call __syscall_error
mov %g1, %o7
1: st %o0, [%o2] /* PIPEDES[0] = %o0; */
st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */ st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */
retl retl
clr %o0 clr %o0
SYSCALL_ERROR_HANDLER END(__libc_pipe)
PSEUDO_END (__libc_pipe)
weak_alias (__libc_pipe, __pipe) weak_alias (__libc_pipe, __pipe)
libc_hidden_def (__pipe) libc_hidden_def (__pipe)

View file

@ -24,12 +24,15 @@
.weak setcontext .weak setcontext
ENTRY(setcontext) ENTRY(setcontext)
mov 1, %o1 ba,pt %xcc, 1f
mov 1, %o1
END(setcontext)
/* int __setcontext(ucontext_t *ctx, int restoremask); */ /* int __setcontext(ucontext_t *ctx, int restoremask); */
ENTRY(__setcontext) ENTRY(__setcontext)
ldx [%o0 + UC_SIGMASK], %o2 1: ldx [%o0 + UC_SIGMASK], %o2
stx %o2, [%o0 + __UC_SIGMASK] stx %o2, [%o0 + __UC_SIGMASK]
ta 0x6f ta 0x6f

View file

@ -39,7 +39,8 @@ libc_hidden_def (_setjmp)
/* int setjmp(jmp_buf) */ /* int setjmp(jmp_buf) */
ENTRY(setjmp) ENTRY(setjmp)
set 1, %o1 ba,pt %xcc, __sigsetjmp_local
set 1, %o1
END(setjmp) END(setjmp)
/* int __sigsetjmp(jmp_buf, savemask) */ /* int __sigsetjmp(jmp_buf, savemask) */

View file

@ -47,8 +47,8 @@
# endif # endif
#endif #endif
.globl __socket .globl __syscall_error
ENTRY (__socket) ENTRY(__socket)
/* Drop up to 6 arguments (recvfrom) into the memory allocated by /* Drop up to 6 arguments (recvfrom) into the memory allocated by
the caller for varargs, since that's really what we have. */ the caller for varargs, since that's really what we have. */
@ -77,14 +77,15 @@ ENTRY (__socket)
LOADSYSCALL(socketcall) LOADSYSCALL(socketcall)
ta 0x6d ta 0x6d
bcs,pn %xcc, __syscall_error_handler bcc,pt %xcc, 1f
nop mov %o7, %g1
retl call __syscall_error
mov %g1, %o7
1: retl
nop nop
#if defined NEED_CANCELLATION && defined CENABLE #if defined NEED_CANCELLATION && defined CENABLE
.Lsocket_cancel: .Lsocket_cancel:
cfi_startproc
save %sp, -160, %sp save %sp, -160, %sp
cfi_def_cfa_register (%fp) cfi_def_cfa_register (%fp)
cfi_window_save cfi_window_save
@ -97,19 +98,21 @@ ENTRY (__socket)
LOADSYSCALL(socketcall) LOADSYSCALL(socketcall)
ta 0x6d ta 0x6d
bcs,pn %xcc, __syscall_error_handler2 bcc,pt %xcc, 1f
mov %o0, %l1 mov %o0, %l1
CDISABLE CDISABLE;
mov %l0, %o0;
call __syscall_error;
mov %l1, %o0;
ba,pt %xcc, 2f
mov -1, %l1;
1: CDISABLE
mov %l0, %o0 mov %l0, %o0
jmpl %i7 + 8, %g0 2: jmpl %i7 + 8, %g0
restore %g0, %l1, %o0 restore %g0, %l1, %o0
cfi_endproc
SYSCALL_ERROR_HANDLER2
#endif #endif
SYSCALL_ERROR_HANDLER END(__socket)
END (__socket)
#ifndef NO_WEAK_ALIAS #ifndef NO_WEAK_ALIAS
weak_alias (__socket, socket) weak_alias (__socket, socket)

View file

@ -19,8 +19,8 @@
#include <sysdep.h> #include <sysdep.h>
.text .text
ENTRY (syscall) .globl __syscall_error
ENTRY(syscall)
mov %o0,%g1 mov %o0,%g1
mov %o1,%o0 mov %o1,%o0
mov %o2,%o1 mov %o2,%o1
@ -30,11 +30,10 @@ ENTRY (syscall)
ta 0x6d ta 0x6d
bcs,pn %xcc,__syscall_error_handler bcc,pt %xcc, 1f
mov %o7, %g1
call __syscall_error
mov %g1, %o7
1: retl
nop nop
retl END(syscall)
nop
SYSCALL_ERROR_HANDLER
PSEUDO_END (syscall)

View file

@ -49,142 +49,52 @@
#undef PSEUDO #undef PSEUDO
#undef PSEUDO_NOERRNO #undef PSEUDO_NOERRNO
#undef PSEUDO_ERRVAL #undef PSEUDO_ERRVAL
#undef ENTRY
#define ENTRY(name) \
.global C_SYMBOL_NAME(name); \
.align 2; \
C_LABEL(name); \
.type name,@function;
#ifdef LINKER_HANDLES_R_SPARC_WDISP22
/* Unfortunately, we cannot do this yet. Linker doesn't seem to
handle R_SPARC_WDISP22 against non-STB_LOCAL symbols properly . */
# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \
.section .gnu.linkonce.t.handler,"ax",@progbits; \
.globl handler; \
.hidden handler; \
.type handler,@function; \
handler:
#else
# define SYSCALL_ERROR_HANDLER_ENTRY(handler) \
.subsection 3; \
handler:
#endif
#if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_HANDLER \
.section .gnu.linkonce.t.__sparc64.get_pic.l7,"ax",@progbits; \
.globl __sparc64.get_pic.l7; \
.hidden __sparc64.get_pic.l7; \
.type __sparc64.get_pic.l7,@function; \
__sparc64.get_pic.l7: \
retl; \
add %o7, %l7, %l7; \
.previous; \
SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
save %sp, -192, %sp; \
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
call __sparc64.get_pic.l7; \
add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
sethi %hi(rtld_errno), %g1; \
or %g1, %lo(rtld_errno), %g1; \
ldx [%l7 + %g1], %l0; \
st %i0, [%l0]; \
jmpl %i7+8, %g0; \
restore %g0, -1, %o0; \
.previous;
#elif USE___THREAD
# ifndef NOT_IN_libc
# define SYSCALL_ERROR_ERRNO __libc_errno
# else
# define SYSCALL_ERROR_ERRNO errno
# endif
# ifdef SHARED
# define SYSCALL_ERROR_HANDLER \
.section .gnu.linkonce.t.__sparc64.get_pic.l7,"ax",@progbits; \
.globl __sparc64.get_pic.l7; \
.hidden __sparc64.get_pic.l7; \
.type __sparc64.get_pic.l7,@function; \
__sparc64.get_pic.l7: \
retl; \
add %o7, %l7, %l7; \
.previous; \
SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
save %sp,-192,%sp; \
sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %l1; \
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
call __sparc64.get_pic.l7; \
add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
add %l1, %tie_lo10(SYSCALL_ERROR_ERRNO), %l1; \
ldx [%l7 + %l1], %l1, %tie_ldx(SYSCALL_ERROR_ERRNO); \
st %i0, [%g7 + %l1], %tie_add(SYSCALL_ERROR_ERRNO); \
jmpl %i7+8, %g0; \
restore %g0, -1, %o0; \
.previous;
# else
# define SYSCALL_ERROR_HANDLER \
SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
sethi %hi(_GLOBAL_OFFSET_TABLE_), %g4; \
add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
add %g4, %lo(_GLOBAL_OFFSET_TABLE_), %g4; \
ldx [%g4 + %g1], %g1, %tie_ldx(SYSCALL_ERROR_ERRNO); \
st %o0, [%g7 + %g1], %tie_add(SYSCALL_ERROR_ERRNO); \
jmpl %o7+8, %g0; \
mov -1, %o0; \
.previous;
# endif
#else
# define SYSCALL_ERROR_HANDLER \
SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
.global __errno_location; \
.type __errno_location,@function; \
save %sp, -192, %sp; \
call __errno_location; \
nop; \
st %i0, [%o0]; \
jmpl %i7+8, %g0; \
restore %g0, -1, %o0; \
.previous;
#endif
#define PSEUDO(name, syscall_name, args) \
.text; \
ENTRY(name); \
LOADSYSCALL(syscall_name); \
ta 0x6d; \
bcs,pn %xcc, __syscall_error_handler; \
nop; \
SYSCALL_ERROR_HANDLER
#define PSEUDO_NOERRNO(name, syscall_name, args) \
.text; \
ENTRY(name); \
LOADSYSCALL(syscall_name); \
ta 0x6d
#define PSEUDO_ERRVAL(name, syscall_name, args) \
.text; \
ENTRY(name); \
LOADSYSCALL(syscall_name); \
ta 0x6d
#undef PSEUDO_END #undef PSEUDO_END
#define PSEUDO_END(name) \ #undef ENTRY
.size name,.-name
#undef PSEUDO_END_NOERRNO
#define PSEUDO_END_NOERRNO(name) \
.size name,.-name
#undef PSEUDO_END_ERRVAL
#define PSEUDO_END_ERRVAL(name) \
.size name,.-name
#undef END #undef END
#define END(name) \
.size name,.-name #define ENTRY(name) \
.align 4; \
.global C_SYMBOL_NAME(name); \
.type name, @function; \
C_LABEL(name) \
cfi_startproc;
#define END(name) \
cfi_endproc; \
.size name, . - name
/* If the offset to __syscall_error fits into a signed 22-bit
* immediate branch offset, the linker will relax the call into
* a normal branch.
*/
#define PSEUDO(name, syscall_name, args) \
.text; \
.globl __syscall_error; \
ENTRY(name); \
LOADSYSCALL(syscall_name); \
ta 0x6d; \
bcc,pt %xcc, 1f; \
mov %o7, %g1; \
call __syscall_error; \
mov %g1, %o7; \
1:
#define PSEUDO_NOERRNO(name, syscall_name, args)\
.text; \
ENTRY(name); \
LOADSYSCALL(syscall_name); \
ta 0x6d;
#define PSEUDO_ERRVAL(name, syscall_name, args) \
.text; \
ENTRY(name); \
LOADSYSCALL(syscall_name); \
ta 0x6d;
#define PSEUDO_END(name) \
END(name)
/* Careful here! This "ret" define can interfere; use jmpl if unsure. */ /* Careful here! This "ret" define can interfere; use jmpl if unsure. */
#define ret retl; nop #define ret retl; nop

View file

@ -1 +0,0 @@
/* Nothing to do here. */

View file

@ -0,0 +1 @@
#include <sysdeps/unix/sysv/linux/powerpc/sysdep.c>