Page MenuHomeFreeBSD

rtld: introduce STATIC_TLS_EXTRA
ClosedPublic

Authored by stevek on Sep 29 2023, 11:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 14 2024, 9:34 PM
Unknown Object (File)
May 4 2024, 9:16 PM
Unknown Object (File)
May 4 2024, 9:10 PM
Unknown Object (File)
May 4 2024, 4:13 PM
Unknown Object (File)
May 3 2024, 10:15 PM
Unknown Object (File)
Apr 27 2024, 10:40 AM
Unknown Object (File)
Apr 26 2024, 2:55 AM
Unknown Object (File)
Apr 22 2024, 3:10 AM
Subscribers

Details

Summary

The new STATIC_TLS_EXTRA variable provides a means for applications to increases the size of the extra static TLS space allocated by rtld beyond the default of '128'. This extra static TLS space is used for objects loaded with dlopen.

The value specified in the variable must be no less than the default value and no greater than the maximum allowed value for size_t type.

If an invalid value is specified, rtld will ignore it and just use the default value.

The rtld(1) man page is updated to document this new option.

Obtained from: Juniper Networks, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

libexec/rtld-elf/arm/reloc.c
458

Why not have ld_optional_static_tls always valid? Initialize it to RTLD_STATIC_TLS_EXTRA statically, and re-init if the env var is set. Then you do not need these conditional expressions.

Then it is probably more logical to call it ld_static_tls_extra.

libexec/rtld-elf/rtld.c
750

We do not do this, usually we either ignore invalid values or at worst issue a warning. See another comment for this file.

6119–6120

I recommend to print out the static_tls_extra value there.

Made changes per review comments.

This revision is now accepted and ready to land.Oct 30 2023, 12:21 AM

Updated environment variable to match the variables used internally.
Instead of OPTIONAL_STATIC_TLS, the name is now STATIC_TLS_EXTRA.
Updated the man page also.

This revision now requires review to proceed.Oct 30 2023, 1:18 AM

You also need to rename the vars in the summary.

This revision is now accepted and ready to land.Oct 30 2023, 3:35 AM
stevek retitled this revision from rtld: introduce OPTIONAL_STATIC_TLS to rtld: introduce STATIC_TLS_EXTRA.Oct 30 2023, 3:39 AM
stevek edited the summary of this revision. (Show Details)

Updated the review summary from the commit log

In D42025#967445, @kib wrote:

You also need to rename the vars in the summary.

Yes, it seems that "git arc update" doesn't update the summary from the commit log. I just updated the review with the contents of my commit log.

This revision was automatically updated to reflect the committed changes.