x86: Cleanup cpu-features-offsets.sym

Message ID 20180801152019.17874-1-hjl.tools@gmail.com
State New
Headers show
Series
  • x86: Cleanup cpu-features-offsets.sym
Related show

Commit Message

H.J. Lu Aug. 1, 2018, 3:20 p.m.
Remove the unused macros.  There is no code changes in libc.so nor
ld.so on i686 and x86-64.

	* sysdeps/x86/cpu-features-offsets.sym
	(rtld_global_ro_offsetof): Removed.
	(CPU_FEATURES_SIZE): Likewise.
	(CPUID_OFFSET): Likewise.
	(CPUID_SIZE): Likewise.
	(CPUID_EAX_OFFSET): Likewise.
	(CPUID_EBX_OFFSET): Likewise.
	(CPUID_ECX_OFFSET): Likewise.
	(CPUID_EDX_OFFSET): Likewise.
	(FAMILY_OFFSET): Likewise.
	(MODEL_OFFSET): Likewise.
	(FEATURE_OFFSET): Likewise.
	(FEATURE_SIZ): Likewise.
	(COMMON_CPUID_INDEX_1): Likewise.
	(COMMON_CPUID_INDEX_7): Likewise.
	(FEATURE_INDEX_1): Likewise.
	(RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET): Updated.
---
 sysdeps/x86/cpu-features-offsets.sym | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

-- 
2.17.1

Comments

Florian Weimer Aug. 3, 2018, 12:43 p.m. | #1
On 08/01/2018 05:20 PM, H.J. Lu wrote:
> Remove the unused macros.  There is no code changes in libc.so nor

> ld.so on i686 and x86-64.

> 

> 	* sysdeps/x86/cpu-features-offsets.sym

> 	(rtld_global_ro_offsetof): Removed.

> 	(CPU_FEATURES_SIZE): Likewise.

> 	(CPUID_OFFSET): Likewise.

> 	(CPUID_SIZE): Likewise.

> 	(CPUID_EAX_OFFSET): Likewise.

> 	(CPUID_EBX_OFFSET): Likewise.

> 	(CPUID_ECX_OFFSET): Likewise.

> 	(CPUID_EDX_OFFSET): Likewise.

> 	(FAMILY_OFFSET): Likewise.

> 	(MODEL_OFFSET): Likewise.

> 	(FEATURE_OFFSET): Likewise.

> 	(FEATURE_SIZ): Likewise.

> 	(COMMON_CPUID_INDEX_1): Likewise.

> 	(COMMON_CPUID_INDEX_7): Likewise.

> 	(FEATURE_INDEX_1): Likewise.

> 	(RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET): Updated.


Looks good.  I verified that these macros are indeed unused.

Thanks,
Florian

Patch

diff --git a/sysdeps/x86/cpu-features-offsets.sym b/sysdeps/x86/cpu-features-offsets.sym
index 33dd094e37..6d03cea8e8 100644
--- a/sysdeps/x86/cpu-features-offsets.sym
+++ b/sysdeps/x86/cpu-features-offsets.sym
@@ -2,23 +2,5 @@ 
 
 #include <ldsodefs.h>
 
-#define rtld_global_ro_offsetof(mem) offsetof (struct rtld_global_ro, mem)
-
-RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET rtld_global_ro_offsetof (_dl_x86_cpu_features)
-
-CPU_FEATURES_SIZE	sizeof (struct cpu_features)
-CPUID_OFFSET		offsetof (struct cpu_features, cpuid)
-CPUID_SIZE		sizeof (struct cpuid_registers)
-CPUID_EAX_OFFSET	offsetof (struct cpuid_registers, eax)
-CPUID_EBX_OFFSET	offsetof (struct cpuid_registers, ebx)
-CPUID_ECX_OFFSET	offsetof (struct cpuid_registers, ecx)
-CPUID_EDX_OFFSET	offsetof (struct cpuid_registers, edx)
-FAMILY_OFFSET		offsetof (struct cpu_features, family)
-MODEL_OFFSET		offsetof (struct cpu_features, model)
+RTLD_GLOBAL_RO_DL_X86_CPU_FEATURES_OFFSET offsetof (struct rtld_global_ro, _dl_x86_cpu_features)
 XSAVE_STATE_SIZE_OFFSET	offsetof (struct cpu_features, xsave_state_size)
-FEATURE_OFFSET		offsetof (struct cpu_features, feature)
-FEATURE_SIZE		sizeof (unsigned int)
-
-COMMON_CPUID_INDEX_1
-COMMON_CPUID_INDEX_7
-FEATURE_INDEX_1