summaryrefslogtreecommitdiffstats
path: root/lib/libc/dlfcn (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Correct error returns, do not print eror message to stdout (thereotto2020-10-091-8/+15
| | | | | | is a dlerror() function for that) and mark dladdr() as PROTO_NORMAL to be able to call it from a malloc.c MALLOC_STATS leak reporting project I'm working on. ok kettenis@
* Partly revert previous commit, these changes we not supposed to go in.otto2020-10-091-2/+1
|
* As noted by tb@ previous commit only removed an unused fucntion.otto2020-10-091-1/+2
| | | | | So redo previous commit properly: Use random value for canary bytes; ok tb@.
* allow setenv LIBC_NOUSERTC to disable userland timekeeping, for ktrace.tedu2020-07-161-1/+3
| | | | ok deraadt pirofti
* Add support for timeconting in userland.pirofti2020-07-061-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
* Complete the ld.so boot cleanup: move most libc initialization fromguenther2019-06-022-40/+86
| | | | | | | | | | | | | | | | | _csu_finish() to _libc_preinit(), which is an .init_array function in shared libc (and mark it INITFIRST) or a .preinit_array function in static libc, grabbing the _dl_cb callback there from ld.so. Then in _csu_finish(), invoke the dl_clean_boot() callback to free ld.so's startup bits before main() gets control. Other cleanups this permits: - move various startup structures into .data.rel.ro - the dl* stubs in libc can be strong and call the callbacks provided via _dl_cb - no longer need to conditionalize dlctl() calls on presence of _DYNAMIC original concept and full diff ok kettenis@ ok deraadt@
* Redo the calculation of the alignment and placement of static TLS data toguenther2017-12-012-42/+92
| | | | | | | | | | 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@
* Implement dl_iterate_phdr() for static PIE executables using info extractedguenther2016-09-063-4/+74
| | | | | | from the aux vector. ok patrick@ kettenis@
* Use a Thread Information Block in both single and multi-threaded programs.guenther2016-05-073-5/+193
| | | | | | | | | | | | | | | | | 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@
* The asm in the MD_DISABLE_KBIND macro was too fragile and broke alpha and hppa.guenther2016-03-211-4/+5
| | | | | | So instead, do the kbind disabling with syscall(). debugging and ok deraadt@, ok kettenis@
* Add $OpenBSD lineguenther2016-03-201-0/+1
|
* Rearrange C runtime bits: now that ld.so exports environ and __progname,guenther2016-03-202-2/+109
| | | | | | | | | | | 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@
* delete old lint ARGSUSED commentsguenther2015-11-011-8/+1
|
* ELF_TOOLCHAIN bye bye.miod2013-07-051-3/+1
|
* dlerror() should not return const char *, as noted by landryderaadt2013-03-241-3/+3
| | | | ok guenther
* Correct the declaration of the dladdr() stub so that it has the correctguenther2009-04-221-3/+5
| | | | | | lint information originally ok'ed deraadt@ right before the 4.5 tree lock
* Remove unused include, ok miod@drahn2005-12-271-2/+1
|
* ARGSUSED stubsderaadt2005-11-281-1/+8
|
* Expose dl_iterate_phdr.kettenis2004-10-171-1/+13
| | | | ok drahn@, millert@
* add dladdr() support and add some 'standard' dlsym() support.drahn2004-08-111-1/+9
| | | | ok millert miod pval, grumble deraadt
* protosderaadt2003-07-151-2/+2
|
* ansification; checked by pvalderaadt2003-06-111-2/+2
|
* pefo 3/4 licence cleanupsderaadt2003-06-091-7/+1
|
* remove printf from static dlctl and dlerror stubs. Return -1 ifmarc2003-04-291-4/+2
| | | | | | dlctl called from a static prog. dlerror will display the proper error in if also called. -1 return suggested by drahn@ general ok from several others
* no way for this to be 'shared only', duhpvalchev2001-12-261-3/+1
|
* shared onlypvalchev2001-11-201-1/+3
|
* Put dl* function definitions in libc on ELF, removing the need for libdl.pvalchev2001-11-202-0/+94
These are just stubs, the real functions are resolved by ld.so when linking is performed. ok art