From: Mark Seaborn Date: Thu, 28 Jan 2010 16:17:04 +0000 (+0000) Subject: ld.so: Don't try to read own ELF headers on startup X-Git-Url: https://repo.or.cz/w/glibc/nacl-glibc.git/commitdiff_plain/914487dafeb63420263d94ed22af2cc0f4fdf023 ld.so: Don't try to read own ELF headers on startup The ELF headers will not be mapped under NaCl. This means the RELRO feature won't work on ld.so. It will likely break dl_iterate_phdr() too. --- diff --git a/elf/rtld.c b/elf/rtld.c index cb70ee4374..de90298132 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -1407,6 +1407,7 @@ of this helper program; chances are you did not intend to run this program.\n\ /* Set up the program header information for the dynamic linker itself. It is needed in the dl_iterate_phdr() callbacks. */ +#ifndef __native_client__ ElfW(Ehdr) *rtld_ehdr = (ElfW(Ehdr) *) GL(dl_rtld_map).l_map_start; ElfW(Phdr) *rtld_phdr = (ElfW(Phdr) *) (GL(dl_rtld_map).l_map_start + rtld_ehdr->e_phoff); @@ -1423,6 +1424,7 @@ of this helper program; chances are you did not intend to run this program.\n\ GL(dl_rtld_map).l_relro_size = rtld_phdr[cnt].p_memsz; break; } +#endif /* Add the dynamic linker to the TLS list if it also uses TLS. */ if (GL(dl_rtld_map).l_tls_blocksize != 0)