This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: PATCH: PR debug/54568: --eh-frame-hdr should also be enabled for static executable


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 <jakub@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


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