History log of /freebsd/libexec/rtld-elf/rtld.c (Results 76 – 100 of 817)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 008475d3 14-Aug-2022 Konstantin Belousov <kib@FreeBSD.org>

rtld: fix display of the mapbase for the traced objects

Commit 24d0c9c1f565bab6e introduced the following regression:
% ldd /bin/ls
/bin/ls:
libutil.so.9 => /lib/libutil.so.9 (0x1021000)

rtld: fix display of the mapbase for the traced objects

Commit 24d0c9c1f565bab6e introduced the following regression:
% ldd /bin/ls
/bin/ls:
libutil.so.9 => /lib/libutil.so.9 (0x1021000)
libncursesw.so.9 => /lib/libncursesw.so.9 (0x1021000)
libc.so.7 => /lib/libc.so.7 (0x1021000)
Note that the base address is the same for all displayed libraries.

Fix it by passing correct object to trace_print_obj().

Fixes: 24d0c9c1f565bab6e
Reviewed by: jrtc27
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D36198

show more ...


# becd9908 12-Jul-2022 Jessica Clarke <jrtc27@FreeBSD.org>

rtld-elf: Fix leaks and wild frees in origin_subst

55abf23dd36b inverted the value passed to origin_subst_one when rolling
up the existing code into a loop. If the first token is found ($ORIGIN),
th

rtld-elf: Fix leaks and wild frees in origin_subst

55abf23dd36b inverted the value passed to origin_subst_one when rolling
up the existing code into a loop. If the first token is found ($ORIGIN),
this results in a wild free of part of strtab. Processing the second
token works fine and will act how the first should have regardless of
whether found, allocating memory for the string without freeing.
Processing subsequent tokens however will then leak, regardless of
whether found, as they will also believe they need to allocate memory
and can't free the string.

Found by: CHERI
Reviewed by: kib, markj
Fixes: 55abf23dd36b ("rtld: make token substitution table-driven")
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D35792

show more ...


Revision tags: release/13.1.0
# e85eaa93 04-Apr-2022 Andrew Turner <andrew@FreeBSD.org>

Have rtld query the page size from the kernel

To allow for a dynamic page size on arm64 have the runtime linker
query the kernel for the currentl page size.

Reviewed by: kib
Sponsored by: The FreeB

Have rtld query the page size from the kernel

To allow for a dynamic page size on arm64 have the runtime linker
query the kernel for the currentl page size.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34765

show more ...


# 0913953c 30-Mar-2022 Konstantin Belousov <kib@FreeBSD.org>

rtld: trace preloaded objects

Before, preloaded objects, if not listed as needed for any normally
linked objects, were silently ignored.

Preloaded objects are printed with the `[preloaded]` herald.

rtld: trace preloaded objects

Before, preloaded objects, if not listed as needed for any normally
linked objects, were silently ignored.

Preloaded objects are printed with the `[preloaded]` herald. The list
includes the objects not listed explicitly as recursive dependencies of
the main object, effectively dsos loaded by LD_PRELOAD mechanism.
vdso is listed as well, since it is not needed by anything.

Since there is no DT_NEEDED entry for LD_PRELOADed objects, they are
usually printed using LD_TRACE_LOADED_OBJECTS_FTM2 format due to the
failure of the heuristic based on the presence of the 'lib' prefix.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34716

show more ...


# db037280 31-Mar-2022 Konstantin Belousov <kib@FreeBSD.org>

rtld trace_loaded_objects(): use bool for the list_containers variable

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D3

rtld trace_loaded_objects(): use bool for the list_containers variable

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34716

show more ...


# b0bc8cc7 30-Mar-2022 Konstantin Belousov <kib@FreeBSD.org>

rtld: use style(9) for trace_loaded_objects()

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34716


# 24d0c9c1 30-Mar-2022 Konstantin Belousov <kib@FreeBSD.org>

rtld: extract printer for a single traced object into a helper

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34716


# c25f36f6 30-Mar-2022 Konstantin Belousov <kib@FreeBSD.org>

rtld: extract calculation of the format strings for trace into a helper

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D

rtld: extract calculation of the format strings for trace into a helper

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34716

show more ...


# b1b51741 11-Feb-2022 Konstantin Belousov <kib@FreeBSD.org>

rtld: Add ${TOKEN} aliases to $TOKEN

it seems that glibc supports them, and such spelling is mentioned in the
ld.bfd manual. Idea seems to auto-correct some quoting/makefile sytnax
errors on linker

rtld: Add ${TOKEN} aliases to $TOKEN

it seems that glibc supports them, and such spelling is mentioned in the
ld.bfd manual. Idea seems to auto-correct some quoting/makefile sytnax
errors on linker command line.

Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34247

show more ...


# 55abf23d 11-Feb-2022 Konstantin Belousov <kib@FreeBSD.org>

rtld: make token substitution table-driven

Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34247


# d33d8f7e 27-Jan-2022 John Baldwin <jhb@FreeBSD.org>

rtld: Fix assertion I broke.

textrel is a bool, not a pointer.

Pointy hat to: jhb
Reported by: kevans
Fixes: 6a2d75d24857 rtld: Trim a few more MIPS #ifdefs.


# 6a2d75d2 27-Jan-2022 John Baldwin <jhb@FreeBSD.org>

rtld: Trim a few more MIPS #ifdefs.

Reviewed by: imp, kib
Sponsored by: The University of Cambridge, Google Inc.
Differential Revision: https://reviews.freebsd.org/D34052


# 2bf21b0e 06-Jan-2022 Konstantin Belousov <kib@FreeBSD.org>

Restore DT_DEBUG processing

Pointed out by: kevans
Fixes: 292cba9b4919ee188ca08cc8bf5057e346514383
Sponsored by: The FreeBSD Foundation


# 292cba9b 06-Jan-2022 Konstantin Belousov <kib@FreeBSD.org>

rtld: remove mips-specific cases from generic code

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D33763


# 8bcdb144 09-Dec-2021 John Baldwin <jhb@FreeBSD.org>

TLS: Use <machine/tls.h> for libc and rtld.

- Include <machine/tls.h> in MD rtld_machdep.h headers.

- Remove local definitions of TLS_* constants from rtld_machdep.h
headers and libc using the va

TLS: Use <machine/tls.h> for libc and rtld.

- Include <machine/tls.h> in MD rtld_machdep.h headers.

- Remove local definitions of TLS_* constants from rtld_machdep.h
headers and libc using the values from <machine/tls.h> instead.

- Use _tcb_set() instead of inlined versions in MD
allocate_initial_tls() routines in rtld. The one exception is amd64
whose _tcb_set() invokes the amd64_set_fsbase ifunc. rtld cannot
use ifuncs, so amd64 inlines the logic to optionally write to fsbase
directly.

- Use _tcb_set() instead of _set_tp() in libc.

- Use '&_tcb_get()->tcb_dtv' instead of _get_tp() in both rtld and libc.
This permits removing _get_tp.c from rtld.

- Use TLS_TCB_SIZE and TLS_TCB_ALIGN with allocate_tls() in MD
allocate_initial_tls() routines in rtld.

Reviewed by: kib, jrtc27 (earlier version)
Differential Revision: https://reviews.freebsd.org/D33353

show more ...


Revision tags: release/12.3.0
# c210ef13 11-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

rtld: load preloaded vdso

Reviewed by: emaste
Discussed with: jrtc27
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D32960


# 01c77a43 11-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

Pass vdso address to userspace

Reviewed by: emaste
Discussed with: jrtc27
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D3

Pass vdso address to userspace

Reviewed by: emaste
Discussed with: jrtc27
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential revision: https://reviews.freebsd.org/D32960

show more ...


# b61bce17 13-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

rtld dump_auxv: be pedantic and distiguish between auxv union members based on format

Reviewed by: jrtc27
Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 3a902ef2 13-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

rtld dump_auxv: consistently use long modifier for non-pointer auxv vals

Reviewed by: jrtc27
Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 64ba1f4c 13-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

rtld: Implement LD_SHOW_AUXV

It dumps auxv as seen by interpreter, right before starting any user
code.

Copied from: glibc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 74aec961 06-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

rtld: style adjustments

Consistently use `return ()'.
Fix some spacing issues with types formatting, and around binary ops.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# c5637b8b 06-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

rtld: ignore fstatfs(2) errors when checking MNT_NOEXEC flag

File descriptor we operate on might reference something that is not a
file, e.g. shmfd. In this case, we cannot check MNT_NOEXEC in
prin

rtld: ignore fstatfs(2) errors when checking MNT_NOEXEC flag

File descriptor we operate on might reference something that is not a
file, e.g. shmfd. In this case, we cannot check MNT_NOEXEC in
principle.

If fstatfs(2) caused some failure on normal filesystem, then typical
expectation is that read or mmap of this file would also fail. If not,
mmap(2) PROT_EXEC on MNT_NOEXEC filesystem returns EACCES.

Reported by: obiwac@gmail.com
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

show more ...


# 8363963a 06-Nov-2021 Konstantin Belousov <kib@FreeBSD.org>

rtld: fix dangerous_ld_env calculation for ld_dynamic_weak

Default value for ld_dynamic_weak is true, non-default settings should
be activated for the false value.

Reported by: obiwac@gmail.com
Spo

rtld: fix dangerous_ld_env calculation for ld_dynamic_weak

Default value for ld_dynamic_weak is true, non-default settings should
be activated for the false value.

Reported by: obiwac@gmail.com
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

show more ...


# 40ddde6e 25-Oct-2021 Konstantin Belousov <kib@FreeBSD.org>

rtld: Print currently configured search path for libraries for -v

Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 33dba3bb 12-Oct-2021 Konstantin Belousov <kib@FreeBSD.org>

rtld-elf/paths.h: Make it usable outside rtld

but still for tightly coupled things like ldd(1)

Rename paths.h to rtld_paths.h.
Add guard for rtld-specific externs declarations.
Add _COMPAT32_BASENA

rtld-elf/paths.h: Make it usable outside rtld

but still for tightly coupled things like ldd(1)

Rename paths.h to rtld_paths.h.
Add guard for rtld-specific externs declarations.
Add _COMPAT32_BASENAME_RTLD and _COMPAT32_PATH_RTLD.

Reviewed by: arichardson, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32464

show more ...


12345678910>>...33