mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +00:00
LibELF: Add a find_symbol() API that finds a Symbol for an address
Also add ELFImage::Symbol::raw_data() to get a StringView containing the entire symbol contents.
This commit is contained in:
parent
31d0dbe2a0
commit
5b91d848a7
4 changed files with 60 additions and 1 deletions
|
@ -414,3 +414,9 @@ bool ELFImage::validate_program_headers(const Elf32_Ehdr& elf_header, size_t fil
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
StringView ELFImage::Symbol::raw_data() const
|
||||
{
|
||||
auto& section = this->section();
|
||||
return { section.raw_data() + (value() - section.address()), size() };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue