A testcase is attached. It generates two executables, one that links against libGL, and one that doesn't. The executable calls a function inside liblib1.so, which then calls dlopen on liblib2.so, which is in a different directory. The different RPATHs on the main executable and the liblib1.so lets everything find what it needs.
177 program output:
177 LD_DEBUG output:
8520: file=liblib2.so ; needed by /home/iscott/work/dlopen-testcase/liblib1.so 
8520: find library=liblib2.so ; searching
8520: search path=/home/iscott/work/dlopen-testcase/lib2/tls/x86_64:/home/iscott/work/dlopen-testcase/lib2/tls:/home/iscott/work/dlopen-testcase/lib2/x86_64:/home/iscott/work/dlopen-testcase/lib2 (RPATH from file /home/iscott/work/dlopen-testcase/liblib1.so)
180 program output:
Could not find liblib2.so.
180 LD_DEBUG output:
10413: file=liblib2.so ; needed by /usr/lib64/libGL.so.1 
10413: find library=liblib2.so ; searching
10413: search path=/home/iscott/work/dlopen-testcase (RPATH from file ./main-gl)
If libGL is wrapping dlopen, that means that the RPATH of the library doing the dlopen call will be ignored, and instead the RPATH of the main executable is used. This presents a problem and I don't see any way around it aside from not wrapping dlopen.