This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] x32: Set GLRO(dl_platform) to "x86_64" by default [BZ #22363]
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Sun, 29 Oct 2017 14:15:41 -0700
- Subject: [PATCH] x32: Set GLRO(dl_platform) to "x86_64" by default [BZ #22363]
- Authentication-results: sourceware.org; auth=none
Set dl_platform to "x86_64" for x32 by default since kernel may set it
to "i686". This fixed:
FAIL: elf/tst-platform-1
on x32. Tested on x86-64 and x32.
Any comments?
H.J.
---
[BZ #22363]
* sysdeps/x86/cpu-features.c (init_cpu_features): Set
GLRO(dl_platform) to "x86_64" by default for x32.
---
sysdeps/x86/cpu-features.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 87aaa8683c..0ca29365ef 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -430,6 +430,11 @@ no_cpuid:
if (platform != NULL)
GLRO(dl_platform) = platform;
+# ifdef __ILP32__
+ /* Set dl_platform to "x86_64" since kernel may set it to "i686". */
+ else
+ GLRO(dl_platform) = "x86_64";
+# endif
}
#else
GLRO(dl_hwcap) = 0;
--
2.13.6