From ecb1b4b4d081429b9170e5234eaa314380eda9a7 Mon Sep 17 00:00:00 2001 From: johannst Date: Wed, 28 Apr 2021 23:11:34 +0200 Subject: 03: add check for relocation in the makefile --- 03_hello_dynld/Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to '03_hello_dynld/Makefile') diff --git a/03_hello_dynld/Makefile b/03_hello_dynld/Makefile index 5764166..d8201ef 100644 --- a/03_hello_dynld/Makefile +++ b/03_hello_dynld/Makefile @@ -25,6 +25,11 @@ dynld.so: dynld.S dynld.c ../lib/libcommon.a -Wl,--no-allow-shlib-undefined \ $^ + @if ! readelf -r $@ | grep 'There are no relocations in this file' >& /dev/null; then \ + echo "ERROR: $@ contains relocations while we don't support relocations in $@!"; \ + exit 1; \ + fi + ../lib/libcommon.a: make -C ../lib -- cgit v1.2.3