bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: __executable_start (was: [bug #17644] glibc: support for TLS)


From: Anatoly A. Kazantsev
Subject: Re: __executable_start (was: [bug #17644] glibc: support for TLS)
Date: Sun, 26 May 2013 22:11:51 +0400

On Sun, 26 May 2013 16:38:23 +0200
Thomas Schwinge <thomas@codesourcery.com> wrote:

> Hi!
> 
> Re-submitting an oldie of Samuel's:
> 
> On Sun, 24 Jun 2007 17:45:35 +0200, Samuel Thibault 
> <samuel.thibault@ens-lyon.org> wrote:
> > - _start points on the first instruction, not on the elf header.
> >   __executable_start does point on the elf header.
> 
> > --- sysdeps/mach/hurd/i386/init-first.c.orig        2007-06-23 
> > 19:27:14.000000000 +0000
> > +++ sysdeps/mach/hurd/i386/init-first.c     2007-06-23 21:41:40.000000000 
> > +0000
> > @@ -116,14 +116,14 @@
> >        /* We may need to see our own phdrs, e.g. for TLS setup.
> >           Try the usual kludge to find the headers without help from
> >      the exec server.  */
> > -      extern const void _start;
> > -      const ElfW(Ehdr) *const ehdr = &_start;
> > +      extern const void __executable_start;
> > +      const ElfW(Ehdr) *const ehdr = &__executable_start;
> >        _dl_phdr = (ElfW(Phdr) *) ((const void *) ehdr + ehdr->e_phoff);
> >        _dl_phnum = ehdr->e_phnum;
> >        assert (ehdr->e_phentsize == sizeof (ElfW(Phdr)));
> 
> This is, as far as I can tell, the only such usage of _start in glibc.
> 
> OK to commit?
> 
>       * sysdeps/mach/hurd/i386/init-first.c (init1): Use
>       __executable_start symbol intsead instead of _start.
> 
> diff --git sysdeps/mach/hurd/i386/init-first.c 
> sysdeps/mach/hurd/i386/init-first.c
> index fc3330c..7031ed4 100644
> --- sysdeps/mach/hurd/i386/init-first.c
> +++ sysdeps/mach/hurd/i386/init-first.c
> @@ -125,8 +125,8 @@ init1 (int argc, char *arg0, ...)
>            /* We may need to see our own phdrs, e.g. for TLS setup.
>               Try the usual kludge to find the headers without help from
>               the exec server.  */
> -          extern const void _start;
> -          const ElfW(Ehdr) *const ehdr = &_start;
> +          extern const void __executable_start;
> +          const ElfW(Ehdr) *const ehdr = &__executable_start;
>            _dl_phdr = (const void *) ehdr + ehdr->e_phoff;
>            _dl_phnum = ehdr->e_phnum;
>            assert (ehdr->e_phentsize == sizeof (ElfW(Phdr)));
> 
> 
> Grüße,
>  Thomas


-- 
Regards,
Anatoly

Attachment: pgp_5QuNVwSSx.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]