global pointer gets overwritten with dlopen(3) on RISC-V

Palmer Dabbelt palmer@dabbelt.com
Wed May 17 00:11:00 GMT 2023


On Tue, 16 May 2023 00:59:51 PDT (-0700), szabolcs.nagy@arm.com wrote:
> The 05/16/2023 08:53, Lukasz Stelmach via Binutils wrote:
>> No, the file we dlopen is an executable meant to work standalone. We
>> dlopen it for testing and this setup has worked for us on different
>> platforms (armv7l, aarch64, x86). We MAY have not encoutered an error
>
> it is guaranteed broken on all those targets if the exe has
> local exec TLS access. (initial exec TLS is broken too but
> you may get lucky with that)
>
> i think you can get into trouble with interposition, copy
> relocs or canonical plts too.
>
> but even if everything happens to work, it is just bad
> design: it relies on implementation internals instead of
> documented interfaces.

OK, so sounds like this just isn't a bug.  It's oddly similar to the 
other half of this thread: users are relying on carefully constructing 
binaries to work, but that relies on unspecified behavior and thus isn't 
supportable.

>> because our glibc has been patched. I have to investigate the details as
>> Florian brough it to our attention that an error should be reported.


More information about the Binutils mailing list