LibELF: Move validation methods to their own file

These validate_elf_* methods really had no business being static
methods of ELF::Image. Now that the ELF namespace exists, it makes
sense to just move them to be free functions in the namespace.
This commit is contained in:
Andrew Kaster 2020-04-11 12:32:38 -06:00 committed by Andreas Kling
commit 61acca223f
Notes: sideshowbarker 2024-07-19 07:42:04 +09:00
7 changed files with 234 additions and 163 deletions

View file

@ -203,9 +203,6 @@ public:
VirtualAddress entry() const { return VirtualAddress(header().e_entry); }
static bool validate_elf_header(const Elf32_Ehdr& elf_header, size_t file_size);
static bool validate_program_headers(const Elf32_Ehdr& elf_header, size_t file_size, u8* buffer, size_t buffer_size, String& interpreter_path);
private:
bool parse_header();
const char* raw_data(unsigned offset) const;