Skip to content

Commit f655c32

Browse files
yann300axic
authored andcommitted
Update linker to support old style library names
1 parent 5c1280c commit f655c32

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
@@ -70,16 +70,22 @@ var findLinkReferences = function (bytecode) {
7070
// trim trailing underscores
7171
// NOTE: this has no way of knowing if the trailing underscore was part of the name
7272
var libraryName = found[1].replace(/_+$/gm, '');
73+
var fileName = libraryName;
74+
var nameExtraction = /(.*):(.*)/.exec(libraryName);
75+
if (nameExtraction) {
76+
fileName = nameExtraction[1];
77+
libraryName = nameExtraction[2];
78+
}
7379

74-
if (!linkReferences[libraryName]) {
75-
linkReferences[libraryName] = [];
80+
if (!linkReferences[fileName]) {
81+
linkReferences[fileName] = {};
7682
}
7783

78-
linkReferences[libraryName].push({
84+
linkReferences[fileName][libraryName] = {
7985
// offsets are in bytes in binary representation (and not hex)
8086
start: (offset + start) / 2,
8187
length: 20
82-
});
88+
};
8389

8490
offset += start + 20;
8591

0 commit comments

Comments
 (0)