2013-03-28 Roland McGrath <roland@hack.frob.com>
+ * elf/dl-support.c (_dl_phdr): Make pointer to const.
+ (_dl_aux_init): Use const in cast when setting it.
+ * sysdeps/mach/hurd/i386/init-first.c (init1): Remove superfluous cast.
+ * sysdeps/generic/ldsodefs.h [!SHARED] (_dl_phdr): Update decl.
+ * csu/libc-tls.c (__libc_setup_tls): Make PHDR pointer to const.
+
* sysdeps/generic/ldsodefs.h [!SHARED] (_dl_phdr, _dl_phnum):
Declare them here.
* elf/dl-iteratephdr.c [!SHARED] (_dl_phdr, _dl_phnum): Not here.
size_t align = 0;
size_t max_align = tcbalign;
size_t tcb_offset;
- ElfW(Phdr) *phdr;
+ const ElfW(Phdr) *phdr;
/* Look through the TLS segment if there is any. */
if (_dl_phdr != NULL)
int _dl_correct_cache_id = _DL_CACHE_DEFAULT_ID;
ElfW(auxv_t) *_dl_auxv;
-ElfW(Phdr) *_dl_phdr;
+const ElfW(Phdr) *_dl_phdr;
size_t _dl_phnum;
uint64_t _dl_hwcap __attribute__ ((nocommon));
GLRO(dl_clktck) = av->a_un.a_val;
break;
case AT_PHDR:
- GL(dl_phdr) = (void *) av->a_un.a_val;
+ GL(dl_phdr) = (const void *) av->a_un.a_val;
break;
case AT_PHNUM:
GL(dl_phnum) = av->a_un.a_val;
#ifndef SHARED
/* dl-support.c defines these and initializes them early on. */
-extern ElfW(Phdr) *_dl_phdr;
+extern const ElfW(Phdr) *_dl_phdr;
extern size_t _dl_phnum;
#endif
the exec server. */
extern const void _start;
const ElfW(Ehdr) *const ehdr = &_start;
- _dl_phdr = (ElfW(Phdr) *) ((const void *) ehdr + ehdr->e_phoff);
+ _dl_phdr = (const void *) ehdr + ehdr->e_phoff;
_dl_phnum = ehdr->e_phnum;
assert (ehdr->e_phentsize == sizeof (ElfW(Phdr)));
#endif