Skip to content

Commit

Permalink
build: package: skip SONAME analysis when ELF interpreter setting is …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
kaniini committed May 4, 2023
1 parent b996a3e commit b590cea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/build/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b590cea

Please sign in to comment.