News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

invalid fixup

Started by Biterider, October 09, 2017, 05:40:52 AM

Previous topic - Next topic

johnsa

Perfect thanks :)

That'll help me track it down!

aw27

Quote from: Biterider on October 10, 2017, 02:47:56 AM
Hi John
I build a lib with only 1 procedure (GetObjectTemplate) and the problem still persits.
In the attachment is the complete test case. You will find 2 batch files to build the lib and the exe files.


Biterider

If it helps in any way, I have built the same LIB with just 1 procedure (GetObjectTemplate) but without the 2 upper lines which are not needed for the case (except to equate POINTER to dword)
% include @Environ(OA32_PATH)\\Code\\OA32_Setup.inc
% include &ObjMemPath&ObjMem32.cop
and it works.

Biterider

Thanks aw27
Confirmed. I'll see what causes the issue in those files.
Biterider

Biterider

Hi
Thanks to aw27's hint I found the problem. I reduced the sequence of commands/options/etc. from those files to the following code:



POINTER     typedef     DWORD      ;Anonymous pointer


option casemap:none                ;Case sensible
option dotname                     ;Enable dot names
.686p                              ;Use 686 protected mode
.xmm                               ;Enable xmm instructions
.model flat, stdcall               ;Memory model = flat, use StdCall as default calling convention


NULL        equ   0


ALIGN_CODE = 8


.code


externdef pFirstObject:POINTER


OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE


align ALIGN_CODE


GetObjectTemplate proc dObjectID:DWORD
...
GetObjectTemplate endp


OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef


end



Now, if you move the .686p directive to the first line, all is smooth again. The problem is the POINTER typedef.
it seems that the .686p directive in UASM erases all previous definitions while ML remembers them!


Biterider



aw27

UASM also does not accept .xmm before the CPU model - if you do and use a xmm instruction it will give an error. MASM does allow. May be this could be fixed.

johnsa

Well that's really useful  :) I will see what I can do to keep any of those arrangements working , at least it hopefully means I don't have to dig through the hideous coff output code to find the fixup :)

johnsa


Update:

[url]www.terraspace.co.uk/uasm242.zip


1) Prevent .686p (and others) from resetting ext flag bits, so it shouldn't reset .mmx / .xmm anymore.
2) invalid fixup bug found.. when the typedef is evaluated prior to .686p the default memory sizing is assumed to be 16bit, so the relocation/fixup written to the obj file is for 16bit, not 32bit+ COFF. It now assumes 32bit or 64bit depending on the output settings.

Biterider



HSE

Very funny!!

The problem still is alive... but is not so dificult to move some lines  :biggrin:

Here the thing was externdef previous to model directives.
Equations in Assembly: SmplMath