summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify fork/vfork logic: the kernel has handled returning zero in the childkettenis2017-03-181-10/+1
| | | | | | | for a long time, so there's no need to test the second return register here in the asm stub. ok guenther@
* Use the userspace-visible thread register directly in __cerror insteadkettenis2017-03-181-10/+6
| | | | | | of indirecting through __errno(). ok patrick@
* Make brk(2) actually work and sync the brk()/sbrk() implementation with arm,kettenis2017-03-182-35/+29
| | | | | | brininging over all the symbol visibility improvements that guenther@ made. ok drahn@
* Correct arm64 sigprocmask parameter passing in setjmp/longjmp calls.drahn2017-03-081-14/+11
| | | | | Always return nonzero as the return code from longjmp. ok guenther@ patrick@
* RELRO means the __{got,plt}_{start,end} symbols are superfluousguenther2017-02-273-6/+0
| | | | ok kettenis@
* The assembly for sigpending(2) wasn't correctly implemented either. Ipatrick2017-02-231-2/+3
| | | | | | | suppose this still stems from the first steps where we tried to get at least some userland stuff to compile. This change properly saves the pointer before doing the syscall and stores the return value in the pointer on return. This makes sigpending regress pass.
* The assembly for sigprocmask(2) had a tiny typo which made it jump topatrick2017-02-221-4/+4
| | | | | | | the wrong location, thus not making it set SIG_BLOCK with a zero mask when attempting to read the signal mask (if set ptr is NULL). Instead an attempt to read the mask actually told the syscall to set the mask to zero.
* __tfork(3) returns the thread ID of the new thread in x0, not x1. Thepatrick2017-02-201-2/+2
| | | | | value returned in x1 on __tfork(3) is always zero, which made the code always fall into the child case.
* __errno() returns a 32-bit pointer, so make sure we write a 32-bitpatrick2017-01-251-2/+2
| | | | value to and not overwrite other bits by writing a 64-bit value.
* Add support for AArch64.patrick2017-01-1142-0/+1789
|
* Use the userspace-visible thread register directly in __cerror insteadguenther2016-10-041-6/+8
| | | | | | | of indirecting through __errno(). Register naming tweaks and clang testing by patrick@ and jsg@ ok kettenis@
* Switch from calling obsolete sig{block,setmask} to directly using theguenther2016-09-223-76/+42
| | | | | | | | sigprocmask syscall. abort() can't return, so simplify the call, and use the internal name to avoid the PLT. no-return observation by Miod Vallat, testing by aoyama@
* m88k switched to RELROguenther2016-09-221-6/+0
|
* Simplify __cerror now that %r27 is always the TCB pointer.guenther2016-09-223-54/+40
| | | | | | | Don't need a PLT relocation for __cerror. Move macros for doing internal aliases in ASM from SYS.h to DEFS.h __cerror tweaks by Miod Vallat, testing by aoyama@
* Use unified syntax such that this compiles with both gcc and clang.kettenis2016-09-181-2/+4
| | | | ok jsg@
* unbreak the build by including stddef.h for the definition of NULLjsg2016-09-181-1/+2
| | | | fix suggested by and ok guenther@
* Add an interface to find the ARM.exidx table for use by the ARM EHABI unwinder.kettenis2016-09-174-1/+87
| | | | | | Makes exceptions work in C++ code work again om armv7. ok guenther@
* Clang ignores a .weak directive before a function is actually defined. Sokettenis2016-09-102-4/+4
| | | | | | | move it from before ENTRY() to after END(). Keeps brk(2) and sbrk(2) weak when comping libc with clang. ok guenther@
* Remove branch prediction hints from conditional branch instructions. Thesekettenis2016-09-061-3/+3
| | | | | | | hints are not recognized by clang's builtin assembler and the opcode prefixes they generate have been no-ops for all CPUs after the Pentium 4. ok guenther@
* retire the sparc library codetedu2016-09-0145-2600/+0
|
* Between relro and previous RWX work, the __{got,plt}_{start,end} symbolsguenther2016-08-111-0/+6
| | | | | | | are no longer needed by ld.so. Move them to the m88k-specific list, as it hasn't made the jump. ok deraadt@
* Add XOR cookies for lr and sp. Stop saving/restoring r12 to/from the jmpbuf.guenther2016-08-072-53/+97
| | | | | | | Switch from calling obsolete sig{block,setmask} to directly using the sigprocmask syscall. ok deraadt@ kettenis@
* Use internal names for __errno, _memcpy, memset, and {,_}{set,long}jmpguenther2016-08-0624-87/+106
| | | | | | | Eliminate pointless use of PIC_SYM() Split out DEFS.h from SYS.h like some other archs ok kettenis@ deraadt@
* Wrap fpgetround() so internal calls to it (seen on arm, powerpc, and sh)guenther2016-07-2610-20/+29
| | | | | | go direct instead of through the PLT. ok millert@ kettenis@
* PSEUDO_NOERROR() is used for syscalls that return now, so need to putguenther2016-06-161-1/+2
| | | | a nop in the slot skipped by the kernel on success
* Consistently reference '_end' instead of 'end' in the brk/sbrk implementationguenther2016-05-3015-33/+28
| | | | ok deraadt@
* Do setjmp cookies for eip, esp, and ebp. For bonus points, mix howguenther2016-05-303-70/+124
| | | | | | | | the cookies are used in setjmp/_setjmp/sigsetjmp so that mixing calls (e.g., longjmp on a _setjmp buffer) will scramble all three registers and jump you to a random location on a random stack! ok deraadt@
* Do setjmp cookies for gp, sp, and raguenther2016-05-302-26/+58
| | | | | endian testing and ok deraadt@ ok visa@
* Switch from calling obsolete sig{block,setmask} to directly using theguenther2016-05-292-21/+27
| | | | | | sigprocmask syscall ok kettenis@
* Only require 4 byte alignment on ILP32 archsguenther2016-05-292-4/+4
|
* Use .balign instead of .align; only need 8 byte alignment not 2^8guenther2016-05-291-2/+2
|
* More fixes from miodguenther2016-05-231-4/+4
|
* Include SYS.h instead of DEFS.h now that this does a direct syscallguenther2016-05-231-2/+2
|
* Add XOR cookies for rp and sp. Switch from calling obsoleteguenther2016-05-231-77/+75
| | | | | | | | sig{block,setmask} to directly using the sigprocmask syscall. Remove longjmperror()-if-passed-real-sigcontext checks and the filling in of sigcontext fields that longjmp ignores. in snaps; ok deraadt@
* Stop supporting longjmperror(); it's not used, not portable, and the checksguenther2016-05-237-27/+15
| | | | | | | longjmp performs can't really be relied upon, even after we got rid of the false positives... ok millert@ deraadt@
* Add XOR cookies for r1 (stack) and lr. Switch from calling obsoleteguenther2016-05-222-108/+209
| | | | | | | | sig{block,setmask} to directly using the sigprocmask syscall. Rewrite sig{set,long}jmp based on {set,long}jmp to avoid the deprecated store/load-multiple instructions. in snaps; ok deraadt@
* Oh right, actually delete this now that __cerror is unusedguenther2016-05-221-61/+0
|
* Save and restore 'gbr' register when enter/leaving the kernel, and useguenther2016-05-188-110/+35
| | | | | | it for the TCB pointer. Eliminate __cerror. "looks good" kettenis@, testing and ok deraadt@
* ...and delete the GP setup. Should have been in previous commitguenther2016-05-161-4/+1
|
* Eliminate cerror: use PAL_rdunique to get the TCB address directlyguenther2016-05-163-59/+12
| | | | ok deraadt@ kettenis@
* Add END() to match ENTRY() macrosguenther2016-05-152-3/+8
| | | | ok kettenis@
* TIB conversion is complete, so set errno in the syscall stub and eliminateguenther2016-05-156-21/+33
| | | | | | __cerror ok ketternis@
* Using a 3-word buffer in the openbsd.randomdata segment, XOR swizzlederaadt2016-05-123-21/+80
| | | | | | the PC/FP/SP registers in the jmpbuf. An old idea (around 1999?) but the random segment sure makes it easy. Lots of help from kettenis ok kettenis
* remove hppa64 port, which we never got going beyond broken single users.deraadt2016-05-1128-940/+0
| | | | | | hppa reverse-stack gives us a valuable test case, but most developers don't have a 2nd one to proceed further with this. ok kettenis
* Remove sigreturn declaration and the now-unused libc syscall stubguenther2016-05-0912-487/+0
|
* Stop using sigreturn for longjmp, just set the signal mask and returnguenther2016-05-093-40/+69
| | | | | | | | | registers ala _longjmp. In setjmp, stop saving the onstack from sigaltstack as it's been unused by longjmp for years. In sig{set,long}jmp, use the internal, hidden names for setjmp/_setjmp/etc to avoid creating PLT entries. build testing deraadt@
* Don't use sigreturn(2) in longjmp(3). Instead use a similar approach as inkettenis2016-05-091-60/+39
| | | | | | _longjmp(3) but also restore the signal mask. ok deraadt@
* Implement longjmp directly and not on top of sigreturn.guenther2016-05-083-98/+125
| | | | | | Use the hidden symbols for internal calls to abort, longjmp, etc ok deraadt@
* No, sigaltstack's onstack flag shouldn't be saved. Delete commentguenther2016-05-081-2/+1
| | | | wondering about that
* Hide __fpu_* and make internal _Qp_* calls go direct.guenther2016-05-086-39/+53
| | | | ok kettenis@