This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Undefined Reference to dl_iterate_phdr from libgcc_eh.a


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]