diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-08-26 01:54:10 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-08-26 01:54:10 +0000 |
commit | 198876b2957c4927bee119d959edcf90dca5326c (patch) | |
tree | 4a831d17b19abcb97599a52fc3557d96e9aef824 /lib/libc | |
parent | ac2a6151bdd6d28dc4f8c26284cc08a9d15466dd (diff) |
Hide many (194!) symbols that nothing should be using.
Delete exect(2); it wasn't portable across archs and nothing used it.
ports test build by naddy@
ok deraadt@ kettenis@
Diffstat (limited to 'lib/libc')
62 files changed, 213 insertions, 1008 deletions
diff --git a/lib/libc/Symbols.list b/lib/libc/Symbols.list index 2a65c885d0c..3a05331230b 100644 --- a/lib/libc/Symbols.list +++ b/lib/libc/Symbols.list @@ -18,24 +18,17 @@ __plt_end /* sys */ ___cerror __cerror -__curbrk __get_tcb -__getcwd __semctl __set_tcb __stack_smash_handler __syscall -__sysctl __tfork_thread __threxit __thrsigdivert __thrsleep __thrwakeup -_atfork_list _exit -_getlogin -_ptrace -_setlogin _thread_fork _thread_sys___get_tcb _thread_sys___getcwd @@ -264,7 +257,6 @@ connect dup2 dup3 dup -exect execve faccessat fchdir @@ -445,70 +437,6 @@ write writev /* db */ -__add_ovflpage -__addel -__big_delete -__big_insert -__big_keydata -__big_return -__big_split -__bt_close -__bt_cmp -__bt_defcmp -__bt_defpfx -__bt_delete -__bt_dleaf -__bt_fd -__bt_free -__bt_get -__bt_new -__bt_open -__bt_pgin -__bt_pgout -__bt_put -__bt_ret -__bt_search -__bt_seq -__bt_setcur -__bt_split -__bt_sync -__buf_free -__buf_init -__call_hash -__dbpanic -__default_hash -__delpair -__expand_table -__find_bigpair -__find_last_page -__free_ovflpage -__get_buf -__get_page -__hash_open -__ibitmap -__log2 -__ovfl_delete -__ovfl_get -__ovfl_put -__put_page -__rec_close -__rec_delete -__rec_dleaf -__rec_fd -__rec_fmap -__rec_fpipe -__rec_get -__rec_iput -__rec_open -__rec_put -__rec_ret -__rec_search -__rec_seq -__rec_sync -__rec_vmap -__rec_vpipe -__reclaim_buf -__split_page dbm_clearerr dbm_close dbm_delete @@ -546,23 +474,6 @@ dlerror dlopen dlsym -/* citrus */ -_citrus_ctype_none -_citrus_ctype_open -_citrus_ctype_utf8 -_citrus_none_ctype_mbrtowc -_citrus_none_ctype_mbsinit -_citrus_none_ctype_mbsnrtowcs -_citrus_none_ctype_ops -_citrus_none_ctype_wcrtomb -_citrus_none_ctype_wcsnrtombs -_citrus_utf8_ctype_mbrtowc -_citrus_utf8_ctype_mbsinit -_citrus_utf8_ctype_mbsnrtowcs -_citrus_utf8_ctype_ops -_citrus_utf8_ctype_wcrtomb -_citrus_utf8_ctype_wcsnrtombs - /* compat-43 */ creat getdtablesize @@ -577,13 +488,9 @@ sigsetmask sigvec /* gen */ -_C_ctype_ -_C_tolower_ -_C_toupper_ ___errno __assert __assert2 -__elf_is_okay__ __errno __fdnlist __flt_rounds @@ -611,7 +518,6 @@ __signbitl __sys_errlist __sys_nerr __sys_siglist -__vsyslog_r _ctype_ _err _errx @@ -624,9 +530,7 @@ _ng_sl_add _ng_sl_find _ng_sl_free _ng_sl_init -_readdir_unlocked _setjmp -_signal _sys_errlist _sys_nerr _sys_siglist @@ -694,7 +598,6 @@ confstr ctermid daemon devname -bkey dirfd dirname elf_hash @@ -956,58 +859,18 @@ crypt_checkpass crypt_newhash /* gdtoa */ -__Balloc_D2A -__Bfree_D2A -__ULtod_D2A -__any_on_D2A -__b2d_D2A -__bigtens_D2A -__cmp_D2A -__copybits_D2A -__d2b_D2A -__decrement_D2A -__diff_D2A __dtoa __dtoa_locks __freedtoa __gdtoa -__gethex_D2A __hdtoa -__hexdig_D2A -__hexnan_D2A -__hi0bits_D2A __hldtoa -__i2b_D2A -__increment_D2A __ldtoa -__lo0bits_D2A -__lshift_D2A -__match_D2A -__mult_D2A -__multadd_D2A -__nrv_alloc_D2A -__pow5mult_D2A -__quorem_D2A -__ratio_D2A -__rshift_D2A -__rv_alloc_D2A -__s2b_D2A -__set_ones_D2A -__strtodg -__strtord -__sum_D2A -__tens_D2A -__tinytens_D2A -__trailz_D2A -__ulp_D2A -hexdig_init_D2A -strcp_D2A strtod strtof strtold /* gmon */ -_gmonparam _mcleanup moncontrol monstartup @@ -1511,39 +1374,11 @@ xprt_register xprt_unregister /* stdio */ -__fgetwc_unlock -__fputwc_unlock __sF -__sFext -__sclose -__sdidinit -__sflags -__sflush -__sflush_locked -__sfp -__sfvwrite -__sglue -__sinit -__smakebuf -__sread -__srefill __srget -__sseek -__svfscanf __swbuf -__swhatbuf -__swrite -__swsetup -__ungetwc -__vfprintf -__vfwprintf -__vfwscanf _cleanup _fwalk -_mktemp -_weak_flockfile -_weak_ftrylockfile -_weak_funlockfile asprintf clearerr dprintf @@ -1652,13 +1487,7 @@ __atexit __atexit_register_cleanup __cxa_atexit __cxa_finalize -__dorand48 -__findenv __isthreaded -__rand48_add -__rand48_deterministic -__rand48_mult -__rand48_seed a64l abort abs @@ -1869,20 +1698,6 @@ _thread_mutex_unlock _thread_tag_lock _thread_tag_storage _thread_tag_unlock -_weak__thread_arc4_lock -_weak__thread_arc4_unlock -_weak__thread_atexit_lock -_weak__thread_atexit_unlock -_weak__thread_atfork_lock -_weak__thread_atfork_unlock -_weak__thread_malloc_lock -_weak__thread_malloc_unlock -_weak__thread_mutex_destroy -_weak__thread_mutex_lock -_weak__thread_mutex_unlock -_weak__thread_tag_lock -_weak__thread_tag_storage -_weak__thread_tag_unlock /* time */ asctime diff --git a/lib/libc/arch/alpha/Symbols.list b/lib/libc/arch/alpha/Symbols.list index 8871b741278..9b9ff3e8bd3 100644 --- a/lib/libc/arch/alpha/Symbols.list +++ b/lib/libc/arch/alpha/Symbols.list @@ -9,11 +9,8 @@ __remlu __remq __remqu _mcount -_thread_sys_exect -_thread_sys_syscall fabsl frexpl ldexpl mcount -minbrk modfl diff --git a/lib/libc/arch/alpha/sys/brk.S b/lib/libc/arch/alpha/sys/brk.S index 233cd4225e6..dbdccd1240f 100644 --- a/lib/libc/arch/alpha/sys/brk.S +++ b/lib/libc/arch/alpha/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.6 2005/08/07 16:40:13 espie Exp $ */ +/* $OpenBSD: brk.S,v 1.7 2015/08/26 01:54:09 guenther Exp $ */ /* $NetBSD: brk.S,v 1.4 1996/10/17 03:08:15 cgd Exp $ */ /* @@ -34,18 +34,20 @@ IMPORT(__curbrk, 8) .data -EXPORT(minbrk) +__minbrk: .quad _end +WEAK_ALIAS(brk, _brk) + .text -LEAF(brk, 1) +LEAF(_brk, 1) br pv, L1 /* XXX profiling */ L1: LDGP(pv) - ldq v0, minbrk + ldq v0, __minbrk cmpult a0, v0, t0 cmovne t0, v0, a0 CALLSYS_ERROR(break) stq a0, __curbrk mov zero, v0 RET -END(brk) +END(_brk) diff --git a/lib/libc/arch/alpha/sys/exect.S b/lib/libc/arch/alpha/sys/exect.S deleted file mode 100644 index d3652bbdffc..00000000000 --- a/lib/libc/arch/alpha/sys/exect.S +++ /dev/null @@ -1,36 +0,0 @@ -/* $OpenBSD: exect.S,v 1.5 2005/08/07 16:40:13 espie Exp $ */ -/* $NetBSD: exect.S,v 1.2 1996/10/17 03:08:18 cgd Exp $ */ - -/* - * Copyright (c) 1994, 1995 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include "SYS.h" - -SYSLEAF(exect, 3) - CALLSYS_ERROR(execve) - RET -SYSEND(exect) diff --git a/lib/libc/arch/alpha/sys/sbrk.S b/lib/libc/arch/alpha/sys/sbrk.S index 76fd6d703a9..f64b2f7772e 100644 --- a/lib/libc/arch/alpha/sys/sbrk.S +++ b/lib/libc/arch/alpha/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.6 2005/08/07 16:40:13 espie Exp $ */ +/* $OpenBSD: sbrk.S,v 1.7 2015/08/26 01:54:09 guenther Exp $ */ /* $NetBSD: sbrk.S,v 1.4 1996/10/17 03:08:20 cgd Exp $ */ /* @@ -36,8 +36,10 @@ EXPORT(__curbrk) .quad _end +WEAK_ALIAS(sbrk, _sbrk) + .text -LEAF(sbrk, 1) +LEAF(_sbrk, 1) br pv, L1 /* XXX profiling */ L1: LDGP(pv) ldq a1, __curbrk @@ -46,4 +48,4 @@ L1: LDGP(pv) stq a0, __curbrk mov a1, v0 RET -END(sbrk) +END(_sbrk) diff --git a/lib/libc/arch/amd64/SYS.h b/lib/libc/arch/amd64/SYS.h index efc12d5ecd9..a61385fc13a 100644 --- a/lib/libc/arch/amd64/SYS.h +++ b/lib/libc/arch/amd64/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.12 2015/06/17 03:04:50 uebayasi Exp $ */ +/* $OpenBSD: SYS.h,v 1.13 2015/08/26 01:54:09 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -53,7 +53,6 @@ #define CERROR _C_LABEL(__cerror) #define _CERROR _C_LABEL(___cerror) -#define CURBRK _C_LABEL(__curbrk) #define _SYSCALL_NOERROR(x,y) \ SYSENTRY(x); \ diff --git a/lib/libc/arch/amd64/Symbols.list b/lib/libc/arch/amd64/Symbols.list index fd233c48ed6..c8692e1e33f 100644 --- a/lib/libc/arch/amd64/Symbols.list +++ b/lib/libc/arch/amd64/Symbols.list @@ -1,8 +1,6 @@ __ULtox_D2A __mcount -__minbrk __strtorx -_brk _fpgetmask _fpgetround _fpgetsticky @@ -10,9 +8,3 @@ _fpsetmask _fpsetround _fpsetsticky _mcount -_sbrk -_thread_sys__brk -_thread_sys__sbrk -_thread_sys_exect -_thread_sys_syscall -minbrk diff --git a/lib/libc/arch/amd64/sys/brk.S b/lib/libc/arch/amd64/sys/brk.S index ea6efeba107..3f9f6d7a7be 100644 --- a/lib/libc/arch/amd64/sys/brk.S +++ b/lib/libc/arch/amd64/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.5 2015/06/17 03:04:50 uebayasi Exp $ */ +/* $OpenBSD: brk.S,v 1.6 2015/08/26 01:54:09 guenther Exp $ */ /* $NetBSD: brk.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $ */ /*- @@ -40,23 +40,18 @@ #include "SYS.h" .globl _end - .globl _C_LABEL(__minbrk) - .globl _C_LABEL(minbrk) .globl __curbrk -#ifdef WEAK_ALIAS WEAK_ALIAS(brk, _brk) -#endif .data -_C_LABEL(minbrk): -_C_LABEL(__minbrk): +__minbrk: .quad _end .text -SYSENTRY(_brk) +ENTRY(_brk) #ifdef __PIC__ - movq PIC_GOT(_C_LABEL(__minbrk)),%rdx + movq PIC_GOT(__minbrk),%rdx cmpq %rdi,(%rdx) jb 1f movq (%rdx),%rdi @@ -71,9 +66,9 @@ err: movq PIC_GOT(CERROR),%rdx jmp *%rdx #else - cmpq %rdi,_C_LABEL(__minbrk)(%rip) + cmpq %rdi,__minbrk(%rip) jb 1f - movq _C_LABEL(__minbrk)(%rip),%rdi + movq __minbrk(%rip),%rdi 1: SYSTRAP(break) jc err @@ -83,4 +78,4 @@ err: err: jmp CERROR #endif -SYSEXIT(_brk) +END(_brk) diff --git a/lib/libc/arch/amd64/sys/exect.S b/lib/libc/arch/amd64/sys/exect.S deleted file mode 100644 index fa7fa6b1c70..00000000000 --- a/lib/libc/arch/amd64/sys/exect.S +++ /dev/null @@ -1,54 +0,0 @@ -/* $OpenBSD: exect.S,v 1.4 2015/06/17 03:04:50 uebayasi Exp $ */ -/* $NetBSD: exect.S,v 1.1 2001/06/19 00:25:06 fvdl Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)exect.s 5.1 (Berkeley) 4/23/90 - */ - -#include <machine/asm.h> - -#include "SYS.h" -#include <machine/psl.h> - -SYSENTRY(exect) - pushfq - orb $(PSL_T>>8),1(%rsp) - popfq - SYSTRAP(execve) -#ifdef __PIC__ - movq PIC_GOT(CERROR), %rcx - jmp *%rcx -#else - jmp CERROR -#endif -SYSEXIT(exect) diff --git a/lib/libc/arch/amd64/sys/sbrk.S b/lib/libc/arch/amd64/sys/sbrk.S index 2e04460cf4a..848274f6f84 100644 --- a/lib/libc/arch/amd64/sys/sbrk.S +++ b/lib/libc/arch/amd64/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.5 2015/06/17 03:04:50 uebayasi Exp $ */ +/* $OpenBSD: sbrk.S,v 1.6 2015/08/26 01:54:09 guenther Exp $ */ /* $NetBSD: sbrk.S,v 1.1 2001/06/19 00:25:06 fvdl Exp $ */ /*- @@ -45,16 +45,15 @@ .globl _end .globl __curbrk + .hidden __curbrk -#ifdef WEAK_ALIAS WEAK_ALIAS(sbrk, _sbrk) -#endif .data __curbrk: .quad _end .text -SYSENTRY(_sbrk) +ENTRY(_sbrk) #ifdef __PIC__ movq PIC_GOT(__curbrk),%rdx movslq %edi, %rax @@ -82,4 +81,4 @@ err: err: jmp CERROR #endif -SYSEXIT(_sbrk) +END(_sbrk) diff --git a/lib/libc/arch/arm/SYS.h b/lib/libc/arch/arm/SYS.h index 2fb7c3a91ba..ce42349711a 100644 --- a/lib/libc/arch/arm/SYS.h +++ b/lib/libc/arch/arm/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.9 2015/04/07 01:27:06 guenther Exp $ */ +/* $OpenBSD: SYS.h,v 1.10 2015/08/26 01:54:09 guenther Exp $ */ /* $NetBSD: SYS.h,v 1.8 2003/08/07 16:42:02 agc Exp $ */ /*- @@ -51,7 +51,6 @@ #define CERROR _C_LABEL(__cerror) #define _CERROR _C_LABEL(___cerror) -#define CURBRK _C_LABEL(__curbrk) #define _SYSCALL_NOERROR(x,y) \ SYSENTRY(x); \ diff --git a/lib/libc/arch/arm/Symbols.list b/lib/libc/arch/arm/Symbols.list index a2d20b24787..6a3b0adb18a 100644 --- a/lib/libc/arch/arm/Symbols.list +++ b/lib/libc/arch/arm/Symbols.list @@ -30,7 +30,6 @@ __lesf2 __ltdf2 __ltsf2 __mcount -__minbrk __modsi3 __muldf3 __mulsf3 @@ -45,7 +44,6 @@ __udivsi3 __umodsi3 __unorddf2 __unordsf2 -_brk _bss_end__ _fpgetmask _fpgetround @@ -55,7 +53,6 @@ _fpsetround _fpsetsticky _mcount _memcpy -_sbrk _softfloat_float32_eq _softfloat_float32_le _softfloat_float32_lt @@ -67,10 +64,6 @@ _softfloat_float_exception_mask _softfloat_float_raise _softfloat_float_rounding_mode _stack -_thread_sys__brk -_thread_sys__sbrk -_thread_sys_exect -_thread_sys_syscall add64 add96 end @@ -80,7 +73,6 @@ frexpl ldexpl le64 lt64 -minbrk modfl mul32To64 mul64By32To96 diff --git a/lib/libc/arch/arm/sys/brk.S b/lib/libc/arch/arm/sys/brk.S index 27adaf62fa9..e348be27e0f 100644 --- a/lib/libc/arch/arm/sys/brk.S +++ b/lib/libc/arch/arm/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.5 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: brk.S,v 1.6 2015/08/26 01:54:09 guenther Exp $ */ /* $NetBSD: brk.S,v 1.7 2003/12/26 11:23:44 martin Exp $ */ /*- @@ -35,23 +35,20 @@ #include "SYS.h" .globl _C_LABEL(end) - .globl CURBRK + .globl __curbrk -#ifdef WEAK_ALIAS WEAK_ALIAS(brk, _brk) -#endif .data .align 0 - .globl _C_LABEL(__minbrk) - .type _C_LABEL(__minbrk),#object -_C_LABEL(__minbrk): + .type __minbrk,#object +__minbrk: .word _C_LABEL(end) /* * Change the data segment size */ -SYSENTRY(_brk) +ENTRY(_brk) #ifdef __PIC__ /* Setup the GOT */ ldr r3, .Lgot @@ -94,6 +91,6 @@ SYSENTRY(_brk) .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (.L1+8) #endif .Lminbrk: - .word PIC_SYM(_C_LABEL(__minbrk), GOT) + .word PIC_SYM(__minbrk, GOT) .Lcurbrk: - .word PIC_SYM(CURBRK, GOT) + .word PIC_SYM(__curbrk, GOT) diff --git a/lib/libc/arch/arm/sys/exect.S b/lib/libc/arch/arm/sys/exect.S deleted file mode 100644 index e90f9926d6b..00000000000 --- a/lib/libc/arch/arm/sys/exect.S +++ /dev/null @@ -1,37 +0,0 @@ -/* $OpenBSD: exect.S,v 1.2 2004/02/01 05:40:52 drahn Exp $ */ -/* $NetBSD: exect.S,v 1.4 2003/08/07 16:42:04 agc Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)exect.s 5.1 (Berkeley) 4/23/90 - */ - -#include "SYS.h" - -PSEUDO(exect,execve) diff --git a/lib/libc/arch/arm/sys/sbrk.S b/lib/libc/arch/arm/sys/sbrk.S index 6d501d71efb..cb594713e92 100644 --- a/lib/libc/arch/arm/sys/sbrk.S +++ b/lib/libc/arch/arm/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.5 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: sbrk.S,v 1.6 2015/08/26 01:54:09 guenther Exp $ */ /* $NetBSD: sbrk.S,v 1.7 2003/08/07 16:42:05 agc Exp $ */ /*- @@ -36,19 +36,14 @@ .globl _C_LABEL(end) -#ifdef WEAK_ALIAS WEAK_ALIAS(sbrk, _sbrk) -#endif .data .align 0 - .globl CURBRK - .type CURBRK,#object - .globl minbrk - .type minbrk,#object -CURBRK: - .word _C_LABEL(end) -_ASM_LABEL(minbrk): + .globl __curbrk + .type __curbrk,#object + .hidden __curbrk +__curbrk: .word _C_LABEL(end) /* @@ -88,4 +83,4 @@ SYSENTRY(_sbrk) .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (.L1+8) #endif .Lcurbrk: - .word PIC_SYM(CURBRK, GOT) + .word PIC_SYM(__curbrk, GOT) diff --git a/lib/libc/arch/hppa/Symbols.list b/lib/libc/arch/hppa/Symbols.list index 2a9c5112050..f39fb4f6e4a 100644 --- a/lib/libc/arch/hppa/Symbols.list +++ b/lib/libc/arch/hppa/Symbols.list @@ -1,12 +1,7 @@ _GLOBAL_OFFSET_TABLE_ _mcount -_thread_sys_brk -_thread_sys_exect -_thread_sys_sbrk -_thread_sys_syscall end fabsl frexpl ldexpl -minbrk modfl diff --git a/lib/libc/arch/hppa/sys/brk.S b/lib/libc/arch/hppa/sys/brk.S index 2163e5ae3af..0dae523c592 100644 --- a/lib/libc/arch/hppa/sys/brk.S +++ b/lib/libc/arch/hppa/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.15 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: brk.S,v 1.16 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -32,18 +32,20 @@ .import end, data .data - .export minbrk, data -minbrk + .export __minbrk, data +__minbrk .long end -SYSENTRY(brk) +WEAK_ALIAS(brk, _brk) + +LEAF_ENTRY(_brk) #ifdef __PIC__ - addil LT%minbrk, r19 - ldw RT%minbrk(r1), t1 + addil LT%__minbrk, r19 + ldw RT%__minbrk(r1), t1 ldw 0(t1), t2 #else - ldil L%minbrk, t1 - ldw R%minbrk(t1), t2 + ldil L%__minbrk, t1 + ldw R%__minbrk(t1), t2 #endif sub,<< t2, arg0, r0 copy t2, arg0 @@ -62,7 +64,7 @@ SYSENTRY(brk) bv r0(rp) stw arg0, R%__curbrk(t1) #endif -SYSEXIT(brk) +EXIT(_brk) .end diff --git a/lib/libc/arch/hppa/sys/exect.S b/lib/libc/arch/hppa/sys/exect.S deleted file mode 100644 index 19c2cb01076..00000000000 --- a/lib/libc/arch/hppa/sys/exect.S +++ /dev/null @@ -1,34 +0,0 @@ -/* $OpenBSD: exect.S,v 1.7 2005/08/07 16:40:14 espie Exp $ */ - -/* - * Copyright (c) 1999 Michael Shalayeff - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "SYS.h" - -/* we do no tracing yet */ -PSEUDO(exect,execve) - - .end diff --git a/lib/libc/arch/hppa/sys/sbrk.S b/lib/libc/arch/hppa/sys/sbrk.S index 91ccd18c21c..a164e48931a 100644 --- a/lib/libc/arch/hppa/sys/sbrk.S +++ b/lib/libc/arch/hppa/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.14 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: sbrk.S,v 1.15 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -35,7 +35,9 @@ __curbrk .long end -SYSENTRY(sbrk) +WEAK_ALIAS(sbrk, _sbrk) + +LEAF_ENTRY(_sbrk) #ifdef __PIC__ addil LT%__curbrk, r19 ldw RT%__curbrk(r1), t1 @@ -61,7 +63,7 @@ SYSENTRY(sbrk) bv r0(rp) stw arg0, 0(t1) -SYSEXIT(sbrk) +EXIT(_sbrk) .end diff --git a/lib/libc/arch/hppa64/sys/brk.S b/lib/libc/arch/hppa64/sys/brk.S index 15376196eae..9ba588e11ab 100644 --- a/lib/libc/arch/hppa64/sys/brk.S +++ b/lib/libc/arch/hppa64/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.5 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: brk.S,v 1.6 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -32,18 +32,20 @@ .import end, data .data - .export minbrk, data -minbrk + .export __minbrk, data +__minbrk .long end -SYSENTRY(brk) +WEAK_ALIAS(brk, _brk) + +LEAF_ENTRY(_brk) #ifdef __PIC__ - addil LT%minbrk, %r19 - ldd RT%minbrk(%r1), arg4 + addil LT%__minbrk, %r19 + ldd RT%__minbrk(%r1), arg4 ldd 0(arg4), arg5 #else - ldil L%minbrk, arg4 - ldd R%minbrk(arg4), arg5 + ldil L%__minbrk, arg4 + ldd R%__minbrk(arg4), arg5 #endif sub,<< arg5, %arg0, %r0 copy arg5, %arg0 @@ -62,7 +64,7 @@ SYSENTRY(brk) bv %r0(%rp) std %arg0, R%__curbrk(arg4) #endif -SYSEXIT(brk) +EXIT(_brk) .end diff --git a/lib/libc/arch/hppa64/sys/exect.S b/lib/libc/arch/hppa64/sys/exect.S deleted file mode 100644 index 749a2de8e81..00000000000 --- a/lib/libc/arch/hppa64/sys/exect.S +++ /dev/null @@ -1,34 +0,0 @@ -/* $OpenBSD: exect.S,v 1.2 2005/08/07 16:40:14 espie Exp $ */ - -/* - * Copyright (c) 1999 Michael Shalayeff - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "SYS.h" - -/* we do no tracing yet */ -PSEUDO(exect,execve) - - .end diff --git a/lib/libc/arch/hppa64/sys/sbrk.S b/lib/libc/arch/hppa64/sys/sbrk.S index df3e303e40f..5a8c68c226f 100644 --- a/lib/libc/arch/hppa64/sys/sbrk.S +++ b/lib/libc/arch/hppa64/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.5 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: sbrk.S,v 1.6 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -35,7 +35,9 @@ __curbrk .long end -SYSENTRY(sbrk) +WEAK_ALIAS(sbrk, _sbrk) + +LEAF_ENTRY(_sbrk) #ifdef __PIC__ addil LT%__curbrk, %r19 ldd RT%__curbrk(%r1), %arg3 @@ -61,7 +63,7 @@ SYSENTRY(sbrk) bv %r0(%rp) std %arg0, 0(%arg3) -SYSEXIT(sbrk) +EXIT(_sbrk) .end diff --git a/lib/libc/arch/i386/SYS.h b/lib/libc/arch/i386/SYS.h index a6c1c852c03..9328b480020 100644 --- a/lib/libc/arch/i386/SYS.h +++ b/lib/libc/arch/i386/SYS.h @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: SYS.h,v 1.20 2015/04/07 01:27:06 guenther Exp $ + * $OpenBSD: SYS.h,v 1.21 2015/08/26 01:54:09 guenther Exp $ */ #include <machine/asm.h> @@ -58,7 +58,6 @@ #define CERROR _C_LABEL(__cerror) #define _CERROR _C_LABEL(___cerror) -#define CURBRK _C_LABEL(__curbrk) /* perform a syscall */ #define _SYSCALL_NOERROR(x,y) \ diff --git a/lib/libc/arch/i386/Symbols.list b/lib/libc/arch/i386/Symbols.list index 28c1d05e192..5d73def05f6 100644 --- a/lib/libc/arch/i386/Symbols.list +++ b/lib/libc/arch/i386/Symbols.list @@ -5,6 +5,4 @@ __fixunsdfsi __mcount __strtorx __udivsi3 -_thread_sys_syscall mcount -minbrk diff --git a/lib/libc/arch/i386/sys/brk.S b/lib/libc/arch/i386/sys/brk.S index 5d3149db906..4cafe3049cd 100644 --- a/lib/libc/arch/i386/sys/brk.S +++ b/lib/libc/arch/i386/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.9 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: brk.S,v 1.10 2015/08/26 01:54:09 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -34,18 +34,18 @@ #include "SYS.h" .globl _end - .globl minbrk .globl __curbrk .data -minbrk: .long _end +__minbrk: + .long _end .text ENTRY(brk) #ifdef __PIC__ movl 4(%esp),%ecx PIC_PROLOGUE - movl PIC_GOT(minbrk),%edx + movl PIC_GOT(__minbrk),%edx PIC_EPILOGUE cmpl %ecx,(%edx) jb 1f @@ -70,9 +70,9 @@ err: #else movl 4(%esp),%ecx - cmpl %ecx,minbrk + cmpl %ecx,__minbrk jb 1f - movl minbrk,%ecx + movl __minbrk,%ecx movl %ecx,4(%esp) 1: movl $(SYS_break),%eax diff --git a/lib/libc/arch/i386/sys/exect.S b/lib/libc/arch/i386/sys/exect.S deleted file mode 100644 index 68f4639f360..00000000000 --- a/lib/libc/arch/i386/sys/exect.S +++ /dev/null @@ -1,53 +0,0 @@ -/* $OpenBSD: exect.S,v 1.7 2012/08/22 17:19:34 pascal Exp $ */ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" -#include <machine/psl.h> - -ENTRY(exect) - movl $(SYS_execve),%eax - pushf - popl %edx - orl $(PSL_T),%edx - pushl %edx - popf - int $0x80 -#ifdef __PIC__ - PIC_PROLOGUE - movl PIC_GOT(CERROR), %ecx - PIC_EPILOGUE - jmp *%ecx - -#else - jmp CERROR -#endif diff --git a/lib/libc/arch/i386/sys/sbrk.S b/lib/libc/arch/i386/sys/sbrk.S index 8e61d00cab6..a57d96c5987 100644 --- a/lib/libc/arch/i386/sys/sbrk.S +++ b/lib/libc/arch/i386/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.9 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: sbrk.S,v 1.10 2015/08/26 01:54:09 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -35,6 +35,7 @@ .globl _end .globl __curbrk + .hidden __curbrk .data __curbrk: .long _end diff --git a/lib/libc/arch/m88k/sys/brk.S b/lib/libc/arch/m88k/sys/brk.S index 34f9f856174..c073dbc185e 100644 --- a/lib/libc/arch/m88k/sys/brk.S +++ b/lib/libc/arch/m88k/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.12 2013/01/24 05:24:47 miod Exp $ */ +/* $OpenBSD: brk.S,v 1.13 2015/08/26 01:54:09 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -40,10 +40,12 @@ .data .align 8 -ASGLOBAL(__minbrk) +__minbrk: .long _end -ENTRY(brk) +WEAK_ALIAS(brk,_brk) + +ENTRY(_brk) #ifdef __PIC__ PIC_SAVE(%r9) PIC_SETUP @@ -86,4 +88,4 @@ ENTRY(brk) br.n CERROR PIC_RESTORE(%r9) #endif -END(brk) +END(_brk) diff --git a/lib/libc/arch/m88k/sys/exect.S b/lib/libc/arch/m88k/sys/exect.S deleted file mode 100644 index 68600ab5b2a..00000000000 --- a/lib/libc/arch/m88k/sys/exect.S +++ /dev/null @@ -1,42 +0,0 @@ -/* $OpenBSD: exect.S,v 1.9 2013/01/23 18:59:32 miod Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * the Systems Programming Group of the University of Utah Computer - * Science Department. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" - -ENTRY(exect) - or %r13,%r0,SYS_execve - tb0 0,%r0,450 /* exect(file, argv, env) */ - br CERROR -END(exect) diff --git a/lib/libc/arch/m88k/sys/sbrk.S b/lib/libc/arch/m88k/sys/sbrk.S index 9902bddbc49..962799d77c7 100644 --- a/lib/libc/arch/m88k/sys/sbrk.S +++ b/lib/libc/arch/m88k/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.12 2013/01/24 05:24:47 miod Exp $ */ +/* $OpenBSD: sbrk.S,v 1.13 2015/08/26 01:54:09 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -44,7 +44,9 @@ __curbrk: .long _end .text -ENTRY(sbrk) +WEAK_ALIAS(sbrk,_sbrk) + +ENTRY(_sbrk) #ifdef __PIC__ PIC_SAVE(%r9) PIC_SETUP @@ -90,4 +92,4 @@ ENTRY(sbrk) br.n CERROR PIC_RESTORE(%r9) #endif -END(sbrk) +END(_sbrk) diff --git a/lib/libc/arch/mips64/Symbols.list b/lib/libc/arch/mips64/Symbols.list index 1a34ea2df6c..f88528faa1d 100644 --- a/lib/libc/arch/mips64/Symbols.list +++ b/lib/libc/arch/mips64/Symbols.list @@ -5,17 +5,12 @@ __pack_t __strtorQ __thenan_tf __unpack_t -_brk _fbss _flush_cache _ftext _gp _mcount -_thread_sys_exect -_thread_sys_syscall cacheflush -curbrk end get_fpc_csr -minbrk set_fpc_csr diff --git a/lib/libc/arch/mips64/sys/brk.S b/lib/libc/arch/mips64/sys/brk.S index 11a1afa54c6..8a7f90d1e98 100644 --- a/lib/libc/arch/mips64/sys/brk.S +++ b/lib/libc/arch/mips64/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.5 2011/04/04 12:42:39 guenther Exp $ */ +/* $OpenBSD: brk.S,v 1.6 2015/08/26 01:54:09 guenther Exp $ */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -33,21 +33,23 @@ #include "SYS.h" - .globl minbrk - .globl curbrk + .globl __curbrk .data -minbrk: PTR_VAL _C_LABEL(end) +__minbrk: + PTR_VAL _C_LABEL(end) .text FRAMESZ= MKFSIZ(1,1) GPOFF= FRAMESZ-2*REGSZ -LEAF(brk, FRAMESZ) +WEAK_ALIAS(brk, _brk) + +LEAF(_brk, FRAMESZ) PTR_SUBU sp, FRAMESZ - SETUP_GP64(GPOFF, brk) + SETUP_GP64(GPOFF, _brk) .set reorder - PTR_L v0, minbrk + PTR_L v0, __minbrk bgtu a0, v0, 1f move a0, v0 # dont allow break < minbrk @@ -55,7 +57,7 @@ LEAF(brk, FRAMESZ) li v0, SYS_break syscall bne a3, zero, 2f - PTR_S a0, curbrk + PTR_S a0, __curbrk move v0, zero RESTORE_GP64 PTR_ADDU sp, FRAMESZ @@ -65,26 +67,4 @@ LEAF(brk, FRAMESZ) RESTORE_GP64 PTR_ADDU sp, FRAMESZ jr t9 -END(brk) - -FRAMESZ= MKFSIZ(1,1) -GPOFF= FRAMESZ-2*REGSZ - -LEAF(_brk, FRAMESZ) - PTR_SUBU sp, FRAMESZ - SETUP_GP64(GPOFF, brk) - .set reorder - li v0, SYS_break - syscall - bne a3, zero, 1f - PTR_S a0, curbrk - move v0, zero - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - j ra -1: - LA t9, CERROR - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - jr t9 END(_brk) diff --git a/lib/libc/arch/mips64/sys/exect.S b/lib/libc/arch/mips64/sys/exect.S deleted file mode 100644 index 2cb8ff90625..00000000000 --- a/lib/libc/arch/mips64/sys/exect.S +++ /dev/null @@ -1,54 +0,0 @@ -/* $OpenBSD: exect.S,v 1.5 2011/04/04 12:42:39 guenther Exp $ */ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" - -FRAMESZ= MKFSIZ(1,1) -GPOFF= FRAMESZ-2*REGSZ - -SYSLEAF(exect, FRAMESZ) - PTR_SUBU sp, FRAMESZ - SETUP_GP64(GPOFF, exect) - .set reorder - li v0, SYS_execve - syscall - bne a3, zero, 1f - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - j ra -1: - LA t9, CERROR - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - jr t9 -SYSEND(exect) diff --git a/lib/libc/arch/mips64/sys/sbrk.S b/lib/libc/arch/mips64/sys/sbrk.S index 2b223e5d310..3bb14cd2002 100644 --- a/lib/libc/arch/mips64/sys/sbrk.S +++ b/lib/libc/arch/mips64/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.5 2011/04/04 12:42:39 guenther Exp $ */ +/* $OpenBSD: sbrk.S,v 1.6 2015/08/26 01:54:09 guenther Exp $ */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -33,27 +33,30 @@ #include "SYS.h" - .globl curbrk + .globl __curbrk + .hidden __curbrk .data -curbrk: PTR_VAL _C_LABEL(end) +__curbrk: PTR_VAL _C_LABEL(end) .text FRAMESZ= MKFSIZ(1,1) GPOFF= FRAMESZ-2*REGSZ -LEAF(sbrk, FRAMESZ) +WEAK_ALIAS(sbrk, _sbrk) + +LEAF(_sbrk, FRAMESZ) PTR_SUBU sp, FRAMESZ - SETUP_GP64(GPOFF, sbrk) + SETUP_GP64(GPOFF, _sbrk) .set reorder - PTR_L v1, curbrk + PTR_L v1, __curbrk li v0, SYS_break PTR_ADDU a0, a0, v1 # compute current break syscall bne a3, zero, 1f move v0, v1 # return old val of curbrk from above - PTR_S a0, curbrk # save current val of curbrk from above + PTR_S a0, __curbrk # save current val of curbrk from above RESTORE_GP64 PTR_ADDU sp, FRAMESZ j ra @@ -62,4 +65,4 @@ LEAF(sbrk, FRAMESZ) RESTORE_GP64 PTR_ADDU sp, FRAMESZ jr t9 -END(sbrk) +END(_sbrk) diff --git a/lib/libc/arch/powerpc/Symbols.list b/lib/libc/arch/powerpc/Symbols.list index 4041c4ab73a..6a6381d9e1a 100644 --- a/lib/libc/arch/powerpc/Symbols.list +++ b/lib/libc/arch/powerpc/Symbols.list @@ -3,13 +3,8 @@ __floatundidf __plt_end __plt_start _mcount -_thread_sys_brk -_thread_sys_exect -_thread_sys_sbrk -_thread_sys_syscall end fabsl frexpl ldexpl -minbrk modfl diff --git a/lib/libc/arch/powerpc/sys/brk.S b/lib/libc/arch/powerpc/sys/brk.S index f027e7c3c8a..4ba833e8e1f 100644 --- a/lib/libc/arch/powerpc/sys/brk.S +++ b/lib/libc/arch/powerpc/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.9 2015/08/23 15:44:51 kettenis Exp $ */ +/* $OpenBSD: brk.S,v 1.10 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1996 Dale Rahn @@ -27,10 +27,12 @@ #include "SYS.h" - .extern _ASM_LABEL(__curbrk) + .extern __curbrk .extern _C_LABEL(end) -PREFIX2(brk,break) +WEAK_ALIAS(brk, _brk) + +PREFIX2(_brk,break) /* check >= _end, if not make the call for _end */ #ifndef __PIC__ @@ -53,10 +55,10 @@ PREFIX2(brk,break) mr 7, 3 /* call break(size) */ #ifndef __PIC__ - addis 6, 0, _ASM_LABEL(__curbrk)@H - ori 6, 6, _ASM_LABEL(__curbrk)@L /* # 6 = &__curbrk */ + addis 6, 0, __curbrk@H + ori 6, 6, __curbrk@L /* # 6 = &__curbrk */ #else - lwz 6,_ASM_LABEL(__curbrk)@got(9) + lwz 6,__curbrk@got(9) #endif sc diff --git a/lib/libc/arch/powerpc/sys/exect.S b/lib/libc/arch/powerpc/sys/exect.S deleted file mode 100644 index c468214c352..00000000000 --- a/lib/libc/arch/powerpc/sys/exect.S +++ /dev/null @@ -1,30 +0,0 @@ -/* $OpenBSD: exect.S,v 1.7 2005/08/07 16:40:15 espie Exp $ */ - -/* - * Copyright (c) 1996 Dale Rahn - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" - -PSEUDO(exect,execve) diff --git a/lib/libc/arch/powerpc/sys/sbrk.S b/lib/libc/arch/powerpc/sys/sbrk.S index 1a581e184ae..c728b9c86ce 100644 --- a/lib/libc/arch/powerpc/sys/sbrk.S +++ b/lib/libc/arch/powerpc/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.8 2015/08/23 15:44:51 kettenis Exp $ */ +/* $OpenBSD: sbrk.S,v 1.9 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1996 Dale Rahn @@ -29,21 +29,20 @@ .data .globl _end - .globl _ASM_LABEL(__curbrk) - .globl minbrk -_ASM_LABEL(__curbrk): - .long _C_LABEL(end) -_ASM_LABEL(minbrk): + .globl __curbrk + .hidden __curbrk +__curbrk: .long _C_LABEL(end) +WEAK_ALIAS(sbrk, _sbrk) .text -PREFIX2(sbrk,break) +PREFIX2(_sbrk,break) /* call break(__curbrk + size) */ #ifndef __PIC__ - addis 6, 0, _ASM_LABEL(__curbrk)@H - ori 6, 6, _ASM_LABEL(__curbrk)@L /* # 6 = &__curbrk */ + addis 6, 0, __curbrk@H + ori 6, 6, __curbrk@L /* # 6 = &__curbrk */ #else mflr 10 bcl 20, 31, 1f @@ -51,7 +50,7 @@ PREFIX2(sbrk,break) addis 9, 9, _GLOBAL_OFFSET_TABLE_-1b@ha addi 9, 9, _GLOBAL_OFFSET_TABLE_-1b@l mtlr 10 - lwz 6,_ASM_LABEL(__curbrk)@got(9) + lwz 6,__curbrk@got(9) #endif lwz 5, 0(6) /* # 5 = *6 (old_curbrk) */ add 3, 5, 3 /* # 3 = new_curbrk */ diff --git a/lib/libc/arch/sh/Symbols.list b/lib/libc/arch/sh/Symbols.list index 2411bc33924..b4ca3d5e393 100644 --- a/lib/libc/arch/sh/Symbols.list +++ b/lib/libc/arch/sh/Symbols.list @@ -4,13 +4,6 @@ ___dtors ___dtors_end __floatundidf __mcount -__minbrk -_brk -_sbrk -_thread_sys__brk -_thread_sys__sbrk -_thread_sys_exect -_thread_sys_syscall end fabsl frexpl diff --git a/lib/libc/arch/sh/sys/brk.S b/lib/libc/arch/sh/sys/brk.S index 2670373019b..30d76ceedf6 100644 --- a/lib/libc/arch/sh/sys/brk.S +++ b/lib/libc/arch/sh/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.2 2012/08/22 17:19:35 pascal Exp $ */ +/* $OpenBSD: brk.S,v 1.3 2015/08/26 01:54:09 guenther Exp $ */ /* $NetBSD: brk.S,v 1.10 2006/01/06 03:58:31 uwe Exp $ */ /*- @@ -37,19 +37,16 @@ #include "SYS.h" -#ifdef WEAK_ALIAS WEAK_ALIAS(brk,_brk) -#endif .data - .globl _C_LABEL(__minbrk) .align 2 -_C_LABEL(__minbrk): +__minbrk: .long _C_LABEL(end) .text -SYSENTRY(_brk) +ENTRY(_brk) #ifdef __PIC__ mova L_GOT, r0 mov.l L_GOT, r2 @@ -85,10 +82,10 @@ err: LSYS_break: .long SYS_break #ifdef __PIC__ L_GOT: .long _GLOBAL_OFFSET_TABLE_ -Lminbrk: .long _C_LABEL(__minbrk)@GOT -Lcurbrk: .long _C_LABEL(__curbrk)@GOT +Lminbrk: .long __minbrk@GOT +Lcurbrk: .long __curbrk@GOT #else -Lminbrk: .long _C_LABEL(__minbrk) -Lcurbrk: .long _C_LABEL(__curbrk) +Lminbrk: .long __minbrk +Lcurbrk: .long __curbrk #endif SET_ENTRY_SIZE(_brk) diff --git a/lib/libc/arch/sh/sys/exect.S b/lib/libc/arch/sh/sys/exect.S deleted file mode 100644 index c29def5bc24..00000000000 --- a/lib/libc/arch/sh/sys/exect.S +++ /dev/null @@ -1,40 +0,0 @@ -/* $OpenBSD: exect.S,v 1.1 2006/10/10 22:07:10 miod Exp $ */ -/* $NetBSD: exect.S,v 1.5 2006/01/06 01:53:30 uwe Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)exect.s 5.1 (Berkeley) 4/23/90 - */ - -#include "SYS.h" - -PSEUDO(exect,execve) diff --git a/lib/libc/arch/sh/sys/sbrk.S b/lib/libc/arch/sh/sys/sbrk.S index bb783cfe3aa..e73423abc36 100644 --- a/lib/libc/arch/sh/sys/sbrk.S +++ b/lib/libc/arch/sh/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.2 2012/08/22 17:19:35 pascal Exp $ */ +/* $OpenBSD: sbrk.S,v 1.3 2015/08/26 01:54:09 guenther Exp $ */ /* $NetBSD: sbrk.S,v 1.9 2006/01/06 03:58:31 uwe Exp $ */ /*- @@ -38,18 +38,17 @@ #include "SYS.h" .globl _C_LABEL(end) - .globl _C_LABEL(__curbrk) + .globl __curbrk + .hidden __curbrk -#ifdef WEAK_ALIAS WEAK_ALIAS(sbrk,_sbrk) -#endif .data -_C_LABEL(__curbrk): +__curbrk: .long _C_LABEL(end) .text -SYSENTRY(_sbrk) +ENTRY(_sbrk) mov r4, r2 #ifdef __PIC__ mova L_GOT, r0 @@ -82,8 +81,8 @@ err: LSYS_break: .long SYS_break #ifdef __PIC__ L_GOT: .long _GLOBAL_OFFSET_TABLE_ -Lcurbrk: .long _C_LABEL(__curbrk)@GOT +Lcurbrk: .long __curbrk@GOT #else -Lcurbrk: .long _C_LABEL(__curbrk) +Lcurbrk: .long __curbrk #endif SET_ENTRY_SIZE(_sbrk) diff --git a/lib/libc/arch/sparc/Symbols.list b/lib/libc/arch/sparc/Symbols.list index b22bff63ea2..f678e521ec4 100644 --- a/lib/libc/arch/sparc/Symbols.list +++ b/lib/libc/arch/sparc/Symbols.list @@ -10,8 +10,6 @@ __floatundidf __plt_end __plt_start _mcount -_thread_sys_exect fabsl frexpl ldexpl -minbrk diff --git a/lib/libc/arch/sparc/sys/brk.S b/lib/libc/arch/sparc/sys/brk.S index 408d6f41afc..9dbefa99952 100644 --- a/lib/libc/arch/sparc/sys/brk.S +++ b/lib/libc/arch/sparc/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.8 2012/09/04 19:08:15 deraadt Exp $ */ +/* $OpenBSD: brk.S,v 1.9 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -35,20 +35,22 @@ #include "SYS.h" .globl __curbrk - .globl minbrk .data -minbrk: .long _end ! lower brk limit; also for gmon code +__minbrk: + .long _end ! lower brk limit; also for gmon code .text +WEAK_ALIAS(brk, _brk) + #ifdef __PIC__ -ENTRY(brk) +ENTRY(_brk) PIC_PROLOGUE(%o5,%o4) #if __PIC__ == 1 - ld [%o5 + minbrk], %o4 + ld [%o5 + __minbrk], %o4 #else /* __PIC__ == 2 */ - sethi %hi(minbrk), %o4 - or %o4, %lo(minbrk), %o4 + sethi %hi(__minbrk), %o4 + or %o4, %lo(__minbrk), %o4 ld [%o5 + %o4], %o4 #endif ld [%o4], %o1 ! %o1 = minbrk @@ -72,9 +74,9 @@ ENTRY(brk) retl ! success, return 0 & record new break st %o2, [%o4] #else -ENTRY(brk) - sethi %hi(minbrk), %o1 ! %o1 = minbrk - ld [%o1 + %lo(minbrk)], %o1 +ENTRY(_brk) + sethi %hi(__minbrk), %o1 ! %o1 = minbrk + ld [%o1 + %lo(__minbrk)], %o1 cmp %o1, %o0 ! if (minbrk > %o0) bgu,a 0f mov %o1, %o0 ! %o0 = minbrk diff --git a/lib/libc/arch/sparc/sys/exect.S b/lib/libc/arch/sparc/sys/exect.S deleted file mode 100644 index 4727de90ccc..00000000000 --- a/lib/libc/arch/sparc/sys/exect.S +++ /dev/null @@ -1,40 +0,0 @@ -/* $OpenBSD: exect.S,v 1.5 2005/08/07 16:40:15 espie Exp $ */ -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" - -SYSENTRY(exect) - mov SYS_execve, %g1 /* execve(file, argv, env) */ - t ST_SYSCALL - ERROR() diff --git a/lib/libc/arch/sparc/sys/sbrk.S b/lib/libc/arch/sparc/sys/sbrk.S index c5df545c51d..61e3ce3ac2e 100644 --- a/lib/libc/arch/sparc/sys/sbrk.S +++ b/lib/libc/arch/sparc/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.7 2012/09/04 19:08:15 deraadt Exp $ */ +/* $OpenBSD: sbrk.S,v 1.8 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -36,12 +36,15 @@ .globl _end .globl __curbrk + .hidden __curbrk .data __curbrk: .long _end .text -ENTRY(sbrk) +WEAK_ALIAS(sbrk, _sbrk) + +ENTRY(_sbrk) #ifdef __PIC__ PIC_PROLOGUE(%o5,%o4) #if __PIC__ == 1 diff --git a/lib/libc/arch/sparc64/Symbols.list b/lib/libc/arch/sparc64/Symbols.list index 7aa1267caf1..750c688f4df 100644 --- a/lib/libc/arch/sparc64/Symbols.list +++ b/lib/libc/arch/sparc64/Symbols.list @@ -82,8 +82,4 @@ __ftoul __plt_end __plt_start __strtorQ -_brk _mcount -_thread_sys_exect -_thread_sys_syscall -minbrk diff --git a/lib/libc/arch/sparc64/sys/brk.S b/lib/libc/arch/sparc64/sys/brk.S index 188ca3db508..0d0bc32b64a 100644 --- a/lib/libc/arch/sparc64/sys/brk.S +++ b/lib/libc/arch/sparc64/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.5 2012/08/22 17:19:35 pascal Exp $ */ +/* $OpenBSD: brk.S,v 1.6 2015/08/26 01:54:09 guenther Exp $ */ /* $NetBSD: brk.S,v 1.9 2000/07/25 20:15:40 mycroft Exp $ */ /* @@ -38,24 +38,21 @@ #include "SYS.h" - .globl _C_LABEL(__curbrk) - .globl _C_LABEL(minbrk) + .globl __curbrk .globl _C_LABEL(_end) -#ifdef WEAK_ALIAS WEAK_ALIAS(brk, _brk) -#endif .data .align 8 -_C_LABEL(minbrk): +__minbrk: .xword _C_LABEL(_end) /* lower brk limit; also for gmon code */ .text ENTRY(_brk) #ifdef __PIC__ PIC_PROLOGUE(%o5,%o4) - set _C_LABEL(minbrk), %o4 + set __minbrk, %o4 ldx [%o5 + %o4], %o4 ldx [%o4], %o1 /* %o1 = minbrk */ cmp %o1, %o0 /* if (minbrk > %o0) */ @@ -63,7 +60,7 @@ ENTRY(_brk) mov %o0, %o2 /* save argument to syscall */ mov SYS_break, %g1 t ST_SYSCALL - set _C_LABEL(__curbrk), %o3 + set __curbrk, %o3 bcc,a,pt %icc, 1f ldx [%o5 + %o3], %o4 ERROR() @@ -71,17 +68,17 @@ ENTRY(_brk) retl /* success, return 0 & record new break */ stx %o2, [%o4] #else - sethi %hi(_C_LABEL(minbrk)), %o1 /* %o1 = minbrk */ - ldx [%o1 + %lo(_C_LABEL(minbrk))], %o1 + sethi %hi(__minbrk), %o1 /* %o1 = minbrk */ + ldx [%o1 + %lo(__minbrk)], %o1 cmp %o1, %o0 /* if (minbrk > %o0) */ movgu %xcc, %o1, %o0 /* %o0 = minbrk */ mov %o0, %o2 /* save argument to syscall */ mov SYS_break, %g1 t ST_SYSCALL bcc,a,pt %icc,1f - sethi %hi(_C_LABEL(__curbrk)), %g1 + sethi %hi(__curbrk), %g1 ERROR() 1: retl /* success, return 0 & record new break */ - stx %o2, [%g1 + %lo(_C_LABEL(__curbrk))] + stx %o2, [%g1 + %lo(__curbrk)] #endif diff --git a/lib/libc/arch/sparc64/sys/exect.S b/lib/libc/arch/sparc64/sys/exect.S deleted file mode 100644 index 416281f0a10..00000000000 --- a/lib/libc/arch/sparc64/sys/exect.S +++ /dev/null @@ -1,42 +0,0 @@ -/* $OpenBSD: exect.S,v 1.2 2003/06/02 20:18:33 millert Exp $ */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <machine/asm.h> -#include "SYS.h" - -SYSENTRY(exect) - mov SYS_execve, %g1 /* execve(file, argv, env) */ - t ST_SYSCALL - ERROR() diff --git a/lib/libc/arch/sparc64/sys/sbrk.S b/lib/libc/arch/sparc64/sys/sbrk.S index 58abd4f5098..82346c5775d 100644 --- a/lib/libc/arch/sparc64/sys/sbrk.S +++ b/lib/libc/arch/sparc64/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.3 2012/08/22 17:19:35 pascal Exp $ */ +/* $OpenBSD: sbrk.S,v 1.4 2015/08/26 01:54:09 guenther Exp $ */ /* $NetBSD: sbrk.S,v 1.7 2000/07/25 15:14:46 mycroft Exp $ */ /* @@ -38,19 +38,22 @@ #include "SYS.h" - .globl _C_LABEL(__curbrk) + .globl __curbrk + .hidden __curbrk .globl _C_LABEL(_end) .data .align 8 -_C_LABEL(__curbrk): +__curbrk: .xword _C_LABEL(_end) .text -ENTRY(sbrk) +WEAK_ALIAS(sbrk, _sbrk) + +ENTRY(_sbrk) #ifdef __PIC__ PIC_PROLOGUE(%o5,%o4) - set _C_LABEL(__curbrk), %o3 + set __curbrk, %o3 ldx [%o5 + %o3], %o2 ldx [%o2], %o3 /* %o3 = old break */ add %o3, %o0, %o4 /* %o4 = new break */ @@ -64,8 +67,8 @@ ENTRY(sbrk) retl /* and update curbrk */ stx %o4, [%o2] #else - sethi %hi(_C_LABEL(__curbrk)), %o2 - ldx [%o2 + %lo(_C_LABEL(__curbrk))], %o3 /* %o3 = old break */ + sethi %hi(__curbrk), %o2 + ldx [%o2 + %lo(__curbrk)], %o3 /* %o3 = old break */ add %o3, %o0, %o4 /* %o4 = new break */ mov %o4, %o0 /* copy for syscall */ mov SYS_break, %g1 @@ -75,5 +78,5 @@ ENTRY(sbrk) ERROR() 1: retl /* and update curbrk */ - stx %o4, [%o2 + %lo(_C_LABEL(__curbrk))] + stx %o4, [%o2 + %lo(__curbrk)] #endif diff --git a/lib/libc/arch/vax/sys/brk.S b/lib/libc/arch/vax/sys/brk.S index 39a708d254c..49023595209 100644 --- a/lib/libc/arch/vax/sys/brk.S +++ b/lib/libc/arch/vax/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.9 2013/07/05 21:10:50 miod Exp $ */ +/* $OpenBSD: brk.S,v 1.10 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -30,12 +30,19 @@ #include "SYS.h" + .data +__minbrk: + .long _end + .text + .globl __curbrk - .globl _C_LABEL(minbrk) -ENTRY(brk, 0) - cmpl _C_LABEL(minbrk),4(%ap) + +WEAK_ALIAS(brk,_brk) + +ENTRY(_brk, 0) + cmpl __minbrk,4(%ap) blequ ok - movl _C_LABEL(minbrk),4(%ap) + movl __minbrk,4(%ap) ok: chmk $ SYS_break jcs err diff --git a/lib/libc/arch/vax/sys/exect.S b/lib/libc/arch/vax/sys/exect.S deleted file mode 100644 index 97832482a96..00000000000 --- a/lib/libc/arch/vax/sys/exect.S +++ /dev/null @@ -1,37 +0,0 @@ -/* $OpenBSD: exect.S,v 1.9 2013/07/05 21:10:50 miod Exp $ */ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" -#include <machine/psl.h> - -SYSENTRY(exect) - bispsw $PSL_T - chmk $ SYS_execve - jmp _C_LABEL(__cerror) # exect(file, argv, env) diff --git a/lib/libc/arch/vax/sys/sbrk.S b/lib/libc/arch/vax/sys/sbrk.S index dc6c2901ea0..d24feb74933 100644 --- a/lib/libc/arch/vax/sys/sbrk.S +++ b/lib/libc/arch/vax/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.9 2013/07/05 21:10:50 miod Exp $ */ +/* $OpenBSD: sbrk.S,v 1.10 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -32,17 +32,16 @@ .globl _end - .globl _C_LABEL(minbrk) .globl __curbrk .data -_C_LABEL(minbrk): - .long _end __curbrk: .long _end .text -ENTRY(sbrk, R3) +WEAK_ALIAS(sbrk,_sbrk) + +ENTRY(_sbrk, R3) addl3 __curbrk,4(%ap),-(%sp) pushl $1 movl %ap,%r3 diff --git a/lib/libc/gdtoa/gdtoaimp.h b/lib/libc/gdtoa/gdtoaimp.h index 7a36967ca58..0f3de128584 100644 --- a/lib/libc/gdtoa/gdtoaimp.h +++ b/lib/libc/gdtoa/gdtoaimp.h @@ -590,7 +590,7 @@ extern void memcpy_D2A ANSI((void*, const void*, size_t)); int *decpt, int *sign, char **rve)); extern char *g__fmt ANSI((char*, char*, char*, int, ULong, size_t)); extern int gethex ANSI((CONST char**, FPI*, Long*, Bigint**, int)); - extern void hexdig_init_D2A(Void); + extern void __hexdig_init_D2A(Void); extern int hexnan ANSI((CONST char**, FPI*, ULong*)); extern int hi0bits_D2A ANSI((ULong)); extern Bigint *i2b ANSI((int)); diff --git a/lib/libc/gdtoa/gethex.c b/lib/libc/gdtoa/gethex.c index 7ace0fa4cd2..f521f15c6d6 100644 --- a/lib/libc/gdtoa/gethex.c +++ b/lib/libc/gdtoa/gethex.c @@ -67,7 +67,7 @@ gethex( CONST char **sp, FPI *fpi, Long *exp, Bigint **bp, int sign) #endif if (!hexdig['0']) - hexdig_init_D2A(); + __hexdig_init_D2A(); *bp = 0; havedig = 0; s0 = *(CONST unsigned char **)sp + 2; diff --git a/lib/libc/gdtoa/hd_init.c b/lib/libc/gdtoa/hd_init.c index fa6e18dee8f..2227640568f 100644 --- a/lib/libc/gdtoa/hd_init.c +++ b/lib/libc/gdtoa/hd_init.c @@ -46,7 +46,7 @@ htinit(unsigned char *h, unsigned char *s, int inc) } void -hexdig_init_D2A(Void) +__hexdig_init_D2A(Void) { #define USC (unsigned char *) htinit(hexdig, USC "0123456789", 0x10); diff --git a/lib/libc/gdtoa/hexnan.c b/lib/libc/gdtoa/hexnan.c index a443721f52d..b47d49921bb 100644 --- a/lib/libc/gdtoa/hexnan.c +++ b/lib/libc/gdtoa/hexnan.c @@ -62,7 +62,7 @@ hexnan( CONST char **sp, FPI *fpi, ULong *x0) int havedig, hd0, i, nbits; if (!hexdig['0']) - hexdig_init_D2A(); + __hexdig_init_D2A(); nbits = fpi->nbits; x = x0 + (nbits >> kshift); if (nbits & kmask) diff --git a/lib/libc/gdtoa/misc.c b/lib/libc/gdtoa/misc.c index 6ad706b9142..711d36c097d 100644 --- a/lib/libc/gdtoa/misc.c +++ b/lib/libc/gdtoa/misc.c @@ -876,6 +876,8 @@ tens[] = { #endif }; +#ifdef NO_STRING_H + char * #ifdef KR_headers strcp_D2A(a, b) char *a; char *b; @@ -888,8 +890,6 @@ strcp_D2A(char *a, CONST char *b) return a; } -#ifdef NO_STRING_H - Char * #ifdef KR_headers memcpy_D2A(a, b, len) Char *a; Char *b; size_t len; diff --git a/lib/libc/gen/devname.c b/lib/libc/gen/devname.c index 824eedefcf0..7518c91cc8b 100644 --- a/lib/libc/gen/devname.c +++ b/lib/libc/gen/devname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: devname.c,v 1.10 2015/07/14 19:05:52 millert Exp $ */ +/* $OpenBSD: devname.c,v 1.11 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -76,16 +76,15 @@ devname_nodb(dev_t dev, mode_t type) * type of the file (mode & S_IFMT), the latter is the st_rdev field. * Note that the structure may contain padding. */ -struct { - mode_t type; - dev_t dev; -} bkey; - char * devname(dev_t dev, mode_t type) { static DB *db; static bool failure; + struct { + mode_t type; + dev_t dev; + } bkey; DBT data, key; char *name = NULL; diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index 1c1e3ceab10..e7c8ff6e4da 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nlist.c,v 1.59 2015/02/06 23:21:58 millert Exp $ */ +/* $OpenBSD: nlist.c,v 1.60 2015/08/26 01:54:09 guenther Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -48,9 +48,6 @@ #define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) int __fdnlist(int, struct nlist *); -#ifdef _NLIST_DO_ELF -int __elf_is_okay__(Elf_Ehdr *ehdr); -#endif #define ISLAST(p) (p->n_un.n_name == 0 || p->n_un.n_name[0] == 0) @@ -62,7 +59,7 @@ int __elf_is_okay__(Elf_Ehdr *ehdr); * WARNING: This is NOT a ELF ABI function and * as such its use should be restricted. */ -int +static int __elf_is_okay__(Elf_Ehdr *ehdr) { int retval = 0; diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index d1513a50240..d89fa346cf4 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.127 2015/08/25 19:58:04 guenther Exp $ +# $OpenBSD: Makefile.inc,v 1.128 2015/08/26 01:54:09 guenther Exp $ # $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 6/17/93 @@ -6,7 +6,7 @@ .PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/sys ${LIBCSRCDIR}/sys # modules with non-default implementations on at least one architecture: -SRCS+= Ovfork.S brk.S cerror.S exect.S fork.S \ +SRCS+= Ovfork.S brk.S cerror.S fork.S \ sbrk.S sigpending.S sigprocmask.S sigreturn.S \ sigsuspend.S syscall.S tfork_thread.S @@ -235,7 +235,6 @@ MLINKS+=clock_gettime.2 clock_getres.2 MLINKS+=clock_gettime.2 clock_settime.2 MLINKS+=dup.2 dup2.2 MLINKS+=dup.2 dup3.2 -MLINKS+=execve.2 exect.2 MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2 MLINKS+=fsync.2 fdatasync.2 MLINKS+=getgid.2 getegid.2 diff --git a/lib/libc/sys/execve.2 b/lib/libc/sys/execve.2 index 61f6b05e7cf..4eb41a96668 100644 --- a/lib/libc/sys/execve.2 +++ b/lib/libc/sys/execve.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: execve.2,v 1.44 2015/07/28 22:48:31 deraadt Exp $ +.\" $OpenBSD: execve.2,v 1.45 2015/08/26 01:54:09 guenther Exp $ .\" $NetBSD: execve.2,v 1.9 1995/02/27 12:32:25 cgd Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 @@ -30,19 +30,16 @@ .\" .\" @(#)execve.2 8.3 (Berkeley) 1/24/94 .\" -.Dd $Mdocdate: July 28 2015 $ +.Dd $Mdocdate: August 26 2015 $ .Dt EXECVE 2 .Os .Sh NAME -.Nm execve , -.Nm exect +.Nm execve .Nd execute a file .Sh SYNOPSIS .Fd #include <unistd.h> .Ft int .Fn execve "const char *path" "char *const argv[]" "char *const envp[]" -.Ft int -.Fn exect "const char *path" "char *const argv[]" "char *const envp[]" .Sh DESCRIPTION .Fn execve transforms the calling process into a new process. @@ -221,14 +218,6 @@ and .Fa argv points to the array of character pointers to the arguments themselves. -.Pp -The -.Fn exect -function is equivalent to -.Fn execve -with the additional property that it executes the file with the process -tracing facilities enabled (see -.Xr ptrace 2 ) . .Sh RETURN VALUES As the .Fn execve @@ -317,9 +306,6 @@ The .Fn execve function is expected to conform to .St -p1003.1-2008 . -The -.Fn exect -function should not be used in portable applications. .Sh HISTORY The predecessor of these functions, the former .Fn exec |