mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-26 19:32:06 -05:00
LibELF: Remove unused cruft in ELF::Loader
This commit is contained in:
parent
8d3d0054ed
commit
5bca49162c
2 changed files with 0 additions and 33 deletions
|
@ -137,23 +137,6 @@ bool Loader::layout()
|
||||||
return !failed;
|
return !failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* Loader::symbol_ptr(const char* name) const
|
|
||||||
{
|
|
||||||
char* found_ptr = nullptr;
|
|
||||||
m_image.for_each_symbol([&](const Image::Symbol symbol) {
|
|
||||||
if (symbol.type() != STT_FUNC)
|
|
||||||
return IterationDecision::Continue;
|
|
||||||
if (symbol.name() != name)
|
|
||||||
return IterationDecision::Continue;
|
|
||||||
if (m_image.is_executable())
|
|
||||||
found_ptr = (char*)(size_t)symbol.value();
|
|
||||||
else
|
|
||||||
ASSERT_NOT_REACHED();
|
|
||||||
return IterationDecision::Break;
|
|
||||||
});
|
|
||||||
return found_ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
Optional<Image::Symbol> Loader::find_demangled_function(const String& name) const
|
Optional<Image::Symbol> Loader::find_demangled_function(const String& name) const
|
||||||
{
|
{
|
||||||
Optional<Image::Symbol> found;
|
Optional<Image::Symbol> found;
|
||||||
|
|
|
@ -59,7 +59,6 @@ public:
|
||||||
return m_image.entry();
|
return m_image.entry();
|
||||||
}
|
}
|
||||||
const Image& image() const { return m_image; }
|
const Image& image() const { return m_image; }
|
||||||
char* symbol_ptr(const char* name) const;
|
|
||||||
Optional<Image::Symbol> find_demangled_function(const String& name) const;
|
Optional<Image::Symbol> find_demangled_function(const String& name) const;
|
||||||
|
|
||||||
bool has_symbols() const { return m_symbol_count; }
|
bool has_symbols() const { return m_symbol_count; }
|
||||||
|
@ -71,22 +70,7 @@ private:
|
||||||
explicit Loader(const u8*, size_t, bool verbose_logging);
|
explicit Loader(const u8*, size_t, bool verbose_logging);
|
||||||
|
|
||||||
bool layout();
|
bool layout();
|
||||||
bool perform_relocations();
|
|
||||||
void* lookup(const ELF::Image::Symbol&);
|
|
||||||
char* area_for_section(const ELF::Image::Section&);
|
|
||||||
char* area_for_section_name(const char*);
|
|
||||||
|
|
||||||
struct PtrAndSize {
|
|
||||||
PtrAndSize() {}
|
|
||||||
PtrAndSize(char* p, unsigned s)
|
|
||||||
: ptr(p)
|
|
||||||
, size(s)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
char* ptr { nullptr };
|
|
||||||
unsigned size { 0 };
|
|
||||||
};
|
|
||||||
Image m_image;
|
Image m_image;
|
||||||
|
|
||||||
size_t m_symbol_count { 0 };
|
size_t m_symbol_count { 0 };
|
||||||
|
|
Loading…
Add table
Reference in a new issue