diff --git a/api/python/src/ELF/objects/pyNote.cpp b/api/python/src/ELF/objects/pyNote.cpp index d83ca0e3e8..80234b4af0 100644 --- a/api/python/src/ELF/objects/pyNote.cpp +++ b/api/python/src/ELF/objects/pyNote.cpp @@ -150,8 +150,7 @@ void create(nb::module_& m) { .def_prop_rw("description", [] (const Note& self) { - const std::vector& content = self.description(); - return nb::memoryview::from_memory(content.data(), content.size()); + return nb::to_memoryview(self.description()); }, nb::overload_cast(&Note::description), "Return the description associated with the note"_doc) diff --git a/include/LIEF/ELF/Note.hpp b/include/LIEF/ELF/Note.hpp index aa20512a94..5fdfb9e60b 100644 --- a/include/LIEF/ELF/Note.hpp +++ b/include/LIEF/ELF/Note.hpp @@ -23,6 +23,7 @@ #include "LIEF/Object.hpp" #include "LIEF/visibility.h" #include "LIEF/errors.hpp" +#include "LIEF/span.hpp" #include "LIEF/ELF/enums.hpp" @@ -185,11 +186,11 @@ class LIEF_API Note : public Object { } //! Return the description associated with the note - const description_t& description() const { + span description() const { return description_; } - description_t& description() { + span description() { return description_; } diff --git a/include/LIEF/ELF/SysvHash.hpp b/include/LIEF/ELF/SysvHash.hpp index 57b9e77066..78b6ea5605 100644 --- a/include/LIEF/ELF/SysvHash.hpp +++ b/include/LIEF/ELF/SysvHash.hpp @@ -67,7 +67,6 @@ class LIEF_API SysvHash : public Object { chains_.resize(nb); } - void accept(Visitor& visitor) const override; LIEF_API friend std::ostream& operator<<(std::ostream& os, const SysvHash& sysvhash); diff --git a/src/ELF/ExeLayout.hpp b/src/ELF/ExeLayout.hpp index 8c390107e5..ded16f2d09 100644 --- a/src/ELF/ExeLayout.hpp +++ b/src/ELF/ExeLayout.hpp @@ -223,7 +223,7 @@ class LIEF_LOCAL ExeLayout : public Layout { raw_notes.align(sizeof(uint32_t), 0); // description content (manipulated in 4 byte/uint32_t chunks) - const std::vector& description = note.description(); + span description = note.description(); const auto* desc_ptr = reinterpret_cast(description.data()); size_t i = 0; for (; i < description.size() / sizeof(uint32_t); i++) {