diff options
Diffstat (limited to 'elf/rtld.c')
-rw-r--r-- | elf/rtld.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -428,7 +428,6 @@ static ElfW(Addr) _dl_start_final (void *arg, /* These are defined magically by the linker. */ extern const ElfW(Ehdr) __ehdr_start attribute_hidden; -extern char _etext[] attribute_hidden; extern char _end[] attribute_hidden; @@ -477,8 +476,10 @@ _dl_start_final (void *arg, struct dl_start_final_info *info) #endif _dl_setup_hash (&_dl_rtld_map); _dl_rtld_map.l_real = &_dl_rtld_map; - _dl_rtld_map.l_map_start = (ElfW(Addr)) &__ehdr_start; - _dl_rtld_map.l_map_end = (ElfW(Addr)) _end; + _dl_rtld_map.l_map_start + = (ElfW(Addr)) DL_ADDRESS_WITHOUT_RELOC (&__ehdr_start); + _dl_rtld_map.l_map_end + = (ElfW(Addr)) DL_ADDRESS_WITHOUT_RELOC (_end); /* Copy the TLS related data if necessary. */ #ifndef DONT_USE_BOOTSTRAP_MAP # if NO_TLS_OFFSET != 0 @@ -1622,9 +1623,9 @@ dl_main (const ElfW(Phdr) *phdr, bool has_interp = rtld_setup_main_map (main_map); - if ((__glibc_unlikely (GL(dl_stack_flags)) & PF_X) - && TUNABLE_GET (glibc, rtld, execstack, int32_t, NULL) == 0) - _dl_fatal_printf ("Fatal glibc error: executable stack is not allowed\n"); + /* Handle this after PT_GNU_STACK parse, because it updates dl_stack_flags + if required. */ + _dl_handle_execstack_tunable (); /* If the current libname is different from the SONAME, add the latter as well. */ |