forked from cloudius-systems/osv
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow running non-PIE executables that do not collide with kernel
This patch provides necessary changes to OSv dynamic linker to allow running non-PIEs (= Position Dependant Executables) as long as they do not collide with kernel. Please note this patch does not fully address issue cloudius-systems#190 though it provides necessary groundwork to fully address it in future. To truly support running unmodified arbitrary non-PIEs (that typically load at 0x400000 = 4th MB) we need to modify OSv to load kernel way higher that 0x200000. There are 2 ways to run non-PIEs with OSv with this patch: 1) Link it by forcing text segment address so it does not collide with kernel using -Wl,-Ttext-segment,0x?????? option. 2) Change kernel_base in OSv makefile to a higher address that makes it not collide with the executable (for example 0xa00000); most non-PIEs by default load at 0x400000 Signed-off-by: Waldemar Kozaczuk <jwkozaczuk@gmail.com>
- Loading branch information
Showing
4 changed files
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <stdio.h> | ||
|
||
int main(){ | ||
printf("Hello from C code\n"); | ||
return 0; | ||
} |