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()
