summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-05-13 08:29:22 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-05-13 08:29:33 -0700
commit4facca0b0e0c99601673056352cd695102872828 (patch)
treed46f3d49cf1f31c9bf8087796be4ad89c6b19045 /sysdeps
parent9e4ec3e81614164314bffe648e9446f17adc5fb7 (diff)
downloadglibc-4facca0b0e0c99601673056352cd695102872828.tar.gz
glibc-4facca0b0e0c99601673056352cd695102872828.tar.xz
glibc-4facca0b0e0c99601673056352cd695102872828.zip
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.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/i386/dl-machine.h4
-rw-r--r--sysdeps/x86_64/dl-machine.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h
index 130bcf56a9..4e3968a8aa 100644
--- a/sysdeps/i386/dl-machine.h
+++ b/sysdeps/i386/dl-machine.h
@@ -237,7 +237,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 Elf32_Addr
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)