libdl support for base image TLS variables

Chris Johns chrisj at rtems.org
Thu Aug 17 02:29:28 UTC 2023


On 17/8/2023 11:57 am, Joel Sherrill wrote:
> On Wed, Aug 16, 2023, 8:30 PM Chris Johns <chrisj at rtems.org
> <mailto:chrisj at rtems.org>> wrote:
> 
>     On 17/8/2023 6:34 am, Gedare Bloom wrote:
>     > On Mon, Aug 14, 2023 at 10:05 PM <chrisj at rtems.org
>     <mailto:chrisj at rtems.org>> wrote:
>     >>
>     >> These patches add support to rtems.git and rtems-tools.git to
>     >> provide access to TLS variables in the base from loaded code.
>     >> The changes contain the ground work to resolving #4920 which is
>     >> a blocker for the release of 6.
>     >>
>     >> This change is required due to the regression in libdl due to the
>     >> change in newlib to use TLS variables for reneterant data.
>     >>
>     >> The rtems.git patch can be applied before the rtems-tools.git
>     >> patch. If the tools are updated and the libdl code is not present
>     >> the tests fail with linker errors. If the tools change is
>     >> not present the test will link but it will continue to fail.
>     >>
>     >> The currently supported archs that build are:
>     >>
>     >>  - aarch64
>     >>  - arm
>     >>  - powerpc
>     >>  - sparc
>     >>
>     >> The follow are to be completed and do not build:
>     >>
>     >>  - bfin
>     >>  - i386
>     >>  - lm32
>     >>  - m68k
>     >>  - mips
>     >>  - moxie
>     >>  - riscv
>     >>  - v850
>     >>
>     >> We need to add support for these architectures if they support TLS.
>     >>
>     > We are deprecating v850. It might be worth considering whether some of
>     > these other architectures should also be deprecated, especially if no
>     > one is able/willing to add TLS for them.
> 
>     From Joel's comments on #4920 some have TLS but the newlib support has not been
>     updated. Newlib TLS support for reent is a nice and welcomed feature but not
>     having newlib TLS support means the arch is performing as before.
> 
> Is TLS off on some architectures?

I do not know.

> Is that a column missing in the table I added?

I suggest that becomes a different thread so the topic is not lost here.

>     The other TSL issue is gdb is broken. If you attempt to print errno you will be
>     told TLS is not supported by gdb for this OS.
> 
> That seems harder. 

I do not know how this fixed. It only showed up after the newlib switch
happened. That was July 2022 so we have to fix gdb to have it resolved as
winding back the newlib change is now not possible.

>     A review of archs should happen before 6 is released so we can indicate which we
>     will remove for 7. What have we indicated is to be removed in 7?
> 
>  SH, v850, and sparc64.
> 

I suggest new thread so this is not lost in this one.

Chris


More information about the devel mailing list