Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include libraries and symbolic links based on SONAMEs #16118

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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