[llvm] [PAC][llvm-readobj][AArch64][ELF] Support `GNU_PROPERTY_AARCH64_FEATURE_PAUTH` (PR #85231)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 23 22:09:34 PDT 2024


================
@@ -5098,6 +5098,86 @@ template <class ELFT> void GNUELFDumper<ELFT>::printAddrsig() {
   }
 }
 
+template <class ELFT>
+static bool printAArch64PAuthABICoreInfo(raw_ostream &OS, uint32_t DataSize,
+                                         ArrayRef<uint8_t> Desc) {
+  OS << "    AArch64 PAuth ABI core info: ";
+  // DataSize - size without padding, Desc.size() - size with padding
+  if (DataSize != 16) {
+    OS << format("<corrupted size: expected 16, got %d>", DataSize);
+    return false;
+  }
+
+  uint64_t Platform =
+      support::endian::read64<ELFT::TargetEndianness>(Desc.data() + 0);
+  uint64_t Version =
+      support::endian::read64<ELFT::TargetEndianness>(Desc.data() + 8);
+
+  std::string PlatformDesc = [Platform]() {
----------------
MaskRay wrote:

Consider `const StringRef` instead of a mutable std::string

https://github.com/llvm/llvm-project/pull/85231


More information about the llvm-commits mailing list