Merge "Properly align init/fini_arrays for crtend.o"

This commit is contained in:
Dmitriy Ivanov
2015-05-07 19:55:24 +00:00
committed by Gerrit Code Review
3 changed files with 11 additions and 14 deletions

View File

@@ -28,9 +28,9 @@
#ifdef __LP64__ #ifdef __LP64__
# define ASM_PTR_SIZE(x) .quad x # define ASM_PTR_SIZE(x) .quad x
# define ASM_ALIGN(x) # define ASM_ALIGN_TO_PTR_SIZE .balign 8
#else #else
# define ASM_PTR_SIZE(x) .long x # define ASM_PTR_SIZE(x) .long x
# define ASM_ALIGN(x) .align x # define ASM_ALIGN_TO_PTR_SIZE .balign 4
#endif #endif

View File

@@ -29,12 +29,15 @@
#include "asm_multiarch.h" #include "asm_multiarch.h"
.section .preinit_array, "aw" .section .preinit_array, "aw"
ASM_ALIGN_TO_PTR_SIZE
ASM_PTR_SIZE(0) ASM_PTR_SIZE(0)
.section .init_array, "aw" .section .init_array, "aw"
ASM_ALIGN_TO_PTR_SIZE
ASM_PTR_SIZE(0) ASM_PTR_SIZE(0)
.section .fini_array, "aw" .section .fini_array, "aw"
ASM_ALIGN_TO_PTR_SIZE
ASM_PTR_SIZE(0) ASM_PTR_SIZE(0)
#if defined(__linux__) && defined(__ELF__) #if defined(__linux__) && defined(__ELF__)
@@ -42,7 +45,9 @@
#endif #endif
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
.section .eh_frame,"a",@progbits .section .eh_frame,"a",@progbits
ASM_ALIGN(4) #if defined(__i386__)
.balign 4
#endif
.type __FRAME_END__, @object .type __FRAME_END__, @object
.size __FRAME_END__, 4 .size __FRAME_END__, 4
__FRAME_END__: __FRAME_END__:

View File

@@ -26,22 +26,14 @@
* SUCH DAMAGE. * 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__) #if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits .section .note.GNU-stack,"",%progbits
#endif #endif
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
.section .eh_frame,"a",@progbits .section .eh_frame,"a",@progbits
ASM_ALIGN(4) #if defined(__i386__)
.balign 4
#endif
.type __FRAME_END__, @object .type __FRAME_END__, @object
.size __FRAME_END__, 4 .size __FRAME_END__, 4
__FRAME_END__: __FRAME_END__: