Skip to content

Commit 04aaa12

Browse files
Andrew HsiehGerrit Code Review
authored andcommitted
Merge "Fix end pointer size/alignment of crtend_* for mips64 and x86_64"
2 parents f89ee85 + ece719c commit 04aaa12

File tree

8 files changed

+107
-15
lines changed

8 files changed

+107
-15
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../arch-mips64/libr6
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (C) 2013 The Android Open Source Project
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions
7+
* are met:
8+
* * Redistributions of source code must retain the above copyright
9+
* notice, this list of conditions and the following disclaimer.
10+
* * Redistributions in binary form must reproduce the above copyright
11+
* notice, this list of conditions and the following disclaimer in
12+
* the documentation and/or other materials provided with the
13+
* distribution.
14+
*
15+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18+
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21+
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22+
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23+
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26+
* SUCH DAMAGE.
27+
*/
28+
29+
#ifdef __LP64__
30+
# define ASM_PTR_SIZE(x) .quad x
31+
# define ASM_ALIGN_TO_PTR_SIZE .balign 8
32+
#else
33+
# define ASM_PTR_SIZE(x) .long x
34+
# define ASM_ALIGN_TO_PTR_SIZE .balign 4
35+
#endif
36+

ndk/platforms/android-21/arch-mips64/src/crtend_android.S

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,30 @@
2525
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2626
* SUCH DAMAGE.
2727
*/
28-
28+
29+
#include "asm_multiarch.h"
30+
2931
.section .preinit_array, "aw"
30-
.long 0
32+
ASM_ALIGN_TO_PTR_SIZE
33+
ASM_PTR_SIZE(0)
3134

3235
.section .init_array, "aw"
33-
.long 0
36+
ASM_ALIGN_TO_PTR_SIZE
37+
ASM_PTR_SIZE(0)
3438

3539
.section .fini_array, "aw"
36-
.long 0
40+
ASM_ALIGN_TO_PTR_SIZE
41+
ASM_PTR_SIZE(0)
3742

3843
.section .ctors, "aw"
3944
.type __CTOR_END__, @object
4045
__CTOR_END__:
41-
.long 0
46+
ASM_PTR_SIZE(0)
4247

4348
.section .dtors, "aw"
4449
.type __DTOR_END__, @object
4550
__DTOR_END__:
46-
.long 0
51+
ASM_PTR_SIZE(0)
4752

4853
.section .eh_frame,"a",@progbits
4954
.align 4
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
#include "asm_multiarch.h"
2+
13
.section .init_array, "aw"
2-
.long 0
4+
ASM_ALIGN_TO_PTR_SIZE
5+
ASM_PTR_SIZE(0)
36

47
.section .fini_array, "aw"
5-
.long 0
8+
ASM_ALIGN_TO_PTR_SIZE
9+
ASM_PTR_SIZE(0)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (C) 2013 The Android Open Source Project
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions
7+
* are met:
8+
* * Redistributions of source code must retain the above copyright
9+
* notice, this list of conditions and the following disclaimer.
10+
* * Redistributions in binary form must reproduce the above copyright
11+
* notice, this list of conditions and the following disclaimer in
12+
* the documentation and/or other materials provided with the
13+
* distribution.
14+
*
15+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18+
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21+
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22+
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23+
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26+
* SUCH DAMAGE.
27+
*/
28+
29+
#ifdef __LP64__
30+
# define ASM_PTR_SIZE(x) .quad x
31+
# define ASM_ALIGN_TO_PTR_SIZE .balign 8
32+
#else
33+
# define ASM_PTR_SIZE(x) .long x
34+
# define ASM_ALIGN_TO_PTR_SIZE .balign 4
35+
#endif
36+

ndk/platforms/android-9/arch-x86/src/crtend.S

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
#include "asm_multiarch.h"
2+
13
.section .preinit_array, "aw"
2-
.long 0
4+
ASM_ALIGN_TO_PTR_SIZE
5+
ASM_PTR_SIZE(0)
36

47
.section .init_array, "aw"
5-
.long 0
8+
ASM_ALIGN_TO_PTR_SIZE
9+
ASM_PTR_SIZE(0)
610

711
.section .fini_array, "aw"
8-
.long 0
12+
ASM_ALIGN_TO_PTR_SIZE
13+
ASM_PTR_SIZE(0)
914

1015
.section .eh_frame,"a",@progbits
1116
.align 4

ndk/platforms/android-9/arch-x86/src/crtend_so.S

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
.section .init_array, "aw"
2-
.long 0
1+
#include "asm_multiarch.h"
32

4-
.section .fini_array, "aw"
5-
.long 0
3+
.section .init_array, "aw"
4+
ASM_ALIGN_TO_PTR_SIZE
5+
ASM_PTR_SIZE(0)
6+
7+
.section .fini_array, "aw"
8+
ASM_ALIGN_TO_PTR_SIZE
9+
ASM_PTR_SIZE(0)
610

711
.section .eh_frame,"a",@progbits
812
.align 4

0 commit comments

Comments
 (0)