diff options
author | Dmitriy Ivanov <dimitry@google.com> | 2015-05-06 18:49:23 -0700 |
---|---|---|
committer | Dmitriy Ivanov <dimitry@google.com> | 2015-05-07 12:56:15 -0700 |
commit | af7e806cec7088d5d8e9898c13aaa1bbdc07a082 (patch) | |
tree | 89cb7c34f3c8e7bb06a826c7bb7bce9b9d869ce5 | |
parent | b3c01d05387e8576edcb0df1ad80a326d1d3a418 (diff) | |
download | bionic-af7e806cec7088d5d8e9898c13aaa1bbdc07a082.zip bionic-af7e806cec7088d5d8e9898c13aaa1bbdc07a082.tar.gz bionic-af7e806cec7088d5d8e9898c13aaa1bbdc07a082.tar.bz2 |
Properly align init/fini_arrays for crtend.o
Also remove them from crtend_so.o
Bug: http://b/20532404
Change-Id: I56a0f80c4b3a83cf11d28bbf17791ff4ce10c5d2
(cherry picked from commit e543c7612e97c4c0f11143b8fcd2fff46364f936)
-rw-r--r-- | libc/arch-common/bionic/asm_multiarch.h | 4 | ||||
-rw-r--r-- | libc/arch-common/bionic/crtend.S | 7 | ||||
-rw-r--r-- | libc/arch-common/bionic/crtend_so.S | 14 |
3 files changed, 11 insertions, 14 deletions
diff --git a/libc/arch-common/bionic/asm_multiarch.h b/libc/arch-common/bionic/asm_multiarch.h index 85e1b57..91cb8af 100644 --- a/libc/arch-common/bionic/asm_multiarch.h +++ b/libc/arch-common/bionic/asm_multiarch.h @@ -28,9 +28,9 @@ #ifdef __LP64__ # define ASM_PTR_SIZE(x) .quad x -# define ASM_ALIGN(x) +# define ASM_ALIGN_TO_PTR_SIZE .balign 8 #else # define ASM_PTR_SIZE(x) .long x -# define ASM_ALIGN(x) .align x +# define ASM_ALIGN_TO_PTR_SIZE .balign 4 #endif diff --git a/libc/arch-common/bionic/crtend.S b/libc/arch-common/bionic/crtend.S index a4cf8de..87d1120 100644 --- a/libc/arch-common/bionic/crtend.S +++ b/libc/arch-common/bionic/crtend.S @@ -29,12 +29,15 @@ #include "asm_multiarch.h" .section .preinit_array, "aw" + ASM_ALIGN_TO_PTR_SIZE ASM_PTR_SIZE(0) .section .init_array, "aw" + ASM_ALIGN_TO_PTR_SIZE ASM_PTR_SIZE(0) .section .fini_array, "aw" + ASM_ALIGN_TO_PTR_SIZE ASM_PTR_SIZE(0) #if defined(__linux__) && defined(__ELF__) @@ -42,7 +45,9 @@ #endif #if defined(__i386__) || defined(__x86_64__) .section .eh_frame,"a",@progbits - ASM_ALIGN(4) +#if defined(__i386__) + .balign 4 +#endif .type __FRAME_END__, @object .size __FRAME_END__, 4 __FRAME_END__: diff --git a/libc/arch-common/bionic/crtend_so.S b/libc/arch-common/bionic/crtend_so.S index f745109..e7b8cac 100644 --- a/libc/arch-common/bionic/crtend_so.S +++ b/libc/arch-common/bionic/crtend_so.S @@ -26,22 +26,14 @@ * SUCH DAMAGE. */ -#include "asm_multiarch.h" - -#ifndef __arm__ - .section .init_array, "aw" - ASM_PTR_SIZE(0) - - .section .fini_array, "aw" - ASM_PTR_SIZE(0) -#endif - #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits #endif #if defined(__i386__) || defined(__x86_64__) .section .eh_frame,"a",@progbits - ASM_ALIGN(4) +#if defined(__i386__) + .balign 4 +#endif .type __FRAME_END__, @object .size __FRAME_END__, 4 __FRAME_END__: |