#
1.51 |
|
29-Jan-2023 |
gnezdo |
Unite all nitems copies in ld.so/util.h
OK deraadt
|
Revision tags: OPENBSD_7_2_BASE
|
#
1.50 |
|
10-May-2022 |
kettenis |
Prevent out-of-bounds array access with binaries that use unsupported relocations.
ok guenther@
|
Revision tags: OPENBSD_7_1_BASE
|
#
1.49 |
|
08-Jan-2022 |
guenther |
Prep .c files for removing the #includes from */archdep.h * replace #include "archdep.h" with #includes of what is used, pulling in "syscall.h", "util.h", and "archdep.h" as needed * delete #include <sys/syscall.h> from syscall.h * only pull in <sys/stat.h> to the three files that use _dl_fstat(), forward declare struct stat in syscall.h for the others * NBBY is for <sys/select.h> macros; just use '8' in dl_printf.c * <machine/vmparam.h> is only needed on i386; conditionalize it * stop using __LDPGSZ: use _MAX_PAGE_SHIFT (already used by malloc.c) where necessary * delete other bogus #includes, order legit per style: <sys/*> then <*/*>, then <*>, then "*"
dir.c improvement from jsg@ ok and testing assistance deraadt@
|
Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
|
#
1.48 |
|
07-Dec-2019 |
guenther |
Disable ltrace for objects linked with -znow, as at least on amd64, linking that was deletes the lazy relocation trampoline which ltrace currently depends on
problem reported by tb@ directional feedback kettenis@ ok mpi@
|
#
1.47 |
|
28-Nov-2019 |
guenther |
Revert yesterday's _dl_md_reloc() and _dl_md_reloc_got() changes: something's broken on at least i386.
|
#
1.46 |
|
26-Nov-2019 |
guenther |
Clean up _dl_md_reloc(): instead of having tables and piles of conditionals that handle a dozen relocation types for each, just have a nice little switch for the four specific relocations that actually occur.
Besides being smaller and easier to understand, this fixes the COPY relocation handling to only do one symbol lookup, instead of looking up the symbol and then immediately looking it up again (with the correct flags to find the instance it needs).
ok kettenis@
|
#
1.45 |
|
26-Nov-2019 |
guenther |
Make aarch64, amd64, arm, and i386 more like sparc64: move non-lazy relocation from _dl_md_reloc() to _dl_md_reloc_all_plt() which has the minimal code to do it.
Also, avoid division on PLTRELSZ; just use it to offset to the end.
ok kettenis@
|
#
1.44 |
|
24-Oct-2019 |
guenther |
Delete unused support for relocations that don't require alignment.
ok mpi@ kettenis@
|
#
1.43 |
|
23-Oct-2019 |
guenther |
Prefer the size-independent ELF identifiers over the size-specific ones. Strip superfluous parens from return statements while here.
Done programatically with two perl invocations
idea ok kettenis@ drahn@ ok visa@
|
Revision tags: OPENBSD_6_6_BASE
|
#
1.42 |
|
05-Oct-2019 |
guenther |
Delete some obsolete debugging #ifdefs blocks
ok mlarkin@, mpi@, krw@, deraadt@
|
#
1.41 |
|
06-Aug-2019 |
guenther |
Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(), hiding the actual grotty bits in inline functions
ok mpi@
|
#
1.40 |
|
04-Aug-2019 |
guenther |
Simplify _dl_find_symbol(). Currently, it returns three values: - the symbol it found, returned via the second argument - the base offset of the the object it was found in, via the return value - optionally: the object it was found in, returned via the last argument
Instead, return a struct with the symbol and object pointers and let the caller get the base offset from the object's obj_base member. On at least aarch64, amd64, mips64, powerpc, and sparc64, a two word struct like this is passed in registers.
ok mpi@, kettenis@
|
Revision tags: OPENBSD_6_5_BASE
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.50 |
|
10-May-2022 |
kettenis |
Prevent out-of-bounds array access with binaries that use unsupported relocations.
ok guenther@
|
Revision tags: OPENBSD_7_1_BASE
|
#
1.49 |
|
08-Jan-2022 |
guenther |
Prep .c files for removing the #includes from */archdep.h * replace #include "archdep.h" with #includes of what is used, pulling in "syscall.h", "util.h", and "archdep.h" as needed * delete #include <sys/syscall.h> from syscall.h * only pull in <sys/stat.h> to the three files that use _dl_fstat(), forward declare struct stat in syscall.h for the others * NBBY is for <sys/select.h> macros; just use '8' in dl_printf.c * <machine/vmparam.h> is only needed on i386; conditionalize it * stop using __LDPGSZ: use _MAX_PAGE_SHIFT (already used by malloc.c) where necessary * delete other bogus #includes, order legit per style: <sys/*> then <*/*>, then <*>, then "*"
dir.c improvement from jsg@ ok and testing assistance deraadt@
|
Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
|
#
1.48 |
|
07-Dec-2019 |
guenther |
Disable ltrace for objects linked with -znow, as at least on amd64, linking that was deletes the lazy relocation trampoline which ltrace currently depends on
problem reported by tb@ directional feedback kettenis@ ok mpi@
|
#
1.47 |
|
28-Nov-2019 |
guenther |
Revert yesterday's _dl_md_reloc() and _dl_md_reloc_got() changes: something's broken on at least i386.
|
#
1.46 |
|
26-Nov-2019 |
guenther |
Clean up _dl_md_reloc(): instead of having tables and piles of conditionals that handle a dozen relocation types for each, just have a nice little switch for the four specific relocations that actually occur.
Besides being smaller and easier to understand, this fixes the COPY relocation handling to only do one symbol lookup, instead of looking up the symbol and then immediately looking it up again (with the correct flags to find the instance it needs).
ok kettenis@
|
#
1.45 |
|
26-Nov-2019 |
guenther |
Make aarch64, amd64, arm, and i386 more like sparc64: move non-lazy relocation from _dl_md_reloc() to _dl_md_reloc_all_plt() which has the minimal code to do it.
Also, avoid division on PLTRELSZ; just use it to offset to the end.
ok kettenis@
|
#
1.44 |
|
24-Oct-2019 |
guenther |
Delete unused support for relocations that don't require alignment.
ok mpi@ kettenis@
|
#
1.43 |
|
23-Oct-2019 |
guenther |
Prefer the size-independent ELF identifiers over the size-specific ones. Strip superfluous parens from return statements while here.
Done programatically with two perl invocations
idea ok kettenis@ drahn@ ok visa@
|
Revision tags: OPENBSD_6_6_BASE
|
#
1.42 |
|
05-Oct-2019 |
guenther |
Delete some obsolete debugging #ifdefs blocks
ok mlarkin@, mpi@, krw@, deraadt@
|
#
1.41 |
|
06-Aug-2019 |
guenther |
Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(), hiding the actual grotty bits in inline functions
ok mpi@
|
#
1.40 |
|
04-Aug-2019 |
guenther |
Simplify _dl_find_symbol(). Currently, it returns three values: - the symbol it found, returned via the second argument - the base offset of the the object it was found in, via the return value - optionally: the object it was found in, returned via the last argument
Instead, return a struct with the symbol and object pointers and let the caller get the base offset from the object's obj_base member. On at least aarch64, amd64, mips64, powerpc, and sparc64, a two word struct like this is passed in registers.
ok mpi@, kettenis@
|
Revision tags: OPENBSD_6_5_BASE
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.49 |
|
08-Jan-2022 |
guenther |
Prep .c files for removing the #includes from */archdep.h * replace #include "archdep.h" with #includes of what is used, pulling in "syscall.h", "util.h", and "archdep.h" as needed * delete #include <sys/syscall.h> from syscall.h * only pull in <sys/stat.h> to the three files that use _dl_fstat(), forward declare struct stat in syscall.h for the others * NBBY is for <sys/select.h> macros; just use '8' in dl_printf.c * <machine/vmparam.h> is only needed on i386; conditionalize it * stop using __LDPGSZ: use _MAX_PAGE_SHIFT (already used by malloc.c) where necessary * delete other bogus #includes, order legit per style: <sys/*> then <*/*>, then <*>, then "*"
dir.c improvement from jsg@ ok and testing assistance deraadt@
|
Revision tags: OPENBSD_6_7_BASE OPENBSD_6_8_BASE OPENBSD_6_9_BASE OPENBSD_7_0_BASE
|
#
1.48 |
|
07-Dec-2019 |
guenther |
Disable ltrace for objects linked with -znow, as at least on amd64, linking that was deletes the lazy relocation trampoline which ltrace currently depends on
problem reported by tb@ directional feedback kettenis@ ok mpi@
|
#
1.47 |
|
28-Nov-2019 |
guenther |
Revert yesterday's _dl_md_reloc() and _dl_md_reloc_got() changes: something's broken on at least i386.
|
#
1.46 |
|
26-Nov-2019 |
guenther |
Clean up _dl_md_reloc(): instead of having tables and piles of conditionals that handle a dozen relocation types for each, just have a nice little switch for the four specific relocations that actually occur.
Besides being smaller and easier to understand, this fixes the COPY relocation handling to only do one symbol lookup, instead of looking up the symbol and then immediately looking it up again (with the correct flags to find the instance it needs).
ok kettenis@
|
#
1.45 |
|
26-Nov-2019 |
guenther |
Make aarch64, amd64, arm, and i386 more like sparc64: move non-lazy relocation from _dl_md_reloc() to _dl_md_reloc_all_plt() which has the minimal code to do it.
Also, avoid division on PLTRELSZ; just use it to offset to the end.
ok kettenis@
|
#
1.44 |
|
24-Oct-2019 |
guenther |
Delete unused support for relocations that don't require alignment.
ok mpi@ kettenis@
|
#
1.43 |
|
23-Oct-2019 |
guenther |
Prefer the size-independent ELF identifiers over the size-specific ones. Strip superfluous parens from return statements while here.
Done programatically with two perl invocations
idea ok kettenis@ drahn@ ok visa@
|
Revision tags: OPENBSD_6_6_BASE
|
#
1.42 |
|
05-Oct-2019 |
guenther |
Delete some obsolete debugging #ifdefs blocks
ok mlarkin@, mpi@, krw@, deraadt@
|
#
1.41 |
|
06-Aug-2019 |
guenther |
Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(), hiding the actual grotty bits in inline functions
ok mpi@
|
#
1.40 |
|
04-Aug-2019 |
guenther |
Simplify _dl_find_symbol(). Currently, it returns three values: - the symbol it found, returned via the second argument - the base offset of the the object it was found in, via the return value - optionally: the object it was found in, returned via the last argument
Instead, return a struct with the symbol and object pointers and let the caller get the base offset from the object's obj_base member. On at least aarch64, amd64, mips64, powerpc, and sparc64, a two word struct like this is passed in registers.
ok mpi@, kettenis@
|
Revision tags: OPENBSD_6_5_BASE
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.48 |
|
07-Dec-2019 |
guenther |
Disable ltrace for objects linked with -znow, as at least on amd64, linking that was deletes the lazy relocation trampoline which ltrace currently depends on
problem reported by tb@ directional feedback kettenis@ ok mpi@
|
#
1.47 |
|
28-Nov-2019 |
guenther |
Revert yesterday's _dl_md_reloc() and _dl_md_reloc_got() changes: something's broken on at least i386.
|
#
1.46 |
|
26-Nov-2019 |
guenther |
Clean up _dl_md_reloc(): instead of having tables and piles of conditionals that handle a dozen relocation types for each, just have a nice little switch for the four specific relocations that actually occur.
Besides being smaller and easier to understand, this fixes the COPY relocation handling to only do one symbol lookup, instead of looking up the symbol and then immediately looking it up again (with the correct flags to find the instance it needs).
ok kettenis@
|
#
1.45 |
|
26-Nov-2019 |
guenther |
Make aarch64, amd64, arm, and i386 more like sparc64: move non-lazy relocation from _dl_md_reloc() to _dl_md_reloc_all_plt() which has the minimal code to do it.
Also, avoid division on PLTRELSZ; just use it to offset to the end.
ok kettenis@
|
#
1.44 |
|
24-Oct-2019 |
guenther |
Delete unused support for relocations that don't require alignment.
ok mpi@ kettenis@
|
#
1.43 |
|
23-Oct-2019 |
guenther |
Prefer the size-independent ELF identifiers over the size-specific ones. Strip superfluous parens from return statements while here.
Done programatically with two perl invocations
idea ok kettenis@ drahn@ ok visa@
|
Revision tags: OPENBSD_6_6_BASE
|
#
1.42 |
|
05-Oct-2019 |
guenther |
Delete some obsolete debugging #ifdefs blocks
ok mlarkin@, mpi@, krw@, deraadt@
|
#
1.41 |
|
06-Aug-2019 |
guenther |
Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(), hiding the actual grotty bits in inline functions
ok mpi@
|
#
1.40 |
|
04-Aug-2019 |
guenther |
Simplify _dl_find_symbol(). Currently, it returns three values: - the symbol it found, returned via the second argument - the base offset of the the object it was found in, via the return value - optionally: the object it was found in, returned via the last argument
Instead, return a struct with the symbol and object pointers and let the caller get the base offset from the object's obj_base member. On at least aarch64, amd64, mips64, powerpc, and sparc64, a two word struct like this is passed in registers.
ok mpi@, kettenis@
|
Revision tags: OPENBSD_6_5_BASE
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.47 |
|
28-Nov-2019 |
guenther |
Revert yesterday's _dl_md_reloc() and _dl_md_reloc_got() changes: something's broken on at least i386.
|
#
1.46 |
|
26-Nov-2019 |
guenther |
Clean up _dl_md_reloc(): instead of having tables and piles of conditionals that handle a dozen relocation types for each, just have a nice little switch for the four specific relocations that actually occur.
Besides being smaller and easier to understand, this fixes the COPY relocation handling to only do one symbol lookup, instead of looking up the symbol and then immediately looking it up again (with the correct flags to find the instance it needs).
ok kettenis@
|
#
1.45 |
|
26-Nov-2019 |
guenther |
Make aarch64, amd64, arm, and i386 more like sparc64: move non-lazy relocation from _dl_md_reloc() to _dl_md_reloc_all_plt() which has the minimal code to do it.
Also, avoid division on PLTRELSZ; just use it to offset to the end.
ok kettenis@
|
#
1.44 |
|
24-Oct-2019 |
guenther |
Delete unused support for relocations that don't require alignment.
ok mpi@ kettenis@
|
#
1.43 |
|
23-Oct-2019 |
guenther |
Prefer the size-independent ELF identifiers over the size-specific ones. Strip superfluous parens from return statements while here.
Done programatically with two perl invocations
idea ok kettenis@ drahn@ ok visa@
|
Revision tags: OPENBSD_6_6_BASE
|
#
1.42 |
|
05-Oct-2019 |
guenther |
Delete some obsolete debugging #ifdefs blocks
ok mlarkin@, mpi@, krw@, deraadt@
|
#
1.41 |
|
06-Aug-2019 |
guenther |
Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(), hiding the actual grotty bits in inline functions
ok mpi@
|
#
1.40 |
|
04-Aug-2019 |
guenther |
Simplify _dl_find_symbol(). Currently, it returns three values: - the symbol it found, returned via the second argument - the base offset of the the object it was found in, via the return value - optionally: the object it was found in, returned via the last argument
Instead, return a struct with the symbol and object pointers and let the caller get the base offset from the object's obj_base member. On at least aarch64, amd64, mips64, powerpc, and sparc64, a two word struct like this is passed in registers.
ok mpi@, kettenis@
|
Revision tags: OPENBSD_6_5_BASE
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.46 |
|
26-Nov-2019 |
guenther |
Clean up _dl_md_reloc(): instead of having tables and piles of conditionals that handle a dozen relocation types for each, just have a nice little switch for the four specific relocations that actually occur.
Besides being smaller and easier to understand, this fixes the COPY relocation handling to only do one symbol lookup, instead of looking up the symbol and then immediately looking it up again (with the correct flags to find the instance it needs).
ok kettenis@
|
#
1.45 |
|
26-Nov-2019 |
guenther |
Make aarch64, amd64, arm, and i386 more like sparc64: move non-lazy relocation from _dl_md_reloc() to _dl_md_reloc_all_plt() which has the minimal code to do it.
Also, avoid division on PLTRELSZ; just use it to offset to the end.
ok kettenis@
|
#
1.44 |
|
24-Oct-2019 |
guenther |
Delete unused support for relocations that don't require alignment.
ok mpi@ kettenis@
|
#
1.43 |
|
23-Oct-2019 |
guenther |
Prefer the size-independent ELF identifiers over the size-specific ones. Strip superfluous parens from return statements while here.
Done programatically with two perl invocations
idea ok kettenis@ drahn@ ok visa@
|
Revision tags: OPENBSD_6_6_BASE
|
#
1.42 |
|
05-Oct-2019 |
guenther |
Delete some obsolete debugging #ifdefs blocks
ok mlarkin@, mpi@, krw@, deraadt@
|
#
1.41 |
|
06-Aug-2019 |
guenther |
Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(), hiding the actual grotty bits in inline functions
ok mpi@
|
#
1.40 |
|
04-Aug-2019 |
guenther |
Simplify _dl_find_symbol(). Currently, it returns three values: - the symbol it found, returned via the second argument - the base offset of the the object it was found in, via the return value - optionally: the object it was found in, returned via the last argument
Instead, return a struct with the symbol and object pointers and let the caller get the base offset from the object's obj_base member. On at least aarch64, amd64, mips64, powerpc, and sparc64, a two word struct like this is passed in registers.
ok mpi@, kettenis@
|
Revision tags: OPENBSD_6_5_BASE
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.45 |
|
26-Nov-2019 |
guenther |
Make aarch64, amd64, arm, and i386 more like sparc64: move non-lazy relocation from _dl_md_reloc() to _dl_md_reloc_all_plt() which has the minimal code to do it.
Also, avoid division on PLTRELSZ; just use it to offset to the end.
ok kettenis@
|
#
1.44 |
|
24-Oct-2019 |
guenther |
Delete unused support for relocations that don't require alignment.
ok mpi@ kettenis@
|
#
1.43 |
|
23-Oct-2019 |
guenther |
Prefer the size-independent ELF identifiers over the size-specific ones. Strip superfluous parens from return statements while here.
Done programatically with two perl invocations
idea ok kettenis@ drahn@ ok visa@
|
Revision tags: OPENBSD_6_6_BASE
|
#
1.42 |
|
05-Oct-2019 |
guenther |
Delete some obsolete debugging #ifdefs blocks
ok mlarkin@, mpi@, krw@, deraadt@
|
#
1.41 |
|
06-Aug-2019 |
guenther |
Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(), hiding the actual grotty bits in inline functions
ok mpi@
|
#
1.40 |
|
04-Aug-2019 |
guenther |
Simplify _dl_find_symbol(). Currently, it returns three values: - the symbol it found, returned via the second argument - the base offset of the the object it was found in, via the return value - optionally: the object it was found in, returned via the last argument
Instead, return a struct with the symbol and object pointers and let the caller get the base offset from the object's obj_base member. On at least aarch64, amd64, mips64, powerpc, and sparc64, a two word struct like this is passed in registers.
ok mpi@, kettenis@
|
Revision tags: OPENBSD_6_5_BASE
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.44 |
|
24-Oct-2019 |
guenther |
Delete unused support for relocations that don't require alignment.
ok mpi@ kettenis@
|
#
1.43 |
|
23-Oct-2019 |
guenther |
Prefer the size-independent ELF identifiers over the size-specific ones. Strip superfluous parens from return statements while here.
Done programatically with two perl invocations
idea ok kettenis@ drahn@ ok visa@
|
Revision tags: OPENBSD_6_6_BASE
|
#
1.42 |
|
05-Oct-2019 |
guenther |
Delete some obsolete debugging #ifdefs blocks
ok mlarkin@, mpi@, krw@, deraadt@
|
#
1.41 |
|
06-Aug-2019 |
guenther |
Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(), hiding the actual grotty bits in inline functions
ok mpi@
|
#
1.40 |
|
04-Aug-2019 |
guenther |
Simplify _dl_find_symbol(). Currently, it returns three values: - the symbol it found, returned via the second argument - the base offset of the the object it was found in, via the return value - optionally: the object it was found in, returned via the last argument
Instead, return a struct with the symbol and object pointers and let the caller get the base offset from the object's obj_base member. On at least aarch64, amd64, mips64, powerpc, and sparc64, a two word struct like this is passed in registers.
ok mpi@, kettenis@
|
Revision tags: OPENBSD_6_5_BASE
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.43 |
|
23-Oct-2019 |
guenther |
Prefer the size-independent ELF identifiers over the size-specific ones. Strip superfluous parens from return statements while here.
Done programatically with two perl invocations
idea ok kettenis@ drahn@ ok visa@
|
Revision tags: OPENBSD_6_6_BASE
|
#
1.42 |
|
05-Oct-2019 |
guenther |
Delete some obsolete debugging #ifdefs blocks
ok mlarkin@, mpi@, krw@, deraadt@
|
#
1.41 |
|
06-Aug-2019 |
guenther |
Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(), hiding the actual grotty bits in inline functions
ok mpi@
|
#
1.40 |
|
04-Aug-2019 |
guenther |
Simplify _dl_find_symbol(). Currently, it returns three values: - the symbol it found, returned via the second argument - the base offset of the the object it was found in, via the return value - optionally: the object it was found in, returned via the last argument
Instead, return a struct with the symbol and object pointers and let the caller get the base offset from the object's obj_base member. On at least aarch64, amd64, mips64, powerpc, and sparc64, a two word struct like this is passed in registers.
ok mpi@, kettenis@
|
Revision tags: OPENBSD_6_5_BASE
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.42 |
|
05-Oct-2019 |
guenther |
Delete some obsolete debugging #ifdefs blocks
ok mlarkin@, mpi@, krw@, deraadt@
|
#
1.41 |
|
06-Aug-2019 |
guenther |
Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(), hiding the actual grotty bits in inline functions
ok mpi@
|
#
1.40 |
|
04-Aug-2019 |
guenther |
Simplify _dl_find_symbol(). Currently, it returns three values: - the symbol it found, returned via the second argument - the base offset of the the object it was found in, via the return value - optionally: the object it was found in, returned via the last argument
Instead, return a struct with the symbol and object pointers and let the caller get the base offset from the object's obj_base member. On at least aarch64, amd64, mips64, powerpc, and sparc64, a two word struct like this is passed in registers.
ok mpi@, kettenis@
|
Revision tags: OPENBSD_6_5_BASE
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.41 |
|
06-Aug-2019 |
guenther |
Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(), hiding the actual grotty bits in inline functions
ok mpi@
|
#
1.40 |
|
04-Aug-2019 |
guenther |
Simplify _dl_find_symbol(). Currently, it returns three values: - the symbol it found, returned via the second argument - the base offset of the the object it was found in, via the return value - optionally: the object it was found in, returned via the last argument
Instead, return a struct with the symbol and object pointers and let the caller get the base offset from the object's obj_base member. On at least aarch64, amd64, mips64, powerpc, and sparc64, a two word struct like this is passed in registers.
ok mpi@, kettenis@
|
Revision tags: OPENBSD_6_5_BASE
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.39 |
|
16-Nov-2018 |
guenther |
Finish ld.so's transition to GNU_RELRO: eliminate support for using __got_{start,end} to find a region to mark read-only. It was only used for binaries that didn't have a GNU_RELRO segment, but all archs have been using that for over a year. Since support for insecure-PLT layouts on powerpc and alpha have been removed, all archs handle GNU_RELRO the same way and the support can be moved from the MD code to the MI code.
ok mpi@
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
#
1.38 |
|
25-Oct-2018 |
guenther |
The compilers already put static arrays in .rodata when not written to; marking them const will keep a source change from silently moving them back to .data
ok deraadt@ kettenis@
|
Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|
Revision tags: OPENBSD_6_2_BASE
|
#
1.37 |
|
04-Jun-2017 |
naddy |
For the memory operand, clang passes in an address relative to the stack pointer. We cannot use this twice while pushing values on the stack. Instead load the operand address into a register and use this as base address. Use %edx since it is already marked as clobbered. Also fixes a syntax problem for clang. ok mlarkin@
|
Revision tags: OPENBSD_6_1_BASE
|
#
1.36 |
|
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@
|
Revision tags: OPENBSD_6_0_BASE
|
#
1.35 |
|
04-Jul-2016 |
guenther |
The GOT has been initally mapped RW for *years*; ld.so doesn't need to mprotect it to RW when filling in the references from the PLT
in snaps for a week, ok deraadt@
|
#
1.34 |
|
26-May-2016 |
deraadt |
for textrels (sthen ran into one...): Ignore the listed protection (which may contain X) when making page writeable temporary.
|
#
1.33 |
|
22-May-2016 |
deraadt |
Ignore the listed protection (which may contain X) when making page writeable temporary. As pointed out by kettenis, discussed with guenther
|
Revision tags: OPENBSD_5_9_BASE
|
#
1.32 |
|
02-Nov-2015 |
guenther |
Factor out the logic for mprotecting the memory between two symbols into a new MI routine _dl_protect_segment(), and use that for protecting the GOT and--on some archs--the PLT.
Amazing testing turnaround by miod@, who apparently violated relativity to get back results on some archs as fast as he did
|
#
1.31 |
|
25-Aug-2015 |
guenther |
Use kbind for lazy binding GOT/PLT updates on i386 and powerpc; still others to follow. While here add some gcc __predict hints.
Much discussion with and assistance from miod and deraadt ok deraadt@
|
Revision tags: OPENBSD_5_8_BASE
|
#
1.30 |
|
26-Jul-2015 |
guenther |
Copy relocations can't be jump-slot relocations, so delete the test for that.
ok miod@
|
Revision tags: OPENBSD_5_4_BASE OPENBSD_5_5_BASE OPENBSD_5_6_BASE OPENBSD_5_7_BASE
|
#
1.29 |
|
13-Jun-2013 |
brad |
Appease LLVM warning..
error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
Suggestion from matthew@ Ok matthew@ miod@
|
#
1.28 |
|
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.27 |
|
08-May-2013 |
guenther |
Implement symbol caching and RELACOUNT/RELCOUNT optimizations. Much assistance and testing by miod
ok miod@
|
Revision tags: OPENBSD_5_3_BASE
|
#
1.26 |
|
05-Dec-2012 |
deraadt |
Remove excessive sys/cdefs.h inclusion ok guenther millert kettenis
|
Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
|
#
1.25 |
|
06-Apr-2011 |
miod |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0' for chars.
|
Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
|
#
1.24 |
|
02-May-2010 |
guenther |
Combine the signal mask handling into _dl_thread_bind_lock(), as it's MI.
ok drahn@
|
Revision tags: OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
|
#
1.23 |
|
09-Apr-2008 |
kurt |
Improve support for shared libs linked at non-zero addreses: - rename private values in struct elf_object to better describe their meaning: s/load_offs/obj_base/ "object's address '0' base" s/load_addr/load_base/ "The base address of the loadable segments" - gdb needs the obj_base value so swap positions with load_base in struct elf_object - fix a few occurrences of where load_base was used instead of obj_base.
With help and okay drahn@
|
Revision tags: OPENBSD_4_3_BASE
|
#
1.22 |
|
27-Nov-2007 |
miod |
Make _dl_md_reloc_got() report errors, and take them into account. Fixes PR #5579.
|
Revision tags: OPENBSD_4_2_BASE
|
#
1.21 |
|
05-May-2007 |
drahn |
Provide hook so that rthreads can provide a spinlock to protect from races in lazy binding. ok art@, kurt@
|
Revision tags: OPENBSD_4_1_BASE
|
#
1.20 |
|
28-Oct-2006 |
drahn |
Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing.
|
Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE
|
#
1.19 |
|
22-Sep-2005 |
drahn |
Use std missing symbol print instead of MD custom, do not warn on weak undefined symbols, or count them as failures. inspired kurt@
|
#
1.18 |
|
21-Sep-2005 |
drahn |
Simplify the internal symbol finding API, with some cleanup, prep for next step. ok kurt@
|
#
1.17 |
|
16-Sep-2005 |
drahn |
Rework symbol lookup to more closely match sun's documentation, now treats dlopens as load groups. ok kurt@
|
Revision tags: OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE
|
#
1.16 |
|
25-May-2004 |
mickey |
provide one version of _dl_bcopy instead of copy in every arch; drahn@ ok
|
#
1.15 |
|
25-May-2004 |
mickey |
return object* the symbol is in for _dl_find_symbol*; drahn@ ok
|
#
1.14 |
|
25-May-2004 |
deraadt |
spacing
|
Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE
|
#
1.13 |
|
04-Sep-2003 |
drahn |
Fix W^X mistake. If the dynamic linker is workin in non-lazy mode, it should still mprotect the GOT and PLT as appropriate. ok deraadt@ miod@
|
#
1.12 |
|
04-Sep-2003 |
drahn |
Symbol cache for GOT lookup. When a symbol is found it is saved in a cache for future lookups in the same GOT relocation table. Uses static buffer for small symbol tables, mmap for larger ones. ok deraadt@
|
#
1.11 |
|
02-Sep-2003 |
drahn |
Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@
|
#
1.10 |
|
28-Jul-2003 |
drahn |
The fifth argument to _dl_find_symbol is a 'int size', not a SYM_ define. Fix several calls which had the incorrect but working define in that position It happened that SYM_NOTPLT was 0, which was the desired size value.
|
#
1.9 |
|
03-Jun-2003 |
art |
three four gone.
|
Revision tags: OPENBSD_3_3_BASE
|
#
1.8 |
|
15-Feb-2003 |
drahn |
Paranoia about mprotect, mprotect page aligned regions for got and plt.
|
#
1.7 |
|
02-Feb-2003 |
deraadt |
knf & ansi; drahn ok
|
#
1.6 |
|
18-Dec-2002 |
drahn |
Prepare for an upcoming ELF executable change. This will allow ld.so to protect the GOT and PLT sections of the executable from being overwritten. This behavior is enabled by changes in the executable/shared object layout, and does not occur without the ld changes.
|
#
1.5 |
|
23-Nov-2002 |
drahn |
Put in a required item. Should not have been deleted to start with.
|
#
1.4 |
|
14-Nov-2002 |
drahn |
Make error messages on symbol lookup failures more useful.
|
#
1.3 |
|
13-Nov-2002 |
drahn |
Check for NULL on pltgot, appearently libraries with no external references will not create a PLT on i386.
|
Revision tags: OPENBSD_3_2_BASE
|
#
1.2 |
|
01-Sep-2002 |
drahn |
Make sure that the symbol return value is always initialized before the address of it is passed to dl_find_symbol(). fixes xpdf lazy binding problem. ok art@
|
#
1.1 |
|
23-Aug-2002 |
drahn |
Support for i386 ELF. Not an indication that the change is going to be made, just so that these files are maintained in the tree.
|