As GOT section has lower address than PLT section, the Delta value is negative and should be calculated and stored in the signed variable.
Diff Detail
Diff Detail
Event Timeline
Comment Actions
The patch fixes the elf2/plt.s test failure on Windows (and probably on other platforms with 32-bit targets).
Comment Actions
It fails on Windows (target triple i686-pc-win32) with MSVC 14.
A bit more explanation. The type uintprt_t in this situation is equivalent to 32-bit unsigned int. For example, the Delta var may have value 0xffffeffa. And when it's passed to the isInt<32> function, which parameter is 64-bit signed integer, it doesn't extend sign bit.
Comment Actions
In Win32 build, uintptr_t is 32 bit unsigned integer. The isInt function
receives
64 bit signed integer as a parameter. A uint32 value converts to int64
without
sign bit extension, so isInt receives a positive value, which cannot be
represented
as signed 32 bit integer value.
I see nothing odd here.