This small test program is linked from a comment on this question on stackoverflow.com.
The program should compile and link without error, but dies with a segmentation fault if you try to run it.
Compile with
gcc -c dlsym_test.c
If you want to try running it (it will crash):
gcc dlsym_test.c -o dlsym_test -ldl && ./dlsym_test
➜ /Developer gcc -c c.c
➜ /Developer gcc -c c.c -o c -ldl
i686-apple-darwin11-llvm-gcc-4.2: -ldl: linker input file unused because linking not done
➜ /Developer