Closed smeng9 closed 3 years ago
Update: The libelf-integers library is done. We can even backport to libelf.js
There's only nitpick comments but your PR looks pretty good otherwise. Thank you very much @smeng9! I'll merge it right away after those few details are addressed.
We can even backport to libelf.js
That would be great. Thank you!
These changes are all resolved now 😄
Closes #21
The integer implementation is indeed tricky. Even though JavaScript support integer up to 53 bits, the bitwise operation is only 32 bits. I have to borrow the libelf-integers library to do some of the trick.
Nevertheless, full 64 bit support can be enabled through setting the integer type to ELF_INT_OBJECT while keeping backward compatibility of 32 bit native integer using ELF_INT_NUMBER. 64 bit integer/address needs to be passed as an array of [addr_lo, addr_hi] for now. Later I might enhance libelf-integers to support 53 bit integer/address without the need to split it as two parts using Number.isSafeInteger().
@AlexAltea you can now review it and merge this pull. Thanks.