On all platforms but Linux, no bootstrap is used. And in fact using the Windows loader on Linux will not use any bootstrap.
Maybe I'm wrong, but I suspect the bootstrap is there because we need to reserve some memory before the ld loader does some stuff.
But if the loader is statically compiled, the ld loader will do nothing.
In my branches I investigated building a static loader, but this was only on purpose to be able to redistribute a loader without libs (to make armhf multiarch works out of the box, this would also help box64 to not bundle libs). This was not done to remove the bootstrap, and unfortunately on arm, the bootstrap fails to load the static loader.
Now, if using a static loader removes the need for a bootstrap, then we don't have to care about the bootstrap not loading a static loader.
So:
- is this true we don't need a bootstrap if the loader is fully static ?
- do we need the loader to be a dynamic executable ?
On Linux it's common practice to dynamically link binaries because the glibc loads stuff at runtime. But maybe we don't need what glibc loads at runtime to begin with.
On all platforms but Linux, no bootstrap is used. And in fact using the Windows loader on Linux will not use any bootstrap.
Maybe I'm wrong, but I suspect the bootstrap is there because we need to reserve some memory before the ld loader does some stuff.
But if the loader is statically compiled, the ld loader will do nothing.
In my branches I investigated building a static loader, but this was only on purpose to be able to redistribute a loader without libs (to make armhf multiarch works out of the box, this would also help box64 to not bundle libs). This was not done to remove the bootstrap, and unfortunately on arm, the bootstrap fails to load the static loader.
Now, if using a static loader removes the need for a bootstrap, then we don't have to care about the bootstrap not loading a static loader.
So:
On Linux it's common practice to dynamically link binaries because the glibc loads stuff at runtime. But maybe we don't need what glibc loads at runtime to begin with.