Skip to content

Commit

Permalink
Improve error message for non-pointer relocations
Browse files Browse the repository at this point in the history
  • Loading branch information
Darxoon committed Jun 18, 2024
1 parent c7b595b commit 607cd05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/elf/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ function applyRelocations<T extends DataType>(obj: Instance<T>, offset: number,
let targetSymbol = symbolTable[relocation.infoHigh]
obj[fieldName] = targetSymbol.name
} else {
throw new Error(`Relocation to non-pointer field ${fieldName}: ${fieldType} at offset 0x${offset.toString(16)} (${DataType[dataType]})`)
throw new Error(`Field '${fieldName}' should be string or pointer, not '${fieldType}' (at offset 0x${offset.toString(16)}, ${DataType[dataType]})`)
}
}
}

0 comments on commit 607cd05

Please sign in to comment.