History log of /freebsd/libexec/rtld-elf/rtld.c (Results 1 – 25 of 793)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1c8cdd80 18-Mar-2025 Konstantin Belousov <kib@FreeBSD.org>

rtld: fix several style(9) bugs

Sponsored by: The FreeBSD Foundation


Revision tags: release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4
# e917958c 04-Feb-2025 Konstantin Belousov <kib@FreeBSD.org>

rtld: clear any holes in the struct utrace_rtld passed to kernel logger

This should avoid an (almost) false positive from Valgrind, by filling
the padding on LP64.

PR: 284563
Reported by: Paul Floy

rtld: clear any holes in the struct utrace_rtld passed to kernel logger

This should avoid an (almost) false positive from Valgrind, by filling
the padding on LP64.

PR: 284563
Reported by: Paul Floyd <pjfloyd@wanadoo.fr>
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D48854

show more ...


Revision tags: release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3
# bf3fbf74 19-Jan-2025 Konstantin Belousov <kib@FreeBSD.org>

rtld obj_remap_relro(): unindent the loop body

Discussed with: emaste, imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D48509


# 7e2f3831 18-Jan-2025 Konstantin Belousov <kib@FreeBSD.org>

rtld-elf/rtld.c: apply clang-format

Discussed with: emaste, imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D48509


# dd1d7296 18-Jan-2025 Konstantin Belousov <kib@FreeBSD.org>

rtld-elf/rtld.c: fix typo in comment

Discussed with: emaste, imp
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D48509


# fda0403e 06-Dec-2024 John Baldwin <jhb@FreeBSD.org>

rtld: Support multiple PT_GNU_RELRO program headers

Iterate over all the program headers in obj_remap_relro and remove the
relro fields from Obj_Entry.

Skip the call to obj_enforce_relro() in reloc

rtld: Support multiple PT_GNU_RELRO program headers

Iterate over all the program headers in obj_remap_relro and remove the
relro fields from Obj_Entry.

Skip the call to obj_enforce_relro() in relocate_object() for the rtld
object as well as the main program object. obj_enforce_relro() is
called later when it safe to reference globals such as page_size.

Reviewed by: kib
Obtained from: CheriBSD
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D47884

show more ...


Revision tags: release/14.2.0
# 5bc24fd7 19-Nov-2024 Konstantin Belousov <kib@FreeBSD.org>

rtld: drop RTLD_INIT_PAGESIZES_EARLY

No arch defines it after ia64 decomissioning.

Discussed with: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 1426fd6c 14-Nov-2024 Kyle Evans <kevans@FreeBSD.org>

rtld: implement _dl_iterate_phdr_locked

Some sanitizers need to be able to use dl_iterate_phdr() after stopping
the rest of the process, but it's very hard to do so reliably as a
non-participant in

rtld: implement _dl_iterate_phdr_locked

Some sanitizers need to be able to use dl_iterate_phdr() after stopping
the rest of the process, but it's very hard to do so reliably as a
non-participant in the main logic of the program.

Introduce _dl_iterate_phdr_locked to bypass the locking that's normally
required for dl_iterate_phdr() and slap some scary warning on it. It
will remain undocumented and probably shouldn't be used for anything
else.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D47558

show more ...


# c56df6ce 31-Oct-2024 Konstantin Belousov <kib@FreeBSD.org>

rtld: add rtld_{get,set}_var

Reviewed by: brooks (previous version)
Discussed with: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D

rtld: add rtld_{get,set}_var

Reviewed by: brooks (previous version)
Discussed with: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D47351

show more ...


# d7214577 01-Nov-2024 Konstantin Belousov <kib@FreeBSD.org>

rtld: make it easier to add sparce non-default members to ld_env_var_desc

by making the LD_ENV_DESC() macro variadic.

Suggested by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Dif

rtld: make it easier to add sparce non-default members to ld_env_var_desc

by making the LD_ENV_DESC() macro variadic.

Suggested by: brooks
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D47351

show more ...


# 450e684e 31-Oct-2024 Konstantin Belousov <kib@FreeBSD.org>

rtld: 1-bit for bool is enough

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


Revision tags: release/13.4.0
# 33658afd 22-Aug-2024 Jessica Clarke <jrtc27@FreeBSD.org>

rtld-elf: Pass parsed aux_info to ifunc_init

Currently we pass the raw pointer to the on-stack auxargs. This can
legitimately have fewer than AT_COUNT entries, so the use of
__min_size(AT_COUNT), i.

rtld-elf: Pass parsed aux_info to ifunc_init

Currently we pass the raw pointer to the on-stack auxargs. This can
legitimately have fewer than AT_COUNT entries, so the use of
__min_size(AT_COUNT), i.e. static AT_COUNT, is inaccurate, and also
needlessly forces the callee to iterate over the elements to find the
entry for a given type. Instead we can just pass aux_info like we use
for everything else.

Note that the argument has been left unused by every callee since its
introduction in 4352999e0e6c ("Pass CPUID[1] %edx (cpu_feature), %ecx
(cpu_feature2) and CPUID[7].%ebx (cpu_stdext_feature), %ecx
(cpu_stdext_feature2) to the ifunc resolvers on x86.")

Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D46276

show more ...


# 860c4d94 17-Jul-2024 Konstantin Belousov <kib@FreeBSD.org>

rtld: add LD_NO_DL_ITERATE_PHDR_AFTER_FORK env var

which makes threaded fork ignore the phdr rtld lock, in particular
allowing the dl_iterate_phdr() to block in callback. The cost is that
the image

rtld: add LD_NO_DL_ITERATE_PHDR_AFTER_FORK env var

which makes threaded fork ignore the phdr rtld lock, in particular
allowing the dl_iterate_phdr() to block in callback. The cost is that
the image started in this mode cannot use dl_iterate_phdr() after fork.

PR: 280318
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

show more ...


# 47315d6d 17-Jul-2024 Konstantin Belousov <kib@FreeBSD.org>

rtld: make ld_get_env_var() usable for all rtld source files

Sponsored by: The FreeBSD Foundation
MFC after: 1 week


Revision tags: release/14.1.0
# 1cd90a2c 13-May-2024 Andrew Turner <andrew@FreeBSD.org>

rtld: Move powerpc specific code to powerpc files

There are two variables set by dynamic tags in the powerpc runtime
linker. Now we have a way to split out architecture-specific dynamic
tags use it

rtld: Move powerpc specific code to powerpc files

There are two variables set by dynamic tags in the powerpc runtime
linker. Now we have a way to split out architecture-specific dynamic
tags use it to handle these.

Reviewed by: kib, jhibbits
Obtained from: jhibbits (earlier version)
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D45182

show more ...


# dd4155be 07-May-2024 Andrew Turner <andrew@FreeBSD.org>

rtld: Add arch_digest_dynamic

This will be used to handle the DT_AARCH64_VARIANT_PCS tag.

Reviewed by: kib
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D45117


# ef2694f3 28-Apr-2024 Konstantin Belousov <kib@FreeBSD.org>

rtld direct exec: make -u behavior match the description

Instead of only ignoring insecure env vars, clear them all.

Reviewed by: emaste, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 wee

rtld direct exec: make -u behavior match the description

Instead of only ignoring insecure env vars, clear them all.

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

show more ...


# d1cd0cc3 28-Apr-2024 Konstantin Belousov <kib@FreeBSD.org>

rtld: add direct-exec option -o

allowing to set any known LD_ parameter for the current rtld invocation,
but without polluting the activated' binary environment. In other
words, the set parameter i

rtld: add direct-exec option -o

allowing to set any known LD_ parameter for the current rtld invocation,
but without polluting the activated' binary environment. In other
words, the set parameter is not exported into the environment.

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

show more ...


Revision tags: release/13.3.0, release/14.0.0, release/13.2.0
# d8925a5f 05-Apr-2023 Andrew Turner <andrew@FreeBSD.org>

Support BTI in rtld

Read the elf note to decide when to set the guard page on arm64.

Reviewed by: kib
Sponsored by: Arm Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://revie

Support BTI in rtld

Read the elf note to decide when to set the guard page on arm64.

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

show more ...


# c44bf7d2 22-Mar-2024 Stefan Eßer <se@FreeBSD.org>

rtld: reduce debug messages after fix on big-endian hosts

Remove a debug message that had been added to support the debugging
of a mis-detection of the hint files endianness on powerpc64.

MFC after

rtld: reduce debug messages after fix on big-endian hosts

Remove a debug message that had been added to support the debugging
of a mis-detection of the hint files endianness on powerpc64.

MFC after: 3 days

show more ...


# da2d6e28 22-Mar-2024 Michael Tuexen <tuexen@FreeBSD.org>

rtld: fix check for endianess of elf hints file

Don't check if the elf hints file is in host byte order, but check
if it is in little endian by looking at the magic number.
This fixes rtld on big en

rtld: fix check for endianess of elf hints file

Don't check if the elf hints file is in host byte order, but check
if it is in little endian by looking at the magic number.
This fixes rtld on big endian platforms.
Reviewed by: se, kib (prior version of the patch)
Fixes: 7b77d37a561b ("rtld-elf: support either byte-order of hints")
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44472

show more ...


# 17395318 21-Mar-2024 Stefan Eßer <se@FreeBSD.org>

rtld-elf: add some debug print statements

The byte-order independent code has been reported to fail on powerpc64.
Add some more debug statements to help identify the parametrs used and
to verify the

rtld-elf: add some debug print statements

The byte-order independent code has been reported to fail on powerpc64.
Add some more debug statements to help identify the parametrs used and
to verify the correct operation of the byte-swap macros used..

show more ...


# 7b77d37a 26-Feb-2024 Stefan Eßer <se@FreeBSD.org>

rtld-elf: support either byte-order of hints file

Accept either little-endian or big-endian representation of the ELF
hints magic number in the header of a hints file and convert the
parameters to t

rtld-elf: support either byte-order of hints file

Accept either little-endian or big-endian representation of the ELF
hints magic number in the header of a hints file and convert the
parameters to the native byte-order of the repsective system.

This is a pre-requisite for a planned change to always write the byte
order in little-endian format on all architectures. The only relvant
architecture that uses big-endian data is powerpc64, and it is not
likely that new architectures will choose that representation of data
in memory.

When all supported architectures use little-endian data in the hints
file, the byte swap logic can be enabled for big-endian CPUs at
compile time. Up to that point, there is a very small run-time penalty
that is paid on all systems to check the byte-order of the hints file
and to provide the option to byte-swap the parameters read from the
hints file header.

This commit contains the changes from review D44080 (which had been
split off from this patch for easier review),

Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D44053

show more ...


# 452c5e99 22-Feb-2024 Konstantin Belousov <kib@FreeBSD.org>

fdlopen(3): do not create a new object mapping if already loaded

This is expected behavior for both dlopen(3) and fdlopen(3).

PR: 277169
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC

fdlopen(3): do not create a new object mapping if already loaded

This is expected behavior for both dlopen(3) and fdlopen(3).

PR: 277169
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44019

show more ...


# 968a1897 13-Feb-2024 Konstantin Belousov <kib@FreeBSD.org>

rtld: ignore load_filtees() calls if we already loading filtees for the obj

in addition to avoiding it for already loaded filtees. Issue is that
during load, rtld needs to resolve some special ABI s

rtld: ignore load_filtees() calls if we already loading filtees for the obj

in addition to avoiding it for already loaded filtees. Issue is that
during load, rtld needs to resolve some special ABI symbols, like
executable stack fixer and static TLS initializer, which might trigger
recursion.

Example is libthr which is filter for libsys, and which exports
__pthread_distribute_static_tls.

Tested by: kevans, krion
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43858

show more ...


12345678910>>...32