aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ELF.cpp
diff options
context:
space:
mode:
authorMitch Phillips <31459023+hctim@users.noreply.github.com>2023-04-12 10:08:40 -0700
committerMitch Phillips <31459023+hctim@users.noreply.github.com>2023-04-12 10:24:13 -0700
commit7c1a6319ca03298b5d76af6a814178bafe9f2eba (patch)
treeddfd13794a5d605fd84f9437239fb0cf5716d258 /llvm/lib/Object/ELF.cpp
parent37047523a9fb5ffa74eaf94d9d52db831f99c062 (diff)
downloadllvm-7c1a6319ca03298b5d76af6a814178bafe9f2eba.zip
llvm-7c1a6319ca03298b5d76af6a814178bafe9f2eba.tar.gz
llvm-7c1a6319ca03298b5d76af6a814178bafe9f2eba.tar.bz2
[MTE] [llvm-readobj] Add globals section parsing to --memtag
Global variables are described in a metadata table called SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC. It's basically a ULEB-encoded skip list with some other fancy encoding tricks to make it smaller. You can see the ABI at https://github.com/ARM-software/abi-aa/blob/main/memtagabielf64/memtagabielf64.rst#83encoding-of-sht_aarch64_memtag_globals_dynamic This extends readelf/readobj to understand these sections. Reviewed By: pcc, MaskRay, jhenderson Differential Revision: https://reviews.llvm.org/D145761
Diffstat (limited to 'llvm/lib/Object/ELF.cpp')
-rw-r--r--llvm/lib/Object/ELF.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Object/ELF.cpp b/llvm/lib/Object/ELF.cpp
index 715cb5c..b9e7384 100644
--- a/llvm/lib/Object/ELF.cpp
+++ b/llvm/lib/Object/ELF.cpp
@@ -270,6 +270,11 @@ StringRef llvm::object::getELFSectionTypeName(uint32_t Machine, unsigned Type) {
case ELF::EM_RISCV:
switch (Type) { STRINGIFY_ENUM_CASE(ELF, SHT_RISCV_ATTRIBUTES); }
break;
+ case ELF::EM_AARCH64:
+ switch (Type) {
+ STRINGIFY_ENUM_CASE(ELF, SHT_AARCH64_MEMTAG_GLOBALS_DYNAMIC);
+ STRINGIFY_ENUM_CASE(ELF, SHT_AARCH64_MEMTAG_GLOBALS_STATIC);
+ }
default:
break;
}