RPM appears to link to the most recent version of sys-libs/db present on the system, instead: ~ # ldd $(which rpm) | grep db libdb-4.8.so => /usr/lib/libdb-4.8.so (0x00007fa803464000)
I concur. I've been doing some research, and in the INSTALL file of the source, it says: ---- The Berkeley DB >= 4.3.x (4.5.x or newer recommended) is required for the default database backend ---- So, I modified the ebuild in an overlay and changed the dependency "=sys-libs/db-4.5*" into ">=sys-libs/db-4.5". The result is an rpm binary linked against the same library as it was previously, and a fully functional rpm command (rpm -V, rpm -q, rpm -i, rpm -e, rpmbuild etc all work). The ebuild should be modified for the dep above imho.
Fixed without revision bump.