1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:27:35 +00:00

Use the entry point address from the ELF header instead of looking up _start.

I love these kind of dumb gotcha moments. Turns out you can find the entry
address right there in the header. :^)
This commit is contained in:
Andreas Kling 2018-12-29 03:28:55 +01:00
parent ab72666f48
commit 46ce47a984
3 changed files with 5 additions and 2 deletions

View file

@ -155,6 +155,8 @@ public:
bool is_executable() const { return header().e_type == ET_EXEC; }
bool is_relocatable() const { return header().e_type == ET_REL; }
LinearAddress entry() const { return LinearAddress(header().e_entry); }
private:
bool parseHeader();
const char* raw_data(unsigned offset) const;