powerpc: Initialize rtld_global_ro for static dlopen [BZ #20802]
authorTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Fri, 10 Jan 2020 22:14:56 +0000 (19:14 -0300)
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Fri, 17 Jan 2020 12:05:03 +0000 (09:05 -0300)
Initialize dl_auxv, dl_hwcap and dl_hwcap2 in rtld_global_ro for DSOs
that have been statically dlopen'ed.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
sysdeps/unix/sysv/linux/powerpc/dl-static.c

index 48fec16..59ce4e8 100644 (file)
@@ -26,17 +26,26 @@ _dl_var_init (void *array[])
   /* It has to match "variables" below. */
   enum
     {
-      DL_PAGESIZE = 0
+      DL_PAGESIZE = 0,
+      DL_AUXV = 1,
+      DL_HWCAP = 2,
+      DL_HWCAP2 = 3,
     };
 
   GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
+  GLRO(dl_auxv) = (ElfW(auxv_t) *) *((size_t *) array[DL_AUXV]);
+  GLRO(dl_hwcap)  = *((unsigned long int *) array[DL_HWCAP]);
+  GLRO(dl_hwcap2) = *((unsigned long int *) array[DL_HWCAP2]);
 }
 
 #else
 
 static void *variables[] =
 {
-  &GLRO(dl_pagesize)
+  &GLRO(dl_pagesize),
+  &GLRO(dl_auxv),
+  &GLRO(dl_hwcap),
+  &GLRO(dl_hwcap2),
 };
 
 static void