Bug 15842

Summary: package.bbclass: Add FILTER support to match SONAME entry handling to avoid missing dependencies
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Mark Hatle <mark.hatle>
Component: oe-core otherAssignee: Unassigned <unassigned>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: Medium CC: randy.macleod, richard.purdie, ross.burton
Version: 5.0.8   
Target Milestone: 5.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Mark Hatle 2025-04-25 21:55:46 UTC
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 )
Comment 1 Randy MacLeod 2025-05-01 14:38:23 UTC
Ross is going to look into how to generate such an object...
Comment 2 Ross Burton 2025-05-01 14:56:56 UTC
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.