summaryrefslogtreecommitdiff
path: root/lib/libc/arch/sparc64
AgeCommit message (Collapse)Author
2017-10-28Remove __builtin_saveregs: gcc hasn't used it for years.Philip Guenther
suggested by miod@ ok kettenis@
2017-08-15Copy files from ../librthread in preparation for moving functionalityPhilip Guenther
from libpthread to libc. No changes to the build yet, just making it easier to review the substantive diffs. ok beck@ kettenis@ tedu@
2017-02-27RELRO means the __{got,plt}_{start,end} symbols are superfluousPhilip Guenther
ok kettenis@
2016-07-26Wrap fpgetround() so internal calls to it (seen on arm, powerpc, and sh)Philip Guenther
go direct instead of through the PLT. ok millert@ kettenis@
2016-05-09Remove sigreturn declaration and the now-unused libc syscall stubPhilip Guenther
2016-05-08Hide __fpu_* and make internal _Qp_* calls go direct.Philip Guenther
ok kettenis@
2016-05-08Simplify sig{set,long}jmp(): just Do The Job instead of calling othersPhilip Guenther
ok kettenis@
2016-05-07Use a Thread Information Block in both single and multi-threaded programs.Philip Guenther
This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable! Make libpthread dlopen'able by moving the cancelation wrappers into libc and doing locking and fork/errno handling via callbacks that libpthread registers when it first initializes. 'errno' *must* be declared via <errno.h> now! Clean up libpthread's symbol exports like libc. On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec. Testing by various, particularly sthen@ and patrick@ ok kettenis@
2016-04-28Don't use sigreturn(2) in longjmp(3). Instead use a similar approach as inMark Kettenis
_longjmp(3) but also restore the signal mask. ok deraadt@
2016-03-21The asm in the MD_DISABLE_KBIND macro was too fragile and broke alpha and hppa.Philip Guenther
So instead, do the kbind disabling with syscall(). debugging and ok deraadt@, ok kettenis@
2016-03-20Rearrange C runtime bits: now that ld.so exports environ and __progname,Philip Guenther
move their definitions and initialization in static links to libc.a Make crt0 always invoke a new func _csu_finish() in libc to process the auxv and to either register the ld.so cleanup function (in dynamic links) or initialize environ and __progname and do MC_DISABLE_KBIND (in static links). In libc, get pagesize from auxv; cache that between getpagesize() and sysconf(_SC_PAGESIZE) ok mpi@ "good time" deraadt@
2015-11-15Tweak previous: rename it to fpround() to match FreeBSDPhilip Guenther
requested by kettenis@
2015-11-15I got a round tuit to rename round() to roundit() to avoid gcc warning.Philip Guenther
ok deraadt@
2015-10-27Wrap the remaining math functions in libc: __fpclassify*(), __flt_rounds(),Philip Guenther
and ldexp(). ok millert@
2015-10-23Merge the sigaction() and sigprocmask() overloads/wrappers from libpthreadPhilip Guenther
into libc, and move pthread_sigmask() as well (just a trivial wrapper). This provides consistent handling of SIGTHR between single- and multi-threaded programs and is a step in the merge of all the libpthread overloads, providing some ASM and Makefile bits that the other wrappers will need. ok deraadt@ millert@
2015-09-13Need SYS.h for END_STRONG()Philip Guenther
2015-09-13Add hidden _libc_ aliases and symbol sizesPhilip Guenther
2015-09-13Wrap <stdlib.h> so that calls go direct and the symbols not in thePhilip Guenther
C standard are all weak. Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.
2015-09-05Adds hidden _libc_FOO aliases for the system call stubs.Philip Guenther
Stop generating _brk and _sbrk symbols: they've already been hidden. Set the ELF symbol size on the syscall stubs. Give the __{min,cur}brk symbols a size and type, and hide more jump labels. ok deraadt@
2015-08-31Add framework for resolving (pun intended) libc namespace issues, usingPhilip Guenther
wrapper .h files and asm labels to let internal calls resolve directly and not be overridable or use the PLT. Then, apply that framework to most of the functions in stdio.h, string.h, err.h, and wchar.h. Delete the should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here. tests clean on i386, amd64, sparc64, powerpc, and mips64 naming feedback from kettenis@ and millert@ ok kettenis@
2015-08-26Hide many (194!) symbols that nothing should be using.Philip Guenther
Delete exect(2); it wasn't portable across archs and nothing used it. ports test build by naddy@ ok deraadt@ kettenis@
2015-08-22Explicitly list the symbols permitted to be exported by libc.Philip Guenther
This is primed with the current list of exported symbols so it doesn't change the ABI yet, but will prevent unintentional additions in the future and sets the stage for reductions. ok deraadt@ kettenis@
2015-05-15Make index/rindex weak aliases of strchr/strrchr since they are notTodd C. Miller
part of the ISO C standard and have also been dropped from POSIX. OK guenther@ kettenis@
2015-04-07Make pthread_atfork() track the DSO that called it like atexit() does,Philip Guenther
unregistering callbacks if the DSO is unloaded. Move the callback handling from libpthread to libc, though libpthread still overrides the inner call to handle locking and thread-library reinitialization. Major version bump for both libc and libpthread. verification that this fixes various ports ajacoutot@ asm assistance miod@; ok millert@ deraadt@
2015-03-31Simplify fork/vfork logic: the kernel has handled returning zero in the childPhilip Guenther
for a long time, so there's no need to test the second return register here in the asm stub. ok and testing of many archs by krw@ miod@
2014-11-30restructure libc/string + libc/arch/*/string coperation regardingTheo de Raadt
(potentially) MD versions (function dependent, not filename dependent) split out memcpy/memmove/bcopy and strchr/index/strrchr/rindex Bring back amd64 .S versions And the final touch: switch all architectures temporarily to MI memcpy.c, which contains syslog + abort for overlapping copies. A nice harsh undefined behaviour. We will clean the entire userland of the remaining issues in this catagory, then switch to the optimised memcpy which skips the memmove check. I tried to cut this change into pieces, but testing each sub-step on every architecture is too time consuming and mindnumbing. ok miod
2014-09-12Fix some bugs in the _Qp_sqrt implementation that would limit the accuracyMark Kettenis
of the result in many cases. From FreeBSD allbeit with some changes to keep the coding style consistent. This fixes the asinhl(4) issue reported by dickman@ on tech@.
2014-06-09Nuke the machinery to sync libkern with libc, it's not been used in theMiod Vallat
last 15 years and there is no point to use it in the future. From Jean-Philippe Ouellet
2014-06-04Apply "unifdef -D__STDC__" to libc/arch/*/SYS.hMatthew Dempsky
A while back, pascal@ converted our system call stubs from using "cpp | as" to "cc -x assembler-with-cpp", so there's no need to stay compatible with ancient preprocessor semantics. ok miod
2014-04-17It's been a quarter century: we can assume volatile is present with that name.Philip Guenther
2013-11-261 << 31 cleanup. Eitan Adler pointed out that there has been aTheo de Raadt
resurrection of the bad idiom in the tree. sufficient review by miod, kettenis, tedu
2012-12-05Remove excessive sys/cdefs.h inclusionTheo de Raadt
ok guenther millert kettenis
2012-12-03Add two missing quad-precision emulation functions: _Qp_cmp and _Qp_cmpe. AtMark Kettenis
least the former is emitted by modern versions of GCC.
2012-09-04remove lint leftovers; ok guenther@Okan Demirmen
2012-09-04these are no longer used; ok guentherTheo de Raadt
2012-08-22Convert cpp | as rules in bsd.lib.mk and lib/libc/sys/Makefile.inc to pure ccPascal Stumpf
invocations. This allows us to use the compiler builtin define __PIC__ to check for PIC/PIEness rather than passing -DPIC. Simplifies PIE work a lot. ok matthew@, conceptually ok kurt@
2012-06-25Do not use <machine/float.h>, that is an deformed BSD-ism.Theo de Raadt
It turns out <float.h> is the right file to pull in. ok millert
2012-06-21__tfork() needs to set the stack address of the new thread in the kernel,Philip Guenthe
so that it can't get a signal while still running on the parent thread's stack. Also, pass in sizeof(struct __tfork) to provide forward compat when more members are added. This is an ABI change, so switch syscall numbers and bump lib majors this time. ok deraadt@ matthew@
2012-04-19rely on the compiler giving us a built-in alloca. any new architectureTheo de Raadt
or compiler we use will. ok millert
2012-04-12alloca.c cannot be usedTheo de Raadt
2012-04-12remove rfork(); ok guenther miodTheo de Raadt
2012-03-22Move __tfork_thread() from rthreads (libpthread) to libc so thatPhilip Guenthe
it can be used for not-strictly-threading purposes ok matthew@ kurt@
2011-09-17arithemtic -> arithmeticMiod Vallat
2011-07-08Revert (leaving the complex math part alone). Some stuff is dependingMartynas Venckus
on this historical behavior; so we're stuck in this stupid situation. No cookie for me.
2011-07-08Move fabs(3), frexp(3), and modf(3) to libm--nothing has been usingMartynas Venckus
them in libc for a very long time. OK guenther@.
2011-04-04Move __cerror to ___cerror with a weak alias so that rthreads can override it.Philip Guenthe
On mips64, also correct the name called from plain cerror to __cerror. "looks correct" miod@
2011-03-12In the original sparc V7 book (and in the v8 book), the divrem leaf code usedTheo de Raadt
local registers for a few temporaries. This was changed to use two global registers. Maybe to permit use in-kernel without conflicting with the register V7 register window handlers. (Was this done by Chris Torek? Is this related to Gordon Irlam's work? Or was it in NetBSD? Hard to tell because NetBSD removed their original cvs tree.) In V8 the ABI was tightened; more global registers became offlimits in different ways. We started supporting sun4m, and did not consider this. As a result, the global registers chosen are the wrong choice. In particular, %g7 is a poor choice for upcoming TLS work. It looks like it is safer to use %g5 and %g6 since these functions are "system software". All re-entrant parts of the system save it. On sparc64 these functions are in libc per ABI requirement, but are unused. On sparc, they occur in bootblocks (no reentrancy), kernel (reentrancy saves globals; kernel is not ABI compliant), userland libc (signal handlers save globals), and ld.so (symbol binding is not re-entrant on its own). Discussed rather extensively with guenther, kettenis, miod and drahn.
2009-10-28more rcsid/sccs cleanupTheo de Raadt
2009-04-21remove from gen so that lint doesn't check gen if assembly versionsMartynas Venckus
are available. spotted by theo
2009-04-19- ldexp implementation has issues. switch to the one from libmMartynas Venckus
- remove frexp in hppa64, cloned from hppa - move generic ieee754 implementations of modf and ldexp to gen ok kettenis@, "looks good" millert@