#
ce7279d8 |
| 21-May-2024 |
jsg <jsg@openbsd.org> |
remove prototypes with no matching function and externs with no var partly checked by millert@
|
#
4a066def |
| 16-Jan-2024 |
deraadt <deraadt@openbsd.org> |
Read PT_OPENBSD_SYSCALLS in libc.so, and convert it to a table for pinsyscalls(2). ok kettenis
|
#
434871b6 |
| 19-Dec-2023 |
deraadt <deraadt@openbsd.org> |
whitespaces
|
#
ac42b3c8 |
| 15-Aug-2023 |
guenther <guenther@openbsd.org> |
Improve handling of dlopen(RTLD_TRACE) aka ldd, of a library that is already loaded: * add a 'trace' argument to _dl_show_objects() and exit the walk-the-objects loop if you hit that traced objec
Improve handling of dlopen(RTLD_TRACE) aka ldd, of a library that is already loaded: * add a 'trace' argument to _dl_show_objects() and exit the walk-the-objects loop if you hit that traced object * in dlopen(), pass the trace object to _dl_show_objects() * also, invoke _dl_show_objects() + exit if the object was already opened * pass NULL to _dl_show_objects() for all the other calls * oh hey, _dl_tracelib is now superfluous: _dl_show_objects() should do the walk-the-objects loop only if trace is not NULL.
Problem noted by gnezdo@ ok millert@
show more ...
|
#
4098e116 |
| 29-Jan-2023 |
gnezdo <gnezdo@openbsd.org> |
Accumulate intermediate imutables locally before applying
OK deraadt
|
#
9ba2c65f |
| 04-Dec-2022 |
deraadt <deraadt@openbsd.org> |
The next step for mimmutable(). ld.so figures out what regions of memory of startup shared library mappings can be made immutable, and also does this for dlope() RTLD_NODELETE and subsidiary librari
The next step for mimmutable(). ld.so figures out what regions of memory of startup shared library mappings can be made immutable, and also does this for dlope() RTLD_NODELETE and subsidiary libraries. Complexity in this diff is due to the GNU_RELRO and OPENBSD_MUTABLE sections. Tested in snaps for about 3 weeks, with some bootstrap related pain felt in ports ok kettenis, much help from others.
show more ...
|
#
07cf23bb |
| 07-Nov-2022 |
deraadt <deraadt@openbsd.org> |
dtors were broken by trying to reuse DF_1_NODELETE to hint that this library would never unload, and could be immutable. Pass a seperate flag for our purposes Noticed from regress tests by anton, ok
dtors were broken by trying to reuse DF_1_NODELETE to hint that this library would never unload, and could be immutable. Pass a seperate flag for our purposes Noticed from regress tests by anton, ok kettenis
show more ...
|
#
ab4d5173 |
| 20-Aug-2022 |
sthen <sthen@openbsd.org> |
Support RTLD_NOLOAD in ld.so. From guenther@. OK jca@ guenther@
|
#
c340fc50 |
| 28-Jan-2022 |
guenther <guenther@openbsd.org> |
Update comment: struct link_map is defined in <link_elf.h>
noted by miod
|
#
b3331980 |
| 12-Nov-2021 |
guenther <guenther@openbsd.org> |
Add support for RELR relocations in the executable and share objects. This doesn't affect ld.so's self-reloc, which still requires DT_REL/DT_RELA
ok kettenis@
|
#
296fbf9f |
| 02-Jun-2021 |
semarie <semarie@openbsd.org> |
add RTLD_NODELETE support
if RTLD_NODELETE isn't POSIX, it is widely deployed: at least linux, freebsd, dragonfly, netbsd, solaris, illumos, apple, and fuchsia have it.
ok kettenis@ on previous ver
add RTLD_NODELETE support
if RTLD_NODELETE isn't POSIX, it is widely deployed: at least linux, freebsd, dragonfly, netbsd, solaris, illumos, apple, and fuchsia have it.
ok kettenis@ on previous version with help from and ok guenther@
diff partially inspired from a diff from brad@
show more ...
|
#
0458707b |
| 16-Mar-2021 |
kurt <kurt@openbsd.org> |
On i386 don't attempt to map shared libraries in low memory when a large executable's .text section crosses the 512MB exec line.
Executables that have MAXTSIZ > 64MB can map above the default 512MB
On i386 don't attempt to map shared libraries in low memory when a large executable's .text section crosses the 512MB exec line.
Executables that have MAXTSIZ > 64MB can map above the default 512MB exec line. When this happens, shared libs that attempt to map into low memory will find their .data section can not be mapped. ld.so will attempt to remap the share lib at higher addresses until it can be mapped. For very large executables like chrome this process is very time consuming. This change detects how much of the executable's .text section exceeds 512MB and uses that as the initial hint for shared libs to map into which avoids attempting to map into blocked memory.
okay deraadt@
show more ...
|
#
d937a926 |
| 04-Oct-2019 |
guenther <guenther@openbsd.org> |
Convert the child_list member from a linked list to a vector.
ok mpi@
|
#
bae526ee |
| 03-Oct-2019 |
guenther <guenther@openbsd.org> |
Use a better algorithm for calculating the grpsym library order. The existing code did a full recursive walk for O(horrible). Instead, keep a single list of nodes plus the index of the first node wh
Use a better algorithm for calculating the grpsym library order. The existing code did a full recursive walk for O(horrible). Instead, keep a single list of nodes plus the index of the first node whose children haven't been scanned; lookup until that index catches the end, appending the unscanned children of the node at the index. This also makes the grpsym list order match that calculated by FreeBSD and glibc in dependency trees with inconsistent ordering of dependent libs.
To make this easier and more cache friendly, convert grpsym_list to a vector: the size is bounded by the number of objects currently loaded.
Other, related fixes: * increment the grpsym generation number _after_ pushing the loading object onto its grpsym list, to avoid double counting it * increment the grpsym generation number when building the grpsym list for an already loaded object that's being dlopen()ed, to avoid incomplete grpsym lists * use a more accurate test of whether an object already has a grpsym list
Prompted by a diff from Nathanael Rensen (nathanael (at) list.polymorpheus.com) that pointed to _dl_cache_grpsym_list() as a performance bottleneck.
Much proding from robert@, sthen@, aja@, jca@ no problem reports after being in snaps ok mpi@
show more ...
|
#
143e5acc |
| 04-Aug-2019 |
guenther <guenther@openbsd.org> |
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 -
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@
show more ...
|
#
518321a8 |
| 21-Jul-2019 |
guenther <guenther@openbsd.org> |
In 2004, we upgraded to binutils 2.14 with did -zcombreloc by default. In 2013, I implemented the single-entry LRU cache that gets the maximal symbol reuse from combreloc. Since then, the ld.so gene
In 2004, we upgraded to binutils 2.14 with did -zcombreloc by default. In 2013, I implemented the single-entry LRU cache that gets the maximal symbol reuse from combreloc. Since then, the ld.so generic relocation symcache has been a waste of CPU and memory with 0% hit-rate, so kill it.
ok mpi@
show more ...
|
#
5c3b452c |
| 11-May-2019 |
guenther <guenther@openbsd.org> |
Prune visited leaves when walking dependencies to call init functions in topological sort order, reducing it to O(n) from O(2^n) (ouch!)
diff from Nathanael Rensen (nathanael(at)list.polymorpheus.co
Prune visited leaves when walking dependencies to call init functions in topological sort order, reducing it to O(n) from O(2^n) (ouch!)
diff from Nathanael Rensen (nathanael(at)list.polymorpheus.com) Much testing and pleading by robert@ and ajacoutot@ ok drahn@ mpi@
show more ...
|
#
c0197e40 |
| 10-May-2019 |
guenther <guenther@openbsd.org> |
ld.so boot cleanup support: - put functions and data which are only used before calling the executable's start function into their own page-aligned segments for unmapping (only done on amd64,
ld.so boot cleanup support: - put functions and data which are only used before calling the executable's start function into their own page-aligned segments for unmapping (only done on amd64, arm64, armv7, powerpc, and sparc64 so far) - pass .init_array and .preinit_array functions an addition argument which is a callback to get a structure which includes a function that frees the boot text and data - sometimes delay doing RELRO processing: for a shared-object marked DF_1_INITFIRST do it after the object's .init_array, for the executable do it after the .preinit_array - improve test-ld.so to link against libpthread and trigger its initialization late libc changes to use this will come later
ok kettenis@
show more ...
|
#
9d9b0c10 |
| 21-Apr-2019 |
deraadt <deraadt@openbsd.org> |
Now that all Elf_foo types are correct, we don't need to use Elf32_Word anywhere and can use Elf_Word instead. ok guenther
|
#
4e986f76 |
| 21-Apr-2019 |
guenther <guenther@openbsd.org> |
On alpha, the buckets of DT_HASH are 8 bytes instead of 4 bytes. This was previously 'implemented' by having the Elf_Word typedef in <sys/exec_elf.h> vary, but that doesn't match the spec and breaks
On alpha, the buckets of DT_HASH are 8 bytes instead of 4 bytes. This was previously 'implemented' by having the Elf_Word typedef in <sys/exec_elf.h> vary, but that doesn't match the spec and breaks libelf so it's gone away. Implement the variation here by defining our own type locally for this.
ok deraadt@
show more ...
|
#
522be859 |
| 05-Dec-2018 |
guenther <guenther@openbsd.org> |
Delete an unused struct member that has hid out here for 17 years
|
#
ac51d06c |
| 28-Nov-2018 |
guenther <guenther@openbsd.org> |
Implement support for DT_GNU_HASH, taking all the interesting bits from Matt Dillon's implementation in DragonFlyBSD commit 7629c631. One difference is that as long as DT_HASH is still present, ld.so
Implement support for DT_GNU_HASH, taking all the interesting bits from Matt Dillon's implementation in DragonFlyBSD commit 7629c631. One difference is that as long as DT_HASH is still present, ld.so will use that to get the total number of symbols rather than walking the GNU hash chains. Note that the GPLv2 binutils we have doesn't support DT_GNU_HASH, so this only helps archs were lld is used.
ok kettenis@ mpi@
show more ...
|
#
25205068 |
| 16-Nov-2018 |
guenther <guenther@openbsd.org> |
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
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@
show more ...
|
#
d1b0fb8f |
| 23-Oct-2018 |
guenther <guenther@openbsd.org> |
Delay processing of ld.so's own PT_GNU_RELRO section until after environment processing and malloc initialization, and then move variables set by those steps, including malloc's mopts structure, into
Delay processing of ld.so's own PT_GNU_RELRO section until after environment processing and malloc initialization, and then move variables set by those steps, including malloc's mopts structure, into the .data.rel.ro segment. This protects more data and eliminates the extra padding of the mopts.
ok kettenis@
show more ...
|
#
10200827 |
| 22-Oct-2018 |
guenther <guenther@openbsd.org> |
Use int, not char*, for booleans
ok millert@
|