about summary refs log tree commit diff
path: root/misc
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-04-10 23:58:43 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-04-10 23:58:43 +0200
commit0cdc5e930a95ca2ec3f2fd9327da93a2fbaf8e97 (patch)
tree9c79540ab9ed15bd7ff9c1276ee0390de25656b6 /misc
parent5057feffccb8970585e63b336e13fc878803af02 (diff)
downloadglibc-0cdc5e930a95ca2ec3f2fd9327da93a2fbaf8e97.tar.gz
glibc-0cdc5e930a95ca2ec3f2fd9327da93a2fbaf8e97.tar.xz
glibc-0cdc5e930a95ca2ec3f2fd9327da93a2fbaf8e97.zip
Fix crash on getauxval call without HAVE_AUX_VECTOR
	* sysdeps/generic/ldsodefs.h (struct rtld_global_ro)
	[!HAVE_AUX_VECTOR]: Do not define _dl_auxv field.
	* misc/getauxval.c (__getauxval) [!HAVE_AUX_VECTOR]: Do not go through
	GLRO(dl_auxv) list.
Diffstat (limited to 'misc')
-rw-r--r--misc/getauxval.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/misc/getauxval.c b/misc/getauxval.c
index e48f40f66d..61113766da 100644
--- a/misc/getauxval.c
+++ b/misc/getauxval.c
@@ -30,9 +30,11 @@ __getauxval (unsigned long int type)
   else if (type == AT_HWCAP2)
     return GLRO(dl_hwcap2);
 
+#ifdef HAVE_AUX_VECTOR
   for (p = GLRO(dl_auxv); p->a_type != AT_NULL; p++)
     if (p->a_type == type)
       return p->a_un.a_val;
+#endif
 
   __set_errno (ENOENT);
   return 0;