diff --git a/llvm/include/llvm/Object/ELFTypes.h b/llvm/include/llvm/Object/ELFTypes.h index 32ad1e4ea40be..d0909f5b88235 100644 --- a/llvm/include/llvm/Object/ELFTypes.h +++ b/llvm/include/llvm/Object/ELFTypes.h @@ -615,6 +615,12 @@ class Elf_Note_Impl { 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; } };