diff options
author | dzwdz | 2022-07-26 22:40:28 +0200 |
---|---|---|
committer | dzwdz | 2022-07-26 22:40:28 +0200 |
commit | 4aee2f759ab7bf2ad9534941afef0195040ba5db (patch) | |
tree | 8799d4dac4bd82cc2274e4a8246e6891356b1511 /src/user/lib/crt0.c | |
parent | d54dcb2efc4be344900a7721ac4b65b47840c5d2 (diff) |
user/libc: a _start that automatically selfrelocates PIEs
Diffstat (limited to 'src/user/lib/crt0.c')
-rw-r--r-- | src/user/lib/crt0.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/user/lib/crt0.c b/src/user/lib/crt0.c new file mode 100644 index 0000000..91bbb05 --- /dev/null +++ b/src/user/lib/crt0.c @@ -0,0 +1,10 @@ +#include "elfload.h" +#include <unistd.h> + +int main(); + +__attribute__((__weak__)) +void _start(void) { + elf_selfreloc(); + exit(main()); +} |