[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
__executable_start (was: [bug #17644] glibc: support for TLS)
From: |
Thomas Schwinge |
Subject: |
__executable_start (was: [bug #17644] glibc: support for TLS) |
Date: |
Sun, 26 May 2013 16:38:23 +0200 |
User-agent: |
Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu) |
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
pgpmFklOv7uiH.pgp
Description: PGP signature
- __executable_start (was: [bug #17644] glibc: support for TLS),
Thomas Schwinge <=