By my understanding, you cannot have the same symbol defined twice in the same process. It would, in fact, notice this at link time (the final gcc command above, which is really handing off most of its work to ld) and not allow you to do it. However, you could have two copies of the executable, one linked to lib2_test.so and one linked to lib1_test.so. I don't know exactly what you're going for, but that sounds not like what you want to do.

What may be more appropriate for your situation is what I alluded to before, using system calls to load shared objects dynamically. I'm a novice at this sort of thing, and I'm inclined to say it's pretty specific to each individual Unix. There's probably a POSIX spec for it, but it's likely to be still fluctuating in the real world. Regardless, you'd want to use the dlopen() set of functions to deal with that instead of the -l, -L, and -rpath options to the linker.
_________________________
Bitt Faulk