From 6d10bcb71118b336a721838736195cc417a39165 Mon Sep 17 00:00:00 2001 From: Georgia Kouveli Date: Tue, 17 Nov 2020 11:58:44 +0000 Subject: [PATCH] [arm64] Mark embedded builtins as supporting BTI Use the recently added -mmark-bti-property Clang flag to add GNU_PROPERTY_AARCH64_FEATURE_1_BTI to the ELF GNU program properties. Bug: v8:10026 Change-Id: Id35a60c9f5a8b3019313d56a142ab8f481e095a5 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2543934 Reviewed-by: Ross McIlroy Commit-Queue: Georgia Kouveli Cr-Commit-Position: refs/heads/master@{#71240} --- BUILD.gn | 1 + .../embedded/platform-embedded-file-writer-generic.cc | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index d5e9df3a81..5f96622f7b 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -721,6 +721,7 @@ config("toolchain") { # TODO(v8:10026): Enable this in src/build. if (current_cpu == "arm64") { cflags += [ "-mbranch-protection=standard" ] + asmflags = [ "-mmark-bti-property" ] } } } diff --git a/src/snapshot/embedded/platform-embedded-file-writer-generic.cc b/src/snapshot/embedded/platform-embedded-file-writer-generic.cc index 8acfd0d176..e2d5dcb41c 100644 --- a/src/snapshot/embedded/platform-embedded-file-writer-generic.cc +++ b/src/snapshot/embedded/platform-embedded-file-writer-generic.cc @@ -124,9 +124,7 @@ void PlatformEmbeddedFileWriterGeneric::DeclareFunctionBegin(const char* name, void PlatformEmbeddedFileWriterGeneric::DeclareFunctionEnd(const char* name) {} -void PlatformEmbeddedFileWriterGeneric::FilePrologue() { - // TODO(v8:10026): Add ELF note required for BTI. -} +void PlatformEmbeddedFileWriterGeneric::FilePrologue() {} void PlatformEmbeddedFileWriterGeneric::DeclareExternalFilename( int fileid, const char* filename) {