[PATCH] ntdll: Improve handling of THUMB_MOV32 relocations

André Hentschel nerv at dawncrow.de
Thu Jan 2 13:51:47 CST 2014


Am 02.01.2014 17:01, schrieb Martin Storsjo:
> Since the delta variable actually is signed, the delta > 0xffff
> condition could be false even if the high part of the delta
> was nonzero, ending up with not updating the high half of the
> relocation at all.
> 
> Additionally, carry any overflow from the low word into the
> high word delta.


Hi,
Do you have an App that triggers that?
So you mean the case when the sign bit is used, e.g. 10101010b... Then the delta is negative, but is everything set correctly in the instruction?


> ---
>  dlls/ntdll/loader.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
> index e0907e7..1f13424 100644
> --- a/dlls/ntdll/loader.c
> +++ b/dlls/ntdll/loader.c
> @@ -2230,19 +2230,19 @@ IMAGE_BASE_RELOCATION * WINAPI LdrProcessRelocationBlock( void *page, UINT count
>              DWORD inst = *(INT_PTR *)((char *)page + offset);
>              DWORD imm16 = ((inst << 1) & 0x0800) + ((inst << 12) & 0xf000) +
>                            ((inst >> 20) & 0x0700) + ((inst >> 16) & 0x00ff);
> +            int hi_delta;

Why you're using int here? DWORD looks much better for this.



More information about the wine-devel mailing list