preserve-libs is historically one of these kind of scary areas of Portage because we have to do some careful evaluation of ELF dependencies while eliminating circular dependencies & accounting for bundled deps. Zac rightly mentioned we could do better with tests here in bug 521968 (https://bugs.gentoo.org/521968#c15): >I plan to create unit tests that call the doebuild function using a mock derived from LinkageMapELF. This will allow for efficient testing of changes and detection of regressions.