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 @@ -605,6 +605,12 @@ Nhdr.n_namesz - 1); } + /// 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 descriptor. ArrayRef getDesc() const { if (!Nhdr.n_descsz)