From 287f736e614a2931f57e9aabf42105e3cf3e8992 Mon Sep 17 00:00:00 2001 From: johannst Date: Sat, 17 Apr 2021 23:47:17 +0200 Subject: 04: able to map dependency & resolve reolcs and execture main program (initial commit) --- 04_dynld_nostd/main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 04_dynld_nostd/main.c (limited to '04_dynld_nostd/main.c') diff --git a/04_dynld_nostd/main.c b/04_dynld_nostd/main.c new file mode 100644 index 0000000..ca250ef --- /dev/null +++ b/04_dynld_nostd/main.c @@ -0,0 +1,18 @@ +// Copyright (c) 2020 Johannes Stoelp + +#include +#include + +// API of `libgreet.so`. +extern const char* get_greet(); +extern const char* get_greet2(); + +void _start() { + pfmt("Running _start() @ %s\n", __FILE__); + + // Call function from libgreet.so -> generates PLT entry. + pfmt("get_greet() -> %s\n", get_greet()); + pfmt("get_greet2() -> %s\n", get_greet2()); + + _exit(0); +} -- cgit v1.2.3