diff options
author | Peter Smith <peter.smith@linaro.org> | 2019-06-04 11:44:33 +0000 |
---|---|---|
committer | Peter Smith <peter.smith@linaro.org> | 2019-06-04 11:44:33 +0000 |
commit | 49d7221f7195d1254366e9eb88a2d610a2277e23 (patch) | |
tree | 6b053d4dfcdba2f9d6cffb5e8faf07325ec868a0 /llvm/lib/Object/ELF.cpp | |
parent | c73c10a9bf1d0fbfb3a78342c64a57267902119e (diff) | |
download | bcm5719-llvm-49d7221f7195d1254366e9eb88a2d610a2277e23.tar.gz bcm5719-llvm-49d7221f7195d1254366e9eb88a2d610a2277e23.zip |
[AArch64][ELF][llvm-readobj] Add support for BTI and PAC dynamic tags
ELF for the 64-bit Arm Architecture defines two processor-specific dynamic
tags:
DT_AARCH64_BTI_PLT 0x70000001, d_val
DT_AARCH64_PAC_PLT 0x70000003, d_val
These presence of these tags indicate that PLT sequences have been
protected using Branch Target Identification and Pointer Authentication
respectively. The presence of both indicates that the PLT sequences have
been protected with both Branch Target Identification and Pointer
Authentication.
This patch adds the tags and tests for llvm-readobj and yaml2obj.
As some of the processor specific dynamic tags overlap, this patch splits
them up, keeping their original default value if they were not previously
mentioned explicitly in a switch case.
Differential Revision: https://reviews.llvm.org/D62596
llvm-svn: 362493
Diffstat (limited to 'llvm/lib/Object/ELF.cpp')
-rw-r--r-- | llvm/lib/Object/ELF.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Object/ELF.cpp b/llvm/lib/Object/ELF.cpp index a9c90e01551..f0ef53d2444 100644 --- a/llvm/lib/Object/ELF.cpp +++ b/llvm/lib/Object/ELF.cpp @@ -434,6 +434,14 @@ std::string ELFFile<ELFT>::getDynamicTagAsString(unsigned Arch, #define DYNAMIC_TAG(n, v) switch (Arch) { + case ELF::EM_AARCH64: + switch (Type) { +#define AARCH64_DYNAMIC_TAG(name, value) DYNAMIC_STRINGIFY_ENUM(name, value) +#include "llvm/BinaryFormat/DynamicTags.def" +#undef AARCH64_DYNAMIC_TAG + } + break; + case ELF::EM_HEXAGON: switch (Type) { #define HEXAGON_DYNAMIC_TAG(name, value) DYNAMIC_STRINGIFY_ENUM(name, value) @@ -461,6 +469,7 @@ std::string ELFFile<ELFT>::getDynamicTagAsString(unsigned Arch, #undef DYNAMIC_TAG switch (Type) { // Now handle all dynamic tags except the architecture specific ones +#define AARCH64_DYNAMIC_TAG(name, value) #define MIPS_DYNAMIC_TAG(name, value) #define HEXAGON_DYNAMIC_TAG(name, value) #define PPC64_DYNAMIC_TAG(name, value) @@ -469,6 +478,7 @@ std::string ELFFile<ELFT>::getDynamicTagAsString(unsigned Arch, #define DYNAMIC_TAG(name, value) DYNAMIC_STRINGIFY_ENUM(name, value) #include "llvm/BinaryFormat/DynamicTags.def" #undef DYNAMIC_TAG +#undef AARCH64_DYNAMIC_TAG #undef MIPS_DYNAMIC_TAG #undef HEXAGON_DYNAMIC_TAG #undef PPC64_DYNAMIC_TAG |