From 4aee2f759ab7bf2ad9534941afef0195040ba5db Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 26 Jul 2022 22:40:28 +0200 Subject: user/libc: a _start that automatically selfrelocates PIEs --- src/user/lib/crt0.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/user/lib/crt0.c (limited to 'src/user/lib') 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 + +int main(); + +__attribute__((__weak__)) +void _start(void) { + elf_selfreloc(); + exit(main()); +} -- cgit v1.2.3