From b590ceaf4277c9b301fd6d95a181ddd31d3a1049 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 4 May 2023 13:00:02 -0700 Subject: [PATCH] build: package: skip SONAME analysis when ELF interpreter setting is present End-user programs are the only type of ELF object where it would make sense for an ELF interpreter to be set on the on the ELF object. Accordingly, treat any object which has an ELF interpreter set on it as an end-user program and skip SONAME analysis for them. Signed-off-by: Ariadne Conill --- pkg/build/package.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/build/package.go b/pkg/build/package.go index cb1a030e8..4a0015ea4 100644 --- a/pkg/build/package.go +++ b/pkg/build/package.go @@ -464,7 +464,10 @@ func generateSharedObjectNameDeps(pc *PackageContext, generated *Dependencies) e } } - if !pc.Options.NoProvides { + // An executable program should never have a SONAME, but apparently binaries built + // with some versions of jlink do. Thus, if an interpreter is set (meaning it is an + // executable program), we do not scan the object for SONAMEs. + if !pc.Options.NoProvides && interp == "" { sonames, err := ef.DynString(elf.DT_SONAME) // most likely SONAME is not set on this object if err != nil {