On Fri, Sep 14, 2012 at 05:12:19AM -0700, H.J. Lu wrote: > On Fri, Sep 14, 2012 at 2:41 AM, Jakub Jelinek <ja...@redhat.com> wrote: > > Well, there is. For more than 2 years after the addition of --eh-frame-hdr > > support dl_iterate_phdr in libc.a would simply always fail, you aren't > > adding any kind of check that old glibc (2001-2003ish) isn't used. > > Even in newer glibcs, it relies on AT_* aux vector values provided by the > > kernel, if they are not provided for whatever reason, it would fail.
> It was implemented in > > http://sourceware.org/ml/libc-alpha/2003-10/msg00098.html > > for glibc 2.3.0 and we can check Yeah, I know, but that is still later than 2001 when it was implemented for dynamically linked executables. USE_PT_GNU_EH_FRAME is defined even for glibc 2.2.something (if DT_CONFIG macro is defined in headers). > AT_PHDR: 0x400040 > AT_PHNUM: 10 > > with LD_SHOW_AUXV. I was worried about some loaders that wouldn't pass the aux vector down. E.g. valgrind's loader does, but perhaps others wouldn't need to. Anyway, IMHO statically linked binaries aren't something one should spend too much time on, they shouldn't be used (with very few exceptions) at all. Jakub