This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Undefined Reference to dl_iterate_phdr from libgcc_eh.a
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: "abhisekpan at gmail dot com" <abhisekpan at gmail dot com>
- Cc: libc-help at sourceware dot org
- Date: Mon, 1 Oct 2012 09:32:27 -0700
- Subject: Re: Undefined Reference to dl_iterate_phdr from libgcc_eh.a
- References: <CAGhmpEEB7d3D_ZbxzDo1Kiseuk9b2a_TPfLWwPFA=96ukwOc6A@mail.gmail.com>
On Mon, Oct 1, 2012 at 9:18 AM, abhisekpan@gmail.com
<abhisekpan@gmail.com> wrote:
> Interestingly if I use '-static' instead of '-Wl,static' the program
> compiles and I get a static binary.
That's because '-static' is actually a GCC flag (that is also passed on
to the linker). The link command GCC constructs is different when it sees
'-static'.
When you use '-Wl,-static', you are going "behind GCC's back", and changing
what GCC thinks is a dynamic link into a fully static one. Don't do that.
Cheers,
--
Paul Pluzhnikov