#
1.28 |
|
10-May-2019 |
guenther |
ld.so boot cleanup support: - put functions and data which are only used before calling the executable's start function into their own page-aligned segments for unmapping (only done on amd64, arm64, armv7, powerpc, and sparc64 so far) - pass .init_array and .preinit_array functions an addition argument which is a callback to get a structure which includes a function that frees the boot text and data - sometimes delay doing RELRO processing: for a shared-object marked DF_1_INITFIRST do it after the object's .init_array, for the executable do it after the .preinit_array - improve test-ld.so to link against libpthread and trigger its initialization late libc changes to use this will come later
ok kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE
|
#
1.27 |
|
28-Aug-2017 |
deraadt |
whitespace
|
#
1.26 |
|
27-Aug-2017 |
deraadt |
Replace heaps of hand-written syscall stubs with a simpler framework which is largely MI. ok visa kettenis
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.25 |
|
24-Jan-2017 |
guenther |
On fatal errors, kill ourselves with thrkill(0,9,NULL) instead of simply exiting, via helper functions _dl_die(), _dl_diedie(), and _dl_oom().
prompted by a complaint from jsing@ ok jsing@ deraadt@
|
#
1.24 |
|
28-Aug-2016 |
guenther |
ld.so doesn't need gettimeofday or lstat stubs any more
ok deraadt@
|
#
1.23 |
|
09-Aug-2016 |
guenther |
Teach arm to pass &_DYNAMIC to _dl_boot_bind(); can optimize later in tree
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.22 |
|
07-May-2016 |
guenther |
Use a Thread Information Block in both single and multi-threaded programs. 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@
|
#
1.21 |
|
21-Mar-2016 |
bluhm |
Rename the system call sendsyslog2 to sendsyslog. Keep the old one as osendsyslog for a while. The three argument variant is the only one that will stay. input kettenis@; OK deraadt@
|
#
1.20 |
|
21-Mar-2016 |
guenther |
Switch ld.so's stack smash handler from sendsyslog to sendsyslog2 and pass the LOG_CONS flag like libc's handler.
ok deraadt@ bluhm@ (who had a similar diff)
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.19 |
|
15-Nov-2015 |
deraadt |
ldd(1) sets environment variable LD_TRACE_LOADED_OBJECTS to tell ld.so that it should show information about the program it loads, rather than run it. In that specific case, ld.so can pledge to "stdio rpath" to ensure that code path in ld.so has no bugs. Yes, a pledge in ld.so.... who'd have thought! ok guenther
|
#
1.18 |
|
19-Sep-2015 |
guenther |
kbind has eliminated the need for and use of the bind lock. Delete it, the the callback, and the sigprocmask stub. Keep around the DL_SETBINDLCK case until libpthread stops using it.
discussed with miod@ at l2k15 ok kettenis@
|
#
1.17 |
|
13-Sep-2015 |
guenther |
Rename __sysctl syscall to just sysctl, as the userland wrapper is no longer necessary
ok deraadt@ jsing@
|
Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
|
#
1.16 |
|
14-Jul-2014 |
deraadt |
Now that we have sendsyslog(2), we can directly use it in the (previously completely retarded) stack_smash_handler of ld.so ok beck miod tedu
|
#
1.15 |
|
09-Jul-2014 |
guenther |
_dl_fcntl() is no longer used; kill the stubs
ok otto@ miod@
|
#
1.14 |
|
06-Jul-2014 |
otto |
move from sysclt(KERN_ARND) to getentropy(2); ok miod@, kettenis@
|
#
1.13 |
|
05-Jul-2014 |
miod |
Unlike libc syscall stubs, ld.so syscall stubs are expected to return -errno, rather than -1, upon failure.
Even though nothing in ld.so currently needs to explicitely check for specific error values, consistency doesn't hurt.
|
Revision tags: OPENBSD_5_5_BASE
|
#
1.12 |
|
25-Dec-2013 |
miod |
Pass _dl_dtors as the csu cleanup routine on arm.
|
#
1.11 |
|
13-Aug-2013 |
guenther |
Switch time_t, ino_t, clock_t, and struct kevent's ident and data members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME.
Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures.
DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead.
Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
|
Revision tags: OPENBSD_5_4_BASE
|
#
1.10 |
|
01-Jun-2013 |
miod |
Introduce ltrace(1). This tool works with ld.so to inject utrace record for each plt call, allowing to trace a binary linked against shared library at the public function call level.
To do so, ltrace(1) sets up some environment variables to enable plt tracing in ld.so, and invokes ktrace(2) for utrace events. ld.so will force lazy binding and will send an utrace record in the plt resolver, without updating the plt.
Minimal filtering capabilities are provided, inspired by Solaris' truss -u, to limit tracing to libraries and/or symbol names. Non-traced libraries and symbols will have the regular resolver processing, with the expected plt update.
"Get it in" deraadt
|
#
1.9 |
|
05-Apr-2013 |
kurt |
- Add ORIGIN, OSNAME, OSREL and PLATFORM substitution support for rpaths. Improvements and okay matthew@, millert@, guenther@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.8 |
|
22-Dec-2012 |
kettenis |
Zero %r0 before transferring control to the main program, to indicate that the main program should not register a cleanup handler with atexit(3). This will allow us to add the cleanup handler registration code to crt0.c and have ld.so pass its cleanup handler to the main program in the future.
tested by tobiasu@ ok kurt@
|
#
1.7 |
|
24-Oct-2012 |
guenther |
Garbage-collect the _dl_stat() routine, now unused
ok matthew@ deraadt@
|
Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.6 |
|
03-May-2006 |
drahn |
prebind - how to prelink a binary without throwing security out the window
Prelink fixes the address of libraries making 'return to libc' attacks trival, prebind uses a different method to achieve most of the same gains, however without adding any security conerns.
Still under development, now in-tree.
|
Revision tags: OPENBSD_3_9_BASE
|
#
1.5 |
|
23-Oct-2005 |
drahn |
Use libc's SYS.h and SYSTRAP instead of rolling own. No binary change.
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.4 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_5_BASE
|
#
1.3 |
|
09-Feb-2004 |
drahn |
Enable lazy binding on arm: _dl_bind_start inspired by netbsd. changed a define to LD_ALLOW_WRITABLE_TEXT, should this be allowed? remove plt protect code, arm has a text PLT. relocate the got entries associated with the plt. perform got protect/unprotect for lazy binding updates.
|
#
1.2 |
|
09-Feb-2004 |
drahn |
Use macros to reduce the amount of hand written asm. inspired by future amd64 code. no functional change.
|
#
1.1 |
|
07-Feb-2004 |
drahn |
Dynamic linker support for arm. non-lazy binding works.
|
Revision tags: OPENBSD_6_2_BASE
|
#
1.27 |
|
28-Aug-2017 |
deraadt |
whitespace
|
#
1.26 |
|
27-Aug-2017 |
deraadt |
Replace heaps of hand-written syscall stubs with a simpler framework which is largely MI. ok visa kettenis
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.25 |
|
24-Jan-2017 |
guenther |
On fatal errors, kill ourselves with thrkill(0,9,NULL) instead of simply exiting, via helper functions _dl_die(), _dl_diedie(), and _dl_oom().
prompted by a complaint from jsing@ ok jsing@ deraadt@
|
#
1.24 |
|
28-Aug-2016 |
guenther |
ld.so doesn't need gettimeofday or lstat stubs any more
ok deraadt@
|
#
1.23 |
|
09-Aug-2016 |
guenther |
Teach arm to pass &_DYNAMIC to _dl_boot_bind(); can optimize later in tree
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.22 |
|
07-May-2016 |
guenther |
Use a Thread Information Block in both single and multi-threaded programs. 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@
|
#
1.21 |
|
21-Mar-2016 |
bluhm |
Rename the system call sendsyslog2 to sendsyslog. Keep the old one as osendsyslog for a while. The three argument variant is the only one that will stay. input kettenis@; OK deraadt@
|
#
1.20 |
|
21-Mar-2016 |
guenther |
Switch ld.so's stack smash handler from sendsyslog to sendsyslog2 and pass the LOG_CONS flag like libc's handler.
ok deraadt@ bluhm@ (who had a similar diff)
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.19 |
|
15-Nov-2015 |
deraadt |
ldd(1) sets environment variable LD_TRACE_LOADED_OBJECTS to tell ld.so that it should show information about the program it loads, rather than run it. In that specific case, ld.so can pledge to "stdio rpath" to ensure that code path in ld.so has no bugs. Yes, a pledge in ld.so.... who'd have thought! ok guenther
|
#
1.18 |
|
19-Sep-2015 |
guenther |
kbind has eliminated the need for and use of the bind lock. Delete it, the the callback, and the sigprocmask stub. Keep around the DL_SETBINDLCK case until libpthread stops using it.
discussed with miod@ at l2k15 ok kettenis@
|
#
1.17 |
|
13-Sep-2015 |
guenther |
Rename __sysctl syscall to just sysctl, as the userland wrapper is no longer necessary
ok deraadt@ jsing@
|
Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE
|
#
1.16 |
|
14-Jul-2014 |
deraadt |
Now that we have sendsyslog(2), we can directly use it in the (previously completely retarded) stack_smash_handler of ld.so ok beck miod tedu
|
#
1.15 |
|
09-Jul-2014 |
guenther |
_dl_fcntl() is no longer used; kill the stubs
ok otto@ miod@
|
#
1.14 |
|
06-Jul-2014 |
otto |
move from sysclt(KERN_ARND) to getentropy(2); ok miod@, kettenis@
|
#
1.13 |
|
05-Jul-2014 |
miod |
Unlike libc syscall stubs, ld.so syscall stubs are expected to return -errno, rather than -1, upon failure.
Even though nothing in ld.so currently needs to explicitely check for specific error values, consistency doesn't hurt.
|
Revision tags: OPENBSD_5_5_BASE
|
#
1.12 |
|
25-Dec-2013 |
miod |
Pass _dl_dtors as the csu cleanup routine on arm.
|
#
1.11 |
|
13-Aug-2013 |
guenther |
Switch time_t, ino_t, clock_t, and struct kevent's ident and data members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME.
Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures.
DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead.
Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
|
Revision tags: OPENBSD_5_4_BASE
|
#
1.10 |
|
01-Jun-2013 |
miod |
Introduce ltrace(1). This tool works with ld.so to inject utrace record for each plt call, allowing to trace a binary linked against shared library at the public function call level.
To do so, ltrace(1) sets up some environment variables to enable plt tracing in ld.so, and invokes ktrace(2) for utrace events. ld.so will force lazy binding and will send an utrace record in the plt resolver, without updating the plt.
Minimal filtering capabilities are provided, inspired by Solaris' truss -u, to limit tracing to libraries and/or symbol names. Non-traced libraries and symbols will have the regular resolver processing, with the expected plt update.
"Get it in" deraadt
|
#
1.9 |
|
05-Apr-2013 |
kurt |
- Add ORIGIN, OSNAME, OSREL and PLATFORM substitution support for rpaths. Improvements and okay matthew@, millert@, guenther@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.8 |
|
22-Dec-2012 |
kettenis |
Zero %r0 before transferring control to the main program, to indicate that the main program should not register a cleanup handler with atexit(3). This will allow us to add the cleanup handler registration code to crt0.c and have ld.so pass its cleanup handler to the main program in the future.
tested by tobiasu@ ok kurt@
|
#
1.7 |
|
24-Oct-2012 |
guenther |
Garbage-collect the _dl_stat() routine, now unused
ok matthew@ deraadt@
|
Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.6 |
|
03-May-2006 |
drahn |
prebind - how to prelink a binary without throwing security out the window
Prelink fixes the address of libraries making 'return to libc' attacks trival, prebind uses a different method to achieve most of the same gains, however without adding any security conerns.
Still under development, now in-tree.
|
Revision tags: OPENBSD_3_9_BASE
|
#
1.5 |
|
23-Oct-2005 |
drahn |
Use libc's SYS.h and SYSTRAP instead of rolling own. No binary change.
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.4 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_5_BASE
|
#
1.3 |
|
09-Feb-2004 |
drahn |
Enable lazy binding on arm: _dl_bind_start inspired by netbsd. changed a define to LD_ALLOW_WRITABLE_TEXT, should this be allowed? remove plt protect code, arm has a text PLT. relocate the got entries associated with the plt. perform got protect/unprotect for lazy binding updates.
|
#
1.2 |
|
09-Feb-2004 |
drahn |
Use macros to reduce the amount of hand written asm. inspired by future amd64 code. no functional change.
|
#
1.1 |
|
07-Feb-2004 |
drahn |
Dynamic linker support for arm. non-lazy binding works.
|