summaryrefslogtreecommitdiff
path: root/src/user/app/init
diff options
context:
space:
mode:
authordzwdz2022-07-26 22:40:28 +0200
committerdzwdz2022-07-26 22:40:28 +0200
commit4aee2f759ab7bf2ad9534941afef0195040ba5db (patch)
tree8799d4dac4bd82cc2274e4a8246e6891356b1511 /src/user/app/init
parentd54dcb2efc4be344900a7721ac4b65b47840c5d2 (diff)
user/libc: a _start that automatically selfrelocates PIEs
Diffstat (limited to 'src/user/app/init')
-rw-r--r--src/user/app/init/main.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/user/app/init/main.c b/src/user/app/init/main.c
index 426933f..788fd78 100644
--- a/src/user/app/init/main.c
+++ b/src/user/app/init/main.c
@@ -11,10 +11,7 @@
__attribute__((visibility("hidden")))
extern char _image_base[];
-__attribute__((section(".text.startup")))
int main(void) {
- elf_selfreloc();
-
freopen("/kdev/com1", "a+", stdout);
printf("in init (stage 2), loaded at 0x%x\n", &_image_base);
@@ -73,5 +70,5 @@ int main(void) {
_syscall_await();
printf("init: quitting\n");
- exit(0);
+ return 0;
}