summaryrefslogtreecommitdiff
path: root/linker/linker.cpp
diff options
context:
space:
mode:
authorTamas Petz <tamas.petz@arm.com>2020-02-24 14:15:25 +0100
committerRyan Prichard <rprichard@google.com>2020-09-23 17:53:28 -0700
commit8d55d1872a6c7f850a13c59ddaedc813d0bc7e26 (patch)
tree7dc4c724e876d855ce8d1117721566afa4373be8 /linker/linker.cpp
parent0a12075ca48c9bf6fc1a68c0446ac000c07afb42 (diff)
Enable BTI in bionic linker
This patch adds support to load BTI-enabled objects. According to the ABI, BTI is recorded in the .note.gnu.property section. The new parser evaluates the property section, if exists. It searches for .note section with NT_GNU_PROPERTY_TYPE_0. Once found it tries to find GNU_PROPERTY_AARCH64_FEATURE_1_AND. The results are cached. The main change in linker is when protection of loaded ranges gets applied. When BTI is requested and the platform also supports it the prot flags have to be amended with PROT_BTI for executable ranges. Failing to add PROT_BTI flag would disable BTI protection. Moreover, adding the new PROT flag for shared objects without BTI compatibility would break applications. Kernel does not add PROT_BTI to a loaded ELF which has interpreter. Linker handles this case too. Test: 1. Flame boots 2. Tested on FVP with BTI enabled Change-Id: Iafdf223b74c6e75d9f17ca90500e6fe42c4c1218
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r--linker/linker.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 302e4b3f9..77f754cf4 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -3141,6 +3141,14 @@ bool soinfo::prelink_image() {
// resolves everything eagerly, so these can be ignored.
break;
+#if defined(__aarch64__)
+ case DT_AARCH64_BTI_PLT:
+ case DT_AARCH64_PAC_PLT:
+ case DT_AARCH64_VARIANT_PCS:
+ // Ignored: AArch64 processor-specific dynamic array tags.
+ break;
+#endif
+
default:
if (!relocating_linker) {
const char* tag_name;