From 0e7f8a9e52bac84c69aa2260d2a6356584ff3674 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 20 Aug 2014 13:11:58 -0700 Subject: [PATCH] Simplify _ALIGN_TEXT. Bug: 16872067 Change-Id: I2b622f252c21ce1b344c040f828ab3f4bf9b6c0a --- libc/arch-arm/bionic/sigsetjmp.S | 2 -- libc/arch-arm/include/machine/asm.h | 4 +--- libc/arch-arm64/include/machine/asm.h | 4 +--- libc/arch-mips/include/machine/asm.h | 4 +--- libc/arch-mips64/include/machine/asm.h | 4 +--- libc/arch-x86/include/machine/asm.h | 11 +---------- libc/arch-x86_64/include/machine/asm.h | 9 +-------- libc/private/bionic_asm.h | 2 +- 8 files changed, 7 insertions(+), 33 deletions(-) diff --git a/libc/arch-arm/bionic/sigsetjmp.S b/libc/arch-arm/bionic/sigsetjmp.S index f9e30eed8..6a25a1216 100644 --- a/libc/arch-arm/bionic/sigsetjmp.S +++ b/libc/arch-arm/bionic/sigsetjmp.S @@ -33,8 +33,6 @@ * SUCH DAMAGE. */ -#define _ALIGN_TEXT .align 0 - #include #include diff --git a/libc/arch-arm/include/machine/asm.h b/libc/arch-arm/include/machine/asm.h index 88d16f950..70dbe67f2 100644 --- a/libc/arch-arm/include/machine/asm.h +++ b/libc/arch-arm/include/machine/asm.h @@ -38,9 +38,7 @@ #ifndef _ARM32_ASM_H_ #define _ARM32_ASM_H_ -#ifndef _ALIGN_TEXT -# define _ALIGN_TEXT .align 0 -#endif +#define __bionic_asm_align 0 #undef __bionic_asm_custom_entry #undef __bionic_asm_custom_end diff --git a/libc/arch-arm64/include/machine/asm.h b/libc/arch-arm64/include/machine/asm.h index 31b5c63ea..2bea043e9 100644 --- a/libc/arch-arm64/include/machine/asm.h +++ b/libc/arch-arm64/include/machine/asm.h @@ -38,9 +38,7 @@ #ifndef _AARCH64_ASM_H_ #define _AARCH64_ASM_H_ -#ifndef _ALIGN_TEXT -# define _ALIGN_TEXT .align 0 -#endif +#define __bionic_asm_align 0 #undef __bionic_asm_function_type #define __bionic_asm_function_type %function diff --git a/libc/arch-mips/include/machine/asm.h b/libc/arch-mips/include/machine/asm.h index 5eacde3df..cdc79143a 100644 --- a/libc/arch-mips/include/machine/asm.h +++ b/libc/arch-mips/include/machine/asm.h @@ -28,9 +28,7 @@ #ifndef _MIPS64_ASM_H #define _MIPS64_ASM_H -#ifndef _ALIGN_TEXT -# define _ALIGN_TEXT .align 4 -#endif +#define __bionic_asm_align 4 #undef __bionic_asm_custom_entry #undef __bionic_asm_custom_end diff --git a/libc/arch-mips64/include/machine/asm.h b/libc/arch-mips64/include/machine/asm.h index 5eacde3df..cdc79143a 100644 --- a/libc/arch-mips64/include/machine/asm.h +++ b/libc/arch-mips64/include/machine/asm.h @@ -28,9 +28,7 @@ #ifndef _MIPS64_ASM_H #define _MIPS64_ASM_H -#ifndef _ALIGN_TEXT -# define _ALIGN_TEXT .align 4 -#endif +#define __bionic_asm_align 4 #undef __bionic_asm_custom_entry #undef __bionic_asm_custom_end diff --git a/libc/arch-x86/include/machine/asm.h b/libc/arch-x86/include/machine/asm.h index 672493d5d..943f9dd54 100644 --- a/libc/arch-x86/include/machine/asm.h +++ b/libc/arch-x86/include/machine/asm.h @@ -49,15 +49,6 @@ #define PIC_GOT(x) x@GOT(%ebx) #define PIC_GOTOFF(x) x@GOTOFF(%ebx) -/* let kernels and others override entrypoint alignment */ -#if !defined(_ALIGN_TEXT) && !defined(_KERNEL) -# ifdef _STANDALONE -# define _ALIGN_TEXT .align 1 -# elif defined __ELF__ -# define _ALIGN_TEXT .align 16 -# else -# define _ALIGN_TEXT .align 4 -# endif -#endif +#define __bionic_asm_align 16 #endif /* !_I386_ASM_H_ */ diff --git a/libc/arch-x86_64/include/machine/asm.h b/libc/arch-x86_64/include/machine/asm.h index 06da39aae..28cd08f93 100644 --- a/libc/arch-x86_64/include/machine/asm.h +++ b/libc/arch-x86_64/include/machine/asm.h @@ -40,13 +40,6 @@ #define PIC_PLT(x) x@PLT #define PIC_GOT(x) x@GOTPCREL(%rip) -/* let kernels and others override entrypoint alignment */ -#ifndef _ALIGN_TEXT -# ifdef _STANDALONE -# define _ALIGN_TEXT .align 4 -# else -# define _ALIGN_TEXT .align 16 -# endif -#endif +#define __bionic_asm_align 16 #endif /* !_AMD64_ASM_H_ */ diff --git a/libc/private/bionic_asm.h b/libc/private/bionic_asm.h index 7c2686f38..d53ebbae1 100644 --- a/libc/private/bionic_asm.h +++ b/libc/private/bionic_asm.h @@ -41,7 +41,7 @@ #define ENTRY(f) \ .text; \ .globl f; \ - _ALIGN_TEXT; \ + .align __bionic_asm_align; \ .type f, __bionic_asm_function_type; \ f: \ __bionic_asm_custom_entry(f); \