Shared libraries conversion

I was wondering if it’s possible to convert binary dynamic library to a shared static library and vice versa.  I’ve done some research and I found a solution to do it but only in one direction.

ar -x libtermcap.a

extracts static library to .o object, then you can compile it to dynamic library

gcc -shared *.o -o libtermcap.so.2

Unfortunately it looks like that conversion in opposite direction is impossible.