Skip to content

Commit

Permalink
Update linker to support old style library names
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 authored and axic committed Dec 11, 2019
1 parent 5c1280c commit f655c32
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions linker.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,22 @@ var findLinkReferences = function (bytecode) {
// trim trailing underscores
// NOTE: this has no way of knowing if the trailing underscore was part of the name
var libraryName = found[1].replace(/_+$/gm, '');
var fileName = libraryName;
var nameExtraction = /(.*):(.*)/.exec(libraryName);
if (nameExtraction) {
fileName = nameExtraction[1];
libraryName = nameExtraction[2];
}

if (!linkReferences[libraryName]) {
linkReferences[libraryName] = [];
if (!linkReferences[fileName]) {
linkReferences[fileName] = {};
}

linkReferences[libraryName].push({
linkReferences[fileName][libraryName] = {
// offsets are in bytes in binary representation (and not hex)
start: (offset + start) / 2,
length: 20
});
};

offset += start + 20;

Expand Down

0 comments on commit f655c32

Please # to comment.