summary refs log tree commit diff
diff options
context:
space:
mode:
authorTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2020-01-10 19:14:56 -0300
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2020-01-17 09:05:03 -0300
commitc908ae0492cb9c68736306e2bceec7244a940568 (patch)
tree85b3c856106a19268dd3c78a21315f04d0cfa724
parentdef9c08c94da60bfb746644d56cffbe7a9de3477 (diff)
downloadglibc-c908ae0492cb9c68736306e2bceec7244a940568.tar.gz
glibc-c908ae0492cb9c68736306e2bceec7244a940568.tar.xz
glibc-c908ae0492cb9c68736306e2bceec7244a940568.zip
powerpc: Initialize rtld_global_ro for static dlopen [BZ #20802]
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>
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/dl-static.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-static.c b/sysdeps/unix/sysv/linux/powerpc/dl-static.c
index 48fec16dca..59ce4e8972 100644
--- a/sysdeps/unix/sysv/linux/powerpc/dl-static.c
+++ b/sysdeps/unix/sysv/linux/powerpc/dl-static.c
@@ -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