1
Fork 0
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:
Andreas Kling 2020-04-11 18:45:17 +02:00
parent 31d0dbe2a0
commit 5b91d848a7
4 changed files with 60 additions and 1 deletions

View file

@ -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() };
}