In an ELF binary the SONAME section defines the official name for the binaries for the ld.so to look up. This gets turned into an RPROVIDE. Similarly in an ELF binary the NEEDED section defines a list of runtime soname dependencies that a library has. The system converts this to RDEPENDS. There is another, rarely used section, called 'FILTER'. The 'FILTER' section says, if an associated FUNCTION/Symbol is used, THEN load the library associated with that section. So it acts like a NEEDED, but it's "dynamic" based on usage. We should process the FILTER entries the same way we process NEEDED. (I will attempt to figure out some sort of reproducer for this, but I'm having trouble finding documentation the FILTER secion. While this documentation is for Solaris, it should be similar to Linux ELF: https://docs.oracle.com/cd/E23824_01/html/819-0690/chapter4-4.html )
Ross is going to look into how to generate such an object...
The best documentation I can find is the Oracle stuff too, which has a small example. GNU ld has --filter to set this: https://sourceware.org/binutils/docs-2.39/ld/Options.html.