@lofty @eniko Loading a static PIE executable (no dynamic library dependencies) isn’t actually that much code
-
@lofty @eniko Loading a static PIE executable (no dynamic library dependencies) isn’t actually that much code
-
-
Eniko | Kitsune Tails out now!replied to Erin 💽✨ last edited by
@erincandescent @lofty i'm not really intimidated by reading binary formats, i'm intimidated by the lack of information on how to support running a PIE on a custom kernel >_> like i get the theory and i can parse a binary format but that doesn't mean i understand what a kernel needs to be able to successfully run a PIE
meanwhile there's lots of information available on MMUs. it looks like a pain in the ass to implement, but at least there's enough information out there that i understand what's required
-
Erin 💽✨replied to Eniko | Kitsune Tails out now! last edited by
@eniko @lofty yeah, its not well documented from a “this is how you implement a loader” POV (I guess people expect that every loader you will ever need has been written…)
For ELF PIE its just
- Read the header
- Read the program headers, which tell you what to load (and at what relative offsets to each other)
- Find the relocation information (in REL or RELA formats) in the DYNamic table
- Apply said relocation information to the binary
- Jump to the entry point with whatever parameters you want setup
-
Eniko | Kitsune Tails out now!replied to Erin 💽✨ last edited by
@erincandescent @lofty how do you figure out how much memory to allocate for the executable? since without paging it has to all be in one contiguous block of memory
or are you just supposed to guess?
-
Erin 💽✨replied to Eniko | Kitsune Tails out now! last edited by