diff --git a/llvm/include/llvm/Object/ELFTypes.h b/llvm/include/llvm/Object/ELFTypes.h --- a/llvm/include/llvm/Object/ELFTypes.h +++ b/llvm/include/llvm/Object/ELFTypes.h @@ -615,6 +615,12 @@ Nhdr.n_descsz); } + /// Get the note's descriptor as StringRef + StringRef getDescAsStringRef() const { + auto &Desc = getDesc(); + return StringRef(reinterpret_cast(Desc.data()), Desc.size()); + } + /// Get the note's type. Elf_Word getType() const { return Nhdr.n_type; } };