I get the following error when I try to run a script I have only execution access for:
uname: symbol lookup error: /home/dumindara/random/sotest/a.out: undefined s
I am unable to comment to the accepted answer, however it is worth to mention here that one can encounter issue of not having libdl.so.2 linked properly when -ldl
is used in front of compile command (assuming that linking and compilation is executed by the same command; this is possible since LD_PRELOAD libs are usually based on one source file).
So call gcc with -ldl
at the end:
gcc -shared -fPIC fakeuname.c -o libfakeuname.so -ldl
In my case, having -ldl
at front resulted in error same as in question:
uname: symbol lookup error: ./libfakehostname.so: undefined symbol: dlsym