mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
arm64: Add Armv8.5-A BTI support to assembly files.
Change-Id: Ic9c2d252829a39b0331e436df16effe7d0607996 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3241142 Commit-Queue: Jonathan Wright <jonathan.wright@arm.com> Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
parent
3b8a7cf594
commit
fe19de6e1d
@ -17,6 +17,7 @@
|
||||
// that symbol to be in the dynamic symbol table.
|
||||
|
||||
#include "util/misc/elf_note_types.h"
|
||||
#include "util/misc/arm64_bti_note.S"
|
||||
|
||||
// namespace crashpad {
|
||||
// CrashpadInfo g_crashpad_info;
|
||||
|
@ -17,6 +17,7 @@
|
||||
// that symbol to be in the dynamic symbol table.
|
||||
|
||||
#include "util/misc/elf_note_types.h"
|
||||
#include "util/misc/arm64_bti_note.S"
|
||||
|
||||
// namespace crashpad {
|
||||
// CrashpadInfo g_test_crashpad_info;
|
||||
|
@ -13,6 +13,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
#include "util/misc/elf_note_types.h"
|
||||
#include "util/misc/arm64_bti_note.S"
|
||||
|
||||
#define NOTE_ALIGN 4
|
||||
.section .note.crashpad.test,"a",%note
|
||||
|
46
util/misc/arm64_bti_note.S
Normal file
46
util/misc/arm64_bti_note.S
Normal file
@ -0,0 +1,46 @@
|
||||
// Copyright 2021 The Crashpad Authors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef CRASHPAD_UTIL_MISC_ARM64_BTI_NOTE_S
|
||||
#define CRASHPAD_UTIL_MISC_ARM64_BTI_NOTE_S
|
||||
|
||||
/* Support macros for the Armv8.5-A Branch Target Identification feature which
|
||||
* requires emitting a .note.gnu.property section with the appropriate
|
||||
* architecture-dependent feature bits set.
|
||||
* Read more: "ELF for the Arm® 64-bit Architecture"
|
||||
*/
|
||||
#if defined(__ARM_FEATURE_BTI_DEFAULT) && (__ARM_FEATURE_BTI_DEFAULT == 1)
|
||||
#define GNU_PROPERTY_AARCH64_BTI (1 << 0) // Has BTI
|
||||
.pushsection .note.gnu.property, "a"
|
||||
.balign 4
|
||||
.long 0x4 /* size of field "GNU" */
|
||||
.long 0x10 /* note descriptor size */
|
||||
.long 0x5 /* type of note descriptor: NT_GNU_PROPERTY_TYPE_0 */
|
||||
.asciz "GNU"
|
||||
.long 0xc0000000 /* GNU_PROPERTY_AARCH64_FEATURE_1_AND */
|
||||
.long 0x4
|
||||
.long GNU_PROPERTY_AARCH64_BTI
|
||||
.long 0x0
|
||||
.popsection
|
||||
#define CRASHPAD_AARCH64_VALID_JUMP_CALL_TARGET bti jc
|
||||
#define CRASHPAD_AARCH64_VALID_CALL_TARGET bti c
|
||||
#define CRASHPAD_AARCH64_VALID_JUMP_TARGET bti j
|
||||
#undef GNU_PROPERTY_AARCH64_BTI
|
||||
#else
|
||||
#define CRASHPAD_AARCH64_VALID_JUMP_CALL_TARGET
|
||||
#define CRASHPAD_AARCH64_VALID_CALL_TARGET
|
||||
#define CRASHPAD_AARCH64_VALID_JUMP_TARGET
|
||||
#endif
|
||||
|
||||
#endif /* CRASHPAD_UTIL_MISC_ARM64_BTI_NOTE_S */
|
@ -12,6 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "util/misc/arm64_bti_note.S"
|
||||
|
||||
// namespace crashpad {
|
||||
// void CaptureContext(ucontext_t* context);
|
||||
// } // namespace crashpad
|
||||
@ -38,6 +40,7 @@
|
||||
|
||||
CAPTURECONTEXT_SYMBOL:
|
||||
CAPTURECONTEXT_SYMBOL2:
|
||||
CRASHPAD_AARCH64_VALID_CALL_TARGET
|
||||
|
||||
#if defined(__i386__)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user