Skip to content

Commit be49dd5

Browse files
yann300axic
authored andcommitted
Update linker.js
1 parent 1d95d3f commit be49dd5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

linker.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,22 @@ var findLinkReferences = function (bytecode) {
6666
// trim trailing underscores
6767
// NOTE: this has no way of knowing if the trailing underscore was part of the name
6868
var libraryName = found[1].replace(/_+$/gm, '');
69+
var fileName = libraryName;
70+
var nameExtraction = /(.*):(.*)/.exec(libraryName);
71+
if (nameExtraction) {
72+
fileName = nameExtraction[1];
73+
libraryName = nameExtraction[2];
74+
}
6975

70-
if (!linkReferences[libraryName]) {
71-
linkReferences[libraryName] = [];
76+
if (!linkReferences[fileName]) {
77+
linkReferences[fileName] = {};
7278
}
7379

74-
linkReferences[libraryName].push({
80+
linkReferences[fileName][libraryName] = {
7581
// offsets are in bytes in binary representation (and not hex)
7682
start: (offset + start) / 2,
7783
length: 20
78-
});
84+
};
7985

8086
offset += start + 20;
8187

0 commit comments

Comments
 (0)