summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* use END_STRONG. Yes, everything in the sh ecosystem is different..deraadt2018-01-231-2/+2
|
* Implement ffs(3) using the CLZ instructions which has been available everkettenis2018-01-211-43/+6
| | | | | | | | | since ARMv5. Should be much faster but more importantly it removes the data table from .text which could introduce unwanted ROP gadgets. Based on changes in Android/Bionic by Elliott Hughes. ok patrick@
* Use static inline such that the functions are guaranteed to be present whenkettenis2018-01-191-18/+19
| | | | | | compiled with clang. ok visa@
* Partial revert of rev. 1.7, fixes build with clangjca2018-01-191-2/+1
| | | | | | | | | | | The error was: --8<-- ffs.S:57:2: error: unsupported relocation on symbol adrne r2, .L_ffs_table ^ -->8-- Minimal workaround suggested by deraadt@, ok guenther@ kettenis@
* Wow, it cannot even be in .data...deraadt2018-01-181-2/+1
|
* Zap the rotor, it was a wrong idea. Cluebat applied by kshe whootto2018-01-181-6/+3
| | | | | came also up with this diff. Simple, no bias and benchmarks show the extra random calls disappear in te measurement noise.
* Sorry, the PIC macros cannot reach to .rodata....deraadt2018-01-181-2/+2
|
* Move to ffs(3) for bitmask scanning. I played with this earlier,otto2018-01-181-21/+11
| | | | | | | but at that time ffs function calls were generated instead of the compiler inlining the code. Now that ffs is marked protected in libc this is handled better. Thanks to kshe who prompted me to look at this again.
* Instead of trying to handle ffs() with the normal rename-mark-hidden-and-aliasguenther2018-01-1810-21/+32
| | | | | | | dance, mark it protected. This works better for both gcc and clang: gcc blocks overriding of internal calls, while clang permits inlining again. ok otto@
* Add two more ARM EABI aliases that I missed in the previous libc minorkettenis2018-01-142-1/+3
| | | | | | bump. "just go ahead -- crank" deraadt@
* tweak previous;jmc2018-01-131-5/+6
|
* introduce a filter called EVFILT_DEVICE that can be used to notifyrobert2018-01-131-2/+15
| | | | | | | listeners of device state changes. currently only supports NOTE_CHANGE that will be used by drm(4) ok kettenis@
* Adjust references for sysctl(3) to sysctl(2)deraadt2018-01-1214-49/+49
|
* sysctl(3) can now be renamed to sysctl(2)deraadt2018-01-123-8/+8
|
* Move SC_* defines into <machine/setjmp.h>, and rename them,visa2018-01-082-158/+158
| | | | | | so that <machine/signal.h> is not needed in setjmp.S. Suggested by kettenis@ long ago, OK deraadt@
* optimization and some cleanup; mostly from kshe (except the unmap() part)otto2018-01-081-67/+51
|
* TIOCUCNTL is now allowed by promise "tty".mpi2018-01-081-4/+5
| | | | Reminded by jmc@
* Remove dead gettimeofday calls and timevals.cheloha2018-01-062-6/+2
| | | | ok jca@
* some grammar fixes; from dholland@netbsd, -r1.68jmc2018-01-021-6/+6
|
* Only init chunk_info once, plus some moving of code to group related functions.otto2018-01-011-273/+267
|
* step one in avoiding unneccesary init of chunk_info;otto2017-12-271-65/+81
| | | | some cleanup; tested by sthen@ on a ports build
* Add ARM EABI runtime aliases to the GCC runtime functions that we includekettenis2017-12-2610-9/+86
| | | | | | in libc. ok patrick@, jsg@, guenther@
* memcpy from the right place. at this point, the used variable is nottedu2017-12-251-2/+2
| | | | | relevant. from Mark Karpilovskij. ok millert
* Fix one possible buffer overflow and one underflow. Also some minormillert2017-12-241-20/+36
| | | | cleanups. From Jan Kokemueller. OK deraadt@
* let's not try to document the number of items in a list...jmc2017-12-181-3/+3
|
* Add the CLOCK_BOOTTIME clockid for use with clock_gettime(2)cheloha2017-12-181-3/+16
| | | | | | | | | | | | | | | | | and put it to use in userspace in lieu of the kern.boottime sysctl. Its absolute value is the time that has elapsed since the system booted, i.e., the system uptime. Use in top(1), w(1), and snmpd(8) eliminates a race with settimeofday(2), adjtime(2), etc. inherent to deriving the system uptime via the kern.boottime sysctl. Product of a great deal of discussion/revision with jca@, tb@, and guenther@. ok tb@ jca@ guenther@ dlg@ mlarkin@ tom@
* Move __cxa_thread_atexit* to its own .c file to avoid pulling the codeguenther2017-12-164-39/+64
| | | | | | | (w/ _dlctl reference) into static executables. It's all Mark's code so put his preferred copyright on it. ok kettenis@
* Don't use _libc_ prefix when referencing "builtin" symbols with clang.kettenis2017-12-162-3/+8
| | | | Slightly tweaked diff from guenther@
* Simplify and unify timespec variables used in those event loopsjca2017-12-143-18/+14
| | | | ok millert@
* Use CLOCK_MONOTONIC for the rpc event loopsjca2017-12-143-40/+40
| | | | From Scott Cheloha, ok deraadt@ tb@
* Consistently use .Va for "errno";schwarze2017-12-121-3/+3
| | | | | patch from Jan Stary <hans at stare dot cz>; "I think it makes sense to speak about errno as a variable (.Va)" jca@.
* space required between macro arg and punctuation;jmc2017-12-121-2/+2
|
* pledge()'s 2nd argument becomes char *execpromises, which becomes thederaadt2017-12-122-44/+48
| | | | | | | | | | pledge for a new execve image immediately upon start. Also introduces "error" which makes violations return -1 ENOSYS instead of killing the program ("error" may not be handed to a setuid/setgid program, which may be missing/ignoring syscall return values and would continue with inconsistant state) Discussion with many florian has used this to improve the strictness of a daemon
* Fix the return value of fwscanf(3) when encountering an early matchingkevlo2017-12-081-2/+2
| | | | | | failure. This change brings fwscanf(3) back in line with fscanf(3). From FreeBSD; ok deraadt@, millert@
* Remove DEF_STRONG(__cxa_thread_atexit_impl). This produces an unwantedkettenis2017-12-051-2/+1
| | | | | _libc___cxa_thread_atexit_impl reference on gcc architectures that breaks the build.
* Implement __cxa_thread_atexit to support C++11 thread_local scope. Thekettenis2017-12-056-5/+63
| | | | | | | interface is also made available as __cxa_thread_atexit_impl to satisfy the needs of GNU libstdc++. ok guenther@, millert@
* Redo the calculation of the alignment and placement of static TLS data toguenther2017-12-013-45/+105
| | | | | | | | | | correctly take into account the segment p_align. Previously, anything with a size belong the natural alignment or with alignment larger than the natural one would either not be intialized correctly, be misaligned, or result in the TIB being misaligned. Problems reported by Charles Collicutt (charles (at) collicutt.co.uk) ok kettenis@
* Consistently .Xr the corresponding wide char functions from char- andschwarze2017-12-0111-26/+37
| | | | | string-handling <stdio.h> functions, like we already do it for <string.h>. Includes a smaller patch from <kshe59 at zoho dot eu>, OK jmc@.
* add missing argument name; from <kshe59 at zoho dot eu>; OK jmc@;schwarze2017-12-011-8/+32
| | | | while here, consistently use .Fo to cure execessive line lengths
* clang doesn't propagate attributes like "asm labels" and "visibility(hidden)"guenther2017-11-2931-86/+148
| | | | | | | | | to builtins like mem{set,cpy,move} and __stack_smash_handler. So, when building with clang, instead mark those as protected visibility to get rid of the PLT relocations. We can't take the address of them then, but that's ok: it's a build-time error not a run-time error. ok kettenis@
* Add the missing STANDARDS section (kettenis@ noticed that these areschwarze2017-11-281-6/+14
| | | | | POSIX functions) and turn the weird DIAGNOSTICS section into a normal RETURN VALUES section while here.
* GNU ld has prefixed the contents of .gnu.warning.SYMBOL sectionstb2017-11-2815-31/+31
| | | | | | | | with "warning: " since 2003, so the messages themselves need not contain the prefix anymore. From Scott Cheloha ok jca, deraadt
* Delete fktrace(2). The consequences of it were not thought throughguenther2017-11-282-40/+7
| | | | | | sufficiently and at least one horrific security hole was the result. ok deraadt@ beck@
* Avoid .align 0 here as well. Also fix a .word that should be a .quad.kettenis2017-11-223-10/+7
| | | | ok patrick@
* Avoid .align 0. Clang's integrated assembler actually honors this directivekettenis2017-11-213-9/+6
| | | | | | and the resulting byte-alignment triggers unaligned access. ok patrick@, deraadt@
* Use a simple forward search to find '%' in the format string instead oftb2017-11-211-35/+12
| | | | | | | | | | | | | | | | | | | | using mbrtowc(3). Thus, we now treat the format string as a bytestring, not as a multibyte character string. We think that ANSI C made a small error when adding wide characters: The committees essentially replaced "characters" with "wide characters" in the existing printf documentation, which was written before the concept of processing was established. Doing processing on the format string would break some 8-bit format strings in the wild, and that isn't something these committees gave themselves license to do. Based on the "10x printf speedup" commit from android found by tedu: https://github.com/aosp-mirror/platform_bionic/commit/5305a4d4a723b06494b93f2df81733b83a0c46d3 Thanks to millert and schwarze for digging into the history and testing *printf behavior on other platforms. ok deraadt, millert
* Add error checking to some calls to __find_arguments(). Matches similartb2017-11-161-6/+16
| | | | | | | | changes by schwarze to vfprintf.c r1.71. Cherrypicked from android: https://github.com/aosp-mirror/platform_bionic/commit/5305a4d4a723b06494b93f2df81733b83a0c46d3 ok millert
* Fix spelling: bet -> net from Scott Bennett, thankstb2017-11-071-3/+3
|
* Revert recent changes to unbreak ports/net/sambajca2017-11-048-110/+21
| | | | | | | | While it is not clear (to me) why that ports ends up with corrupted shared libs, reverting those changes fixes the issue and should allow us to close p2k17 more smoothly. Discussed with a bunch, ok ajacoutot@ guenther@
* 's' should include 'f'; from Jacqueline Jolicoeurotto2017-11-021-2/+2
|