1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

LibELF: Remove ELF::Loader and move everyone to ELF::Image

This commit gets rid of ELF::Loader entirely since its very ambiguous
purpose was actually to load executables for the kernel, and that is
now handled by the kernel itself.

This patch includes some drive-by cleanup in LibDebug and CrashDaemon
enabled by the fact that we no longer need to keep the ref-counted
ELF::Loader around.
This commit is contained in:
Andreas Kling 2020-12-25 02:14:56 +01:00
parent 7551a66f73
commit 1e4c010643
24 changed files with 178 additions and 318 deletions

View file

@ -210,6 +210,10 @@ public:
Optional<Symbol> find_demangled_function(const String& name) const;
bool has_symbols() const { return symbol_count(); }
String symbolicate(u32 address, u32* offset = nullptr) const;
Optional<Image::Symbol> find_symbol(u32 address, u32* offset = nullptr) const;
private:
const char* raw_data(unsigned offset) const;
const Elf32_Ehdr& header() const;
@ -227,6 +231,15 @@ private:
bool m_valid { false };
unsigned m_symbol_table_section_index { 0 };
unsigned m_string_table_section_index { 0 };
struct SortedSymbol {
u32 address;
StringView name;
String demangled_name;
Optional<Image::Symbol> symbol;
};
mutable Vector<SortedSymbol> m_sorted_symbols;
};
template<typename F>