Update crtbegin.c and crt*.S to support Armv8.5-A BTI am: 18621fb30c

Original change: https://android-review.googlesource.com/c/platform/bionic/+/1418557

Change-Id: I324540c4cc6e0268defa90b0d6b56b1bc1ab2bac
This commit is contained in:
Tamas Petz 2020-09-25 17:03:57 +00:00 committed by Automerger Merge Worker
commit ee3ccc20bc
4 changed files with 19 additions and 1 deletions

View file

@ -49,7 +49,7 @@ __used static void _start_main(void* raw_args) {
#define POST "; .size _start, .-_start"
#if defined(__aarch64__)
__asm__(PRE "mov x0,sp; b _start_main" POST);
__asm__(PRE "/* BTI J */ hint #36; mov x0,sp; b _start_main" POST);
#elif defined(__arm__)
__asm__(PRE "mov r0,sp; b _start_main" POST);
#elif defined(__i386__)

View file

@ -26,6 +26,12 @@
* SUCH DAMAGE.
*/
#if defined(__aarch64__)
#include <private/bionic_asm_arm64.h>
__bionic_asm_custom_note_gnu_section()
#endif
.section .note.android.ident,"a",%note
.balign 4
.type abitag, %object

View file

@ -28,6 +28,12 @@
#include "asm_multiarch.h"
#if defined(__aarch64__)
#include <private/bionic_asm_arm64.h>
__bionic_asm_custom_note_gnu_section()
#endif
.section .preinit_array, "aw"
ASM_ALIGN_TO_PTR_SIZE
ASM_PTR_SIZE(0)

View file

@ -26,6 +26,12 @@
* SUCH DAMAGE.
*/
#if defined(__aarch64__)
#include <private/bionic_asm_arm64.h>
__bionic_asm_custom_note_gnu_section()
#endif
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif