[RFC PATCH 3/3] add r_debug multiple namespaces support

Florian Weimer fweimer@redhat.com
Mon Jun 29 08:51:06 GMT 2020


* Carlos O'Donell via Libc-alpha:

>>> I'm not sure it would work to version _r_debug, since the debugger
>>> is using DT_DEBUG and we only get to put one value in that
>>> .dynamic entry.
>> 
>> The symbol version is needed to avoid problems due to copy relocations
>> if the symbol is referenced directly from the main program.  Without
>> that, the object could be truncated.  It's not a debugger
>> compatibility feature.
>
> Correct, but this violates *how* you're supposed to use _r_debug.

If it is possible to link against it, we need to add the new symbol
version, in my opinion.

> In the dynamic case it is different. The symbol should be looked up
> via DT_DEBUG only which always points to the library-local address
> of the data object (and the most recent version). In effect this
> bypasses the COPY relocation?

How is this supposed to work if the dynamic linker does contain
DT_DEBUG?

I only observe DT_DEBUG in PIE binaries, but since the dynamic loader is
mapped at a random address even for ET_EXEC main programs, there must be
some other mechanism to locate it.

Thanks,
Florian



More information about the Libc-alpha mailing list