aboutsummaryrefslogtreecommitdiff
path: root/01_hello_dynld/Makefile
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2020-11-18 22:55:47 +0100
committerjohannst <johannes.stoelp@gmail.com>2020-11-18 22:55:47 +0100
commit69981ee29480b676fa089a79443897d7fde259e5 (patch)
treeca155fddb1a792437f5d34d2c5b33752872d6662 /01_hello_dynld/Makefile
downloaddynld-69981ee29480b676fa089a79443897d7fde259e5.tar.gz
dynld-69981ee29480b676fa089a79443897d7fde259e5.zip
added hello dynamic link module
Diffstat (limited to '01_hello_dynld/Makefile')
-rw-r--r--01_hello_dynld/Makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/01_hello_dynld/Makefile b/01_hello_dynld/Makefile
new file mode 100644
index 0000000..efcc457
--- /dev/null
+++ b/01_hello_dynld/Makefile
@@ -0,0 +1,13 @@
+inspect: build
+ readelf -W --sections main
+ readelf -W --dynamic main
+ readelf -W --program-headers main
+ readelf -W --string-dump .interp main
+ gdb -q --batch -ex 'starti' -ex 'bt' ./main
+
+build: libgreet.c main.c
+ gcc -o libgreet.so libgreet.c -shared -fPIC
+ gcc -o main main.c -lgreet -L. -Wl,--rpath=$(PWD)
+
+clean:
+ rm -f libgreet.so main