diff options
author | dzwdz | 2022-07-24 16:34:37 +0200 |
---|---|---|
committer | dzwdz | 2022-07-24 16:34:37 +0200 |
commit | 373afdda5759198b2d5123abb578e3c649103493 (patch) | |
tree | d47c9271ac37c20630ec387ef1d2d0e2c8409024 /src/user/app/testelf | |
parent | 9f3fdb830f61cd8c8c1f1db9d03cba1c546c1a7e (diff) |
user: put the testelf in a sensible location in the tree
Diffstat (limited to 'src/user/app/testelf')
-rw-r--r-- | src/user/app/testelf/main.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/user/app/testelf/main.c b/src/user/app/testelf/main.c new file mode 100644 index 0000000..a80d233 --- /dev/null +++ b/src/user/app/testelf/main.c @@ -0,0 +1,18 @@ +#include <shared/printf.h> +#include <shared/syscalls.h> +#include <user/lib/elf.h> +#include <user/lib/elfload.h> +#include <user/lib/stdlib.h> + +const char *str = "Hello!\n", *str2 = "World.\n"; + +__attribute__((visibility("hidden"))) +extern char _image_base[]; + +int main(void) { + elf_selfreloc(); + printf("loaded at %x\n", &_image_base); + printf(str); + printf(str2); + _syscall_exit(0); +} |