Author Topic: invalid fixup  (Read 5443 times)

johnsa

  • Member
  • ****
  • Posts: 810
    • Uasm
Re: invalid fixup
« Reply #15 on: October 10, 2017, 03:12:15 AM »
Perfect thanks :)

That'll help me track it down!

AW

  • Member
  • *****
  • Posts: 2583
  • Let's Make ASM Great Again!
Re: invalid fixup
« Reply #16 on: October 10, 2017, 03:17:04 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

  • Member
  • ****
  • Posts: 546
  • ObjAsm Developer
    • ObjAsm
Re: invalid fixup
« Reply #17 on: October 10, 2017, 03:39:10 AM »
Thanks aw27
Confirmed. I'll see what causes the issue in those files.
Biterider

Biterider

  • Member
  • ****
  • Posts: 546
  • ObjAsm Developer
    • ObjAsm
Re: invalid fixup
« Reply #18 on: October 10, 2017, 04:24:08 AM »
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:
Code: [Select]


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



AW

  • Member
  • *****
  • Posts: 2583
  • Let's Make ASM Great Again!
Re: invalid fixup
« Reply #19 on: October 10, 2017, 04:59:19 AM »
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

  • Member
  • ****
  • Posts: 810
    • Uasm
Re: invalid fixup
« Reply #20 on: October 10, 2017, 09:00:25 AM »
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

  • Member
  • ****
  • Posts: 810
    • Uasm
Re: invalid fixup
« Reply #21 on: October 10, 2017, 10:35:37 PM »
Code: [Select]
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

  • Member
  • ****
  • Posts: 546
  • ObjAsm Developer
    • ObjAsm
Re: invalid fixup
« Reply #22 on: October 11, 2017, 01:15:27 AM »
Thank you!
Biterider

AW

  • Member
  • *****
  • Posts: 2583
  • Let's Make ASM Great Again!
Re: invalid fixup
« Reply #23 on: October 11, 2017, 01:31:53 AM »
 :t

HSE

  • Member
  • *****
  • Posts: 1407
  • <AMD>< 7-32>
Re: invalid fixup
« Reply #24 on: November 24, 2019, 11:52:26 AM »
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.