diff mbox series

dlopen-deps.inc: also parse executables

Message ID 20261021182944.1820061-1-luca.boccassi@gmail.com
State New
Headers show
Series dlopen-deps.inc: also parse executables | expand

Commit Message

Luca Boccassi Oct. 21, 2026, 6:29 p.m. UTC
From: Luca Boccassi <luca.boccassi@gmail.com>

The dlopen note is not just applied to shared libraries, but to ELF executables
too. This is especially the case in systemd v262, where binaries now each have
the precise list of dlopen dependencies they require.
For example, systemd-repart requires libblkid, which is not pulled in otherwise.

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
---
 meta/recipes-core/systemd/dlopen-deps.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/dlopen-deps.inc b/meta/recipes-core/systemd/dlopen-deps.inc
index 2d43f2dcb8..37074a9682 100644
--- a/meta/recipes-core/systemd/dlopen-deps.inc
+++ b/meta/recipes-core/systemd/dlopen-deps.inc
@@ -3,7 +3,7 @@  PACKAGEFUNCS =+ "package_generate_dlopen_deps"
 python package_generate_dlopen_deps() {
     # https://systemd.io/ELF_DLOPEN_METADATA/
 
-    import struct, json
+    import os, struct, json
 
     def extract_segment(filename, segment):
         """
@@ -57,11 +57,11 @@  python package_generate_dlopen_deps() {
             continue
 
         for f in files:
-            # Skip symlinks, just look for real libraries
+            # Skip symlinks, inspect executables and shared libraries.
             if cpath.islink(f):
                 continue
 
-            if ".so." in f or f.endswith(".so"):
+            if os.access(f, os.X_OK) or ".so." in f or f.endswith(".so"):
                 try:
                     elf = oe.qa.ELFFile(f)
                     elf.open()