Skip to content

Instantly share code, notes, and snippets.

@andreygursky
andreygursky / Makefile
Created June 21, 2012 22:11
simple test for memory allocation for global variables in dynamically loaded lib
CC=gcc
CFLAGS=-Wall -g
all: libdl_func.so.1.0.0 test_dl
libdl_func.so.1.0.0: dl_func.o
rm -f libdl_func.so
rm -f libdl_func.so.1
$(CC) -o $@ $^ -shared -Wl,-soname,libdl_func.so.1
ln -s libdl_func.so.1.0.0 libdl_func.so