diff --git a/elf/rtld.c b/elf/rtld.c
index e5ba71fef1..cc813201dc 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1366,6 +1366,7 @@ dl_main (const ElfW(Phdr) *phdr,
 #endif
 
   const char *ld_so_name = _dl_argv[0];
+  GLRO(dl_entry) = *user_entry;
   if (*user_entry == (ElfW(Addr)) ENTRY_POINT)
     {
       /* Ho ho.  We are not the program interpreter!  We are the program
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index f94247ad9f..9bbc9f2c54 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -682,6 +682,10 @@ struct rtld_global_ro
   /* Dynamic linker operations used after static dlopen.  */
   const struct dlfcn_hook *_dl_dlfcn_hook;
 
+  /* Original kernel-provided entry point.  Could be the main program
+     or ld.so itself.  */
+  ElfW(Addr) _dl_entry;
+
   /* List of auditing interfaces.  */
   struct audit_ifaces *_dl_audit;
   unsigned int _dl_naudit;
