From 4facca0b0e0c99601673056352cd695102872828 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 13 May 2016 08:29:22 -0700 Subject: Call init_cpu_features only if SHARED is defined In static executable, since init_cpu_features is called early from __libc_start_main, there is no need to call it again in dl_platform_init. [BZ #20072] * sysdeps/i386/dl-machine.h (dl_platform_init): Call init_cpu_features only if SHARED is defined. * sysdeps/x86_64/dl-machine.h (dl_platform_init): Likewise. --- sysdeps/x86_64/dl-machine.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysdeps/x86_64') diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h index 980ca73cf2..ed0c1a8efd 100644 --- a/sysdeps/x86_64/dl-machine.h +++ b/sysdeps/x86_64/dl-machine.h @@ -224,7 +224,11 @@ dl_platform_init (void) /* Avoid an empty string which would disturb us. */ GLRO(dl_platform) = NULL; +#ifdef SHARED + /* init_cpu_features has been called early from __libc_start_main in + static executable. */ init_cpu_features (&GLRO(dl_x86_cpu_features)); +#endif } static inline ElfW(Addr) -- cgit 1.4.1