diff --git a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewElfDump.java b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewElfDump.java index bdb893bfd2f..3ada9d004a4 100644 --- a/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewElfDump.java +++ b/jcl/src/openj9.dtfj/share/classes/com/ibm/dtfj/corereaders/NewElfDump.java @@ -817,6 +817,8 @@ 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. + final Set _allElfFileNames = new HashSet<>(); // Maps to a set of paths of loaded shared libraries for a particular 'soname'. final Map> _librariesBySOName = new HashMap<>(); private List _processEntries = new ArrayList<>(); @@ -1035,6 +1037,8 @@ private void readFileNotes(long offset) throws IOException { continue; } + _allElfFileNames.add(fileName); + String soname = result.getSONAME(); if (soname != null) { @@ -1663,14 +1667,11 @@ private List readModules(Builder builder, Object addressSpace, String executa continue; } - // add all matching names found in the file notes + // use soname if we could't find something better in the file notes Set libs = _file._librariesBySOName.get(soname); if (libs == null || libs.isEmpty()) { - // use soname if we could't find something better in the file notes _additionalFileNames.add(soname); - } else { - _additionalFileNames.addAll(libs); } } catch (Exception ex) { // We can't tell a loaded module from a loaded something else without trying to open it @@ -2339,6 +2340,9 @@ public void extract(Builder builder) { builder.setOSType("ELF"); //$NON-NLS-1$ builder.setCPUType(_file._arch.toString()); builder.setCPUSubType(readStringAt(_platformIdAddress)); + + // Include all libraries mentioned in NT_FILE notes. + _additionalFileNames.addAll(_file._allElfFileNames); } catch (CorruptCoreException | IOException | MemoryAccessException e) { // TODO throw exception or notify builder? }