This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Static application with --dynamic-list crashes
- From: Florian Weimer <fweimer at redhat dot com>
- To: Alexey Neyman <stilor at att dot net>, libc-alpha at sourceware dot org
- Cc: Gary Benson <gbenson at redhat dot com>
- Date: Thu, 16 Mar 2017 09:31:13 +0100
- Subject: Re: Static application with --dynamic-list crashes
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9E445437F7F
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9E445437F7F
- References: <f497daa8-3fc5-2d80-023e-79be46d5bf52@att.net>
On 03/15/2017 09:08 AM, Alexey Neyman wrote:
The problem I noticed was that in crosstool-ng, when a gdbserver is
linked statically, it requests a strange path as the dynamic linker
(/lib/ld64.so.1). This path is the default in ld when it creates a
dynamically linked application and there was no --dynamic-linker= option
passed in. In this case, the application was linked with "-static
-Wl,--dynamic-list=some.file". With these options, GCC does not pass
--dynamic-linker (because -static is in effect) - but ld thinks it links
a dynamically linked app because of the --dynamic-list.
gdbserver compatibility will be much improved if you dynamically link it
against a really old glibc.
The problem here is that multi-threading support in gdbserver currently
needs loading of the host libthread_db. When linked statically, this
requires the exact same version of glibc (and its libthread_db) against
which gdbserver was linked statically. When gdbserver is linked
dynamically, any version which is not earlier then what gdbserver was
linked against will do instead.
Infinity support may change that, Cc:ing Gary.
So while there might be a glibc bug here, fixing it will not actually
give you a generally usable statically linked gdbserver, I'm afraid.
Thanks,
Florian