LibELF+Userland: Move a few functions to Elf::Image

These were originally in `readelf`, but they became useful in
`file` as well, so they are now available in Elf::Image with a slightly
revised API.
This commit is contained in:
Valtteri Koskivuori 2021-10-18 02:16:33 +03:00 committed by Andreas Kling
commit d1adf5bc5e
Notes: sideshowbarker 2024-07-18 02:07:30 +09:00
3 changed files with 93 additions and 71 deletions

View file

@ -227,6 +227,10 @@ public:
FlatPtr base_address() const { return (FlatPtr)m_buffer; }
size_t size() const { return m_size; }
static Optional<StringView> object_file_type_to_string(ElfW(Half) type);
static Optional<StringView> object_machine_type_to_string(ElfW(Half) type);
static Optional<StringView> object_abi_type_to_string(Elf_Byte type);
bool has_symbols() const { return symbol_count(); }
#ifndef KERNEL
Optional<Symbol> find_demangled_function(const StringView& name) const;