Skip to content

Commit

Permalink
Merge pull request #16118 from keithc-ca/jpackcore
Browse files Browse the repository at this point in the history
Include libraries and symbolic links based on SONAMEs
  • Loading branch information
babsingh authored Oct 19, 2022
2 parents 6c958c2 + 5bba77d commit 2b902d7
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,10 @@ private static abstract class ElfFile {
private short _programHeaderCount = 0;
private short _sectionHeaderEntrySize = 0;
private short _sectionHeaderCount = 0;
// The set of ELF objects mentioned in FILE notes.
/*
* The set of ELF objects mentioned in FILE notes,
* as well as paths of symbolic links based on SONAMEs.
*/
final Set<String> _allElfFileNames = new HashSet<>();
// Maps to a set of paths of loaded shared libraries for a particular 'soname'.
final Map<String, Set<String>> _librariesBySOName = new HashMap<>();
Expand Down Expand Up @@ -1059,8 +1062,12 @@ private void readFileNotes(long offset) throws IOException {

if (isSameFile(file, sofile)) {
Set<String> paths = _librariesBySOName.computeIfAbsent(soname, key -> new HashSet<>());
String sopath = sofile.getAbsolutePath();

paths.add(sopath);

paths.add(sofile.getAbsolutePath());
/* Add the SONAME-based path: it may be different than fileName added above. */
_allElfFileNames.add(sopath);
}
}

Expand Down

0 comments on commit 2b902d7

Please sign in to comment.