Problems in latest YASM snapshot
Peter Johnson
peter at tortall.net
Fri Dec 2 10:32:11 PST 2005
On Fri, 2 Dec 2005, Catalin Ionescu wrote:
>>> 3) When accessing local procedure variables on the stack I use
>>> EBP+offset code generated by a special macro. For every line where I
>>> access variables on the stack (arguments and/or local variables) I get
>>> the following warning:
>>>
>>> "rc_rtl.nas:52: warning: invalid displacement size; fixed"
>>>
>>> The generated code is correct, but with some source files I get 1000+
>>> warnings!
>>
>> Can you send a copy of the macro? I think I know what's happening but I
>> need to validate my theory.
>
> The macro is the following one:
>
> %macro Arg 2-*.nolist
> %rep %0/2
> %xdefine %1 ebp+%$Args
> %assign %$Args %$Args+ ((%2+3)/4)*4
> %rotate 2
> %endrep
> %endmacro
>
> and the listing lines that trigger warnings in one of the source files are:
>
> 1324 00000003 837D0C01 cmp dword
> [ebp+12],DLL_PROCESS_ATTACH
> 1326 00000009 837D0C02 cmp dword [ebp+12],DLL_THREAD_ATTACH
> 1336 00000023 837D0C00 cmp dword
> [ebp+12],DLL_PROCESS_DETACH
> 1338 00000029 837D0C03 cmp dword [ebp+12],DLL_THREAD_DETACH
>
> The first source line can be either
>
> cmp dword [%$fdwReason],DLL_PROCESS_ATTACH
>
> or
>
> cmp dword [ebp+12],DLL_PROCESS_ATTACH
>
> and the warning is the same.
Okay, I guess I'm going to need a bit more information. What BITS
setting? Is DLL_PROCESS_ATTACH just an EQU? A few lines of code before
or after might be good too; it could be that the warning is actually on a
different line but it's somehow getting flagged as this line.
I ask because when I assemble:
BITS 32
DLL_PROCESS_ATTACH equ 4
cmp dword [ebp+12], DLL_PROCESS_ATTACH
I don't get a warning.
Thanks,
Peter
More information about the yasm-devel
mailing list