History log of /freebsd-14.2/libexec/rtld-elf/rtld.c (Results 1 – 25 of 462)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0
# 279e543d 17-Jul-2024 Konstantin Belousov <[email protected]>

rtld: add LD_NO_DL_ITERATE_PHDR_AFTER_FORK env var

PR: 280318

(cherry picked from commit 860c4d94ac46cee35a678cf3c9cdbd437dfed75e)


# da32a061 17-Jul-2024 Konstantin Belousov <[email protected]>

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

(cherry picked from commit 47315d6d3562111883142bb09320d35f05d34a58)


Revision tags: release/14.1.0
# 6c850031 28-Apr-2024 Konstantin Belousov <[email protected]>

rtld direct exec: make -u behavior match the description

(cherry picked from commit ef2694f368cee5957ee44b0298da88ff8360d561)


# d63c680d 28-Apr-2024 Konstantin Belousov <[email protected]>

rtld: add direct-exec option -o

(cherry picked from commit d1cd0cc32b53c09e72e33116b94a5b0b9781a183)


Revision tags: release/13.3.0, release/14.0.0
# 0b56acfc 29-Oct-2023 Stephen J. Kiernan <[email protected]>

rtld: introduce STATIC_TLS_EXTRA

(cherry picked from commit 95335dd3c19e0ade161bb4dc8462fc3d045ce4f8)


# 32364f99 26-Feb-2024 Stefan Eßer <[email protected]>

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

(cherry picked from commit 7b77d37a561b47db093a2528b8032dbfe5791698)

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

(cherry picked from commit 173953182af060dcab43990e179ee91e9f2d1e54)

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

(cherry picked from commit da2d6e2815d7694e3ccbd561508074c547b02dd6)

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

(cherry picked from commit c44bf7d2e9d2292867f2e23f291266af26762354)

show more ...


# 11137153 22-Feb-2024 Konstantin Belousov <[email protected]>

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

PR: 277169

(cherry picked from commit 452c5e9995ab4cd6c7ea230cffe0c53bfa65c1ab)


# 25bd8753 13-Feb-2024 Konstantin Belousov <[email protected]>

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

(cherry picked from commit 968a18975adc9c2a619bb52aa2f009de99fc9e24)


# e43855c6 13-Feb-2024 Konstantin Belousov <[email protected]>

rtld load_filtees(): reindent and reduce block nesting

(cherry picked from commit 30b5f6b33b35623e6b6aa1d27a78311e199fa602)


# c6d43392 13-Feb-2024 Konstantin Belousov <[email protected]>

rtld symlook_obj: move common code to check filtees into helper

(cherry picked from commit 9ea864b54b57f2d0125860fb923f8db52b20eac2)


# 32322682 01-Feb-2024 Mark Johnston <[email protected]>

rtld-elf: Avoid unnecessary lock_restart_for_upgrade() calls

In order to atomically upgrade the rtld bind lock, load_filtees() may
trigger a longjmp back to _rtld_bind() so that the binding can be d

rtld-elf: Avoid unnecessary lock_restart_for_upgrade() calls

In order to atomically upgrade the rtld bind lock, load_filtees() may
trigger a longjmp back to _rtld_bind() so that the binding can be done
with the write lock held. However, the write lock is only needed when
filtee objects haven't already been loaded, so move the
lock_restart_for_upgrade() call to avoid unnecessary lock upgrades when
a filtee is defined.

Reviewed by: kib
Tested by: brooks
MFC after: 1 week
Sponsored by: Innovate UK

(cherry picked from commit e7951d0b04e6464b37264b8166b1e9ce368a9f1d)

show more ...


# 8d0740e8 29-Nov-2023 Konstantin Belousov <[email protected]>

RTLD_DEEPBIND: make lookup not just symbolic, but walk all refobj' DAGs

PR: 275393

(cherry picked from commit 9daf6cd0f46416d9c6eb0411ea6042cd42b8a9bc)


# 3f3c631d 15-Sep-2023 Konstantin Belousov <[email protected]>

rtld: output rtld errors into the dbg channel

(cherry picked from commit 72d97e1dd9cc72a2acb96e35e56db6f3f51bca7d)


# feaae6ba 30-Jul-2023 Konstantin Belousov <[email protected]>

rtld: switch from malloc_aligned() to __crt_aligned_alloc()

Use regular free(), since it works now.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision:

rtld: switch from malloc_aligned() to __crt_aligned_alloc()

Use regular free(), since it works now.

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

show more ...


# b1d3e2b7 18-Aug-2023 Konstantin Belousov <[email protected]>

rtld: unlock bind lock when calling into crt __pthread_distribute_static_tls method

The method might require resolving and binding symbols, which means
recursing on the bind lock. It is safe to unlo

rtld: unlock bind lock when calling into crt __pthread_distribute_static_tls method

The method might require resolving and binding symbols, which means
recursing on the bind lock. It is safe to unlock the bind lock,
since we operate on the private object list, and user attempting to
unload an object from the list of not yet fully loaded objects caused
self-inflicted race.

It is similar to how we treat user' init/fini methods.

Reported by: stevek
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <[email protected]>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 1005d3d0 14-Jul-2023 Konstantin Belousov <[email protected]>

rtld: fix dlopen() for an object that is already mapped but not yet initialized

For instance, dso might be mapped as needed but not yet initialized from
the other subtree of needed objects, while cu

rtld: fix dlopen() for an object that is already mapped but not yet initialized

For instance, dso might be mapped as needed but not yet initialized from
the other subtree of needed objects, while current object' constructor
does dlopen() for the dso. Right now rtld does relocations and other
processing based on the arrival of new objects in the global list, which
is not happens there. Directly check for the initialization state of
the object, for which we would return the handle.

One practical use case of this support is e.g. dlopen("libthr.so",
RTLD_NOLOAD) by libraries that are threading-aware but happy to live
with libc pthread shims if the program is not multithreaded.

Reviewed by: tijl
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

show more ...


# f940929d 09-Jul-2023 Jessica Clarke <[email protected]>

rtld-elf: Migrate from COMPAT_32BIT to generic COMPAT_libcompat/LIBCOMPAT

We still have a tiny amount of libcompat-specific code in rtld_paths.h,
but it's been deduplicated as much as possible, and

rtld-elf: Migrate from COMPAT_32BIT to generic COMPAT_libcompat/LIBCOMPAT

We still have a tiny amount of libcompat-specific code in rtld_paths.h,
but it's been deduplicated as much as possible, and in future we may
wish to just push these variables down to the few consumers of them and
make them use the double-underscore variants with a libcompat argument
rather than give them names here.

See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by: kib, brooks, jhb
Differential Revision: https://reviews.freebsd.org/D40925

show more ...


# 38efd4df 20-Jun-2023 John Baldwin <[email protected]>

rtld-elf: Mark tls_init_align __unused in free_tls for Variant I TLS.

Some architectures (powerpc and RISC-V) always use 0 for the post TLS
size in which case tls_init_align isn't used by
calculate_

rtld-elf: Mark tls_init_align __unused in free_tls for Variant I TLS.

Some architectures (powerpc and RISC-V) always use 0 for the post TLS
size in which case tls_init_align isn't used by
calculate_tls_post_size. Use __unused to quiet the warning for these
platforms.

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

show more ...


# e9a38ed2 09-Jun-2023 Konstantin Belousov <[email protected]>

rtld: fix allocate_module_tls() variant I fallback to static allocation

Submitted by: Joerg Sonnenberger
Fixes: 91880e07f605edb90339685bc934699a4344de3bESC
MFC after: 1 week


# 91880e07 05-Jun-2023 Konstantin Belousov <[email protected]>

rtld: do not allow both dynamic DTV index and static TLS offset

If we are allocating static offset for an object with dynamic index,
return failure. In the opposite case, if dynamic index is reques

rtld: do not allow both dynamic DTV index and static TLS offset

If we are allocating static offset for an object with dynamic index,
return failure. In the opposite case, if dynamic index is requested for
statically allocated TLS area, directly use the offset instead of
setting the index.

Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.c
rev. 1.18.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

show more ...


# 283a4f40 05-Jun-2023 Konstantin Belousov <[email protected]>

rtld: rename tls_done to tls_static

The meaning of the flag is that static TLS allocation was done.

Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.c
rev. 1.18.

Sponsored

rtld: rename tls_done to tls_static

The meaning of the flag is that static TLS allocation was done.

Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.c
rev. 1.18.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

show more ...


# 4d846d26 10-May-2023 Warner Losh <[email protected]>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


# 7cdfe51f 13-Apr-2023 Konstantin Belousov <[email protected]>

rtld: fixes for handling of the grouped options

Do not terminate scanning group when 'd' is encountered.
The 'b' option must be last in the group, same as 'f'.

Reviewed by: markj
Sponsored by: The

rtld: fixes for handling of the grouped options

Do not terminate scanning group when 'd' is encountered.
The 'b' option must be last in the group, same as 'f'.

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

show more ...


# 29e3a065 12-Apr-2023 Ed Maste <[email protected]>

rtld: fix SysV hash function overflow

Quoting from https://maskray.me/blog/2023-04-12-elf-hash-function:

The System V Application Binary Interface (generic ABI) specifies the
ELF object file format

rtld: fix SysV hash function overflow

Quoting from https://maskray.me/blog/2023-04-12-elf-hash-function:

The System V Application Binary Interface (generic ABI) specifies the
ELF object file format. When producing an output executable or shared
object needing a dynamic symbol table (.dynsym), a linker generates a
.hash section with type SHT_HASH to hold a symbol hash table. A DT_HASH
tag is produced to hold the address of .hash.

The function is supposed to return a value no larger than 0x0fffffff.
Unfortunately, there is a bug. When unsigned long consists of more than
32 bits, the return value may be larger than UINT32_MAX. For instance,
elf_hash((const unsigned char *)"\xff\x0f\x0f\x0f\x0f\x0f\x12") returns
0x100000002, which is clearly unintended, as the function should behave
the same way regardless of whether long represents a 32-bit integer or
a 64-bit integer.

Reviewed by: kib, Fangrui Song
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39517

show more ...


12345678910>>...19