History log of /openbsd/libexec/ld.so/i386/rtld_machine.c (Results 1 – 25 of 51)
Revision Date Author Comments
# 388165f5 29-Jan-2023 gnezdo <gnezdo@openbsd.org>

Unite all nitems copies in ld.so/util.h

OK deraadt


# 92d6eede 10-May-2022 kettenis <kettenis@openbsd.org>

Prevent out-of-bounds array access with binaries that use unsupported
relocations.

ok guenther@


# b722ba42 08-Jan-2022 guenther <guenther@openbsd.org>

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 #inc

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@

show more ...


# d9337de3 07-Dec-2019 guenther <guenther@openbsd.org>

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 feed

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@

show more ...


# c8754c30 28-Nov-2019 guenther <guenther@openbsd.org>

Revert yesterday's _dl_md_reloc() and _dl_md_reloc_got() changes:
something's broken on at least i386.


# 0e51d825 26-Nov-2019 guenther <guenther@openbsd.org>

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 actual

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@

show more ...


# 51a0cd2b 26-Nov-2019 guenther <guenther@openbsd.org>

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; ju

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@

show more ...


# 2f142762 24-Oct-2019 guenther <guenther@openbsd.org>

Delete unused support for relocations that don't require alignment.

ok mpi@ kettenis@


# e3b0f1d9 23-Oct-2019 guenther <guenther@openbsd.org>

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@

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@

show more ...


# d6b8755e 05-Oct-2019 guenther <guenther@openbsd.org>

Delete some obsolete debugging #ifdefs blocks

ok mlarkin@, mpi@, krw@, deraadt@


# 90273bfb 06-Aug-2019 guenther <guenther@openbsd.org>

Factor out TEXTREL mprotecting from the per-arch files into _dl_rtld(),
hiding the actual grotty bits in inline functions

ok mpi@


# 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 ...


# 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 ...


# 2668a398 25-Oct-2018 guenther <guenther@openbsd.org>

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@


# f60b60f5 04-Jun-2017 naddy <naddy@openbsd.org>

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
us

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@

show more ...


# 3b50b772 24-Jan-2017 guenther <guenther@openbsd.org>

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@


# 82f40691 04-Jul-2016 guenther <guenther@openbsd.org>

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@


# 0a2c9542 26-May-2016 deraadt <deraadt@openbsd.org>

for textrels (sthen ran into one...):
Ignore the listed protection (which may contain X) when making page
writeable temporary.


# 6d5bcfa2 22-May-2016 deraadt <deraadt@openbsd.org>

Ignore the listed protection (which may contain X) when making page
writeable temporary.
As pointed out by kettenis, discussed with guenther


# e23a26ff 02-Nov-2015 guenther <guenther@openbsd.org>

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 turn

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

show more ...


# 325c51e2 25-Aug-2015 guenther <guenther@openbsd.org>

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@


# 117639ec 26-Jul-2015 guenther <guenther@openbsd.org>

Copy relocations can't be jump-slot relocations, so delete the test for that.

ok miod@


# 875211e1 13-Jun-2013 brad <brad@openbsd.org>

Appease LLVM warning..

error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]

Suggestion from matthew@
Ok matthew@ miod@


# ae398163 01-Jun-2013 miod <miod@openbsd.org>

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, ltrac

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

show more ...


# 88098a4d 08-May-2013 guenther <guenther@openbsd.org>

Implement symbol caching and RELACOUNT/RELCOUNT optimizations.
Much assistance and testing by miod

ok miod@


123