Question regarding WAIT_FOR_DEBUGGER and PIE
Stefan Liebler
stli@linux.ibm.com
Fri Oct 20 17:20:39 GMT 2023
On 20.10.23 15:49, Adhemerval Zanella Netto wrote:
>
>
> On 20/10/23 09:27, Florian Weimer wrote:
>> * Stefan Liebler:
>>
>>> If I configure with --disable-default-pie, the test binaries are build
>>> as non-PIE and I can use this WAIT_FOR_DEBUGGER mechanism.
>>>
>>> Do you also see those issues? Or is it some quirk on my s390x machines?
>>> Is the written gdb-script incomplete?
>>> Or is this a gdb bug?
>>
>> Does the issue go away with --enable-hardcoded-path-in-tests?
>>
>> I think ld.so debugging with GDB regressed pretty badly once we started
>> setting l_name of the main link map to "" for explicit ld.so
>> invocations. Previously, it used to the full path to the main
>> executable.
>
> It seems so, with --disable-hardcoded-path-in-tests the WAIT_FOR_DEBUGGER
> works on both x86_64 and aarch64. The l_name change was done by 23d2e5faf0,
> maybe we can do otherwise and pass the program path on loader invocation.
> For Linux it would require a readlink ("proc/self/exe", ...), but since
> ld.so directly invocation is not the common case I think it should be
> doable.
Yes, for me it also works with --enable-hardcoded-path-in-tests.
More information about the Libc-alpha
mailing list