News:

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

Main Menu

Polink

Started by JK, May 16, 2020, 01:27:36 AM

Previous topic - Next topic

JK

I read about polink and found this (http://masm32.com/board/index.php?topic=1850.msg23403#msg23403). Are there still problems with debug info and polink, or has this been fixed with later versions?

Is polink a real alternative to MS´s link, or are there known restrictions or problems?


Thanks


JK

hutch--

Polink works fine, in 64 bit it produces slightly smaller exe files. It is usually very up to date and its well written and very reliable.

JK

From running own tests i can confirm, that polink indeed works like a charm linking 32 and 64 bit executables.

But when it comes to debugging polink´s latest version (9) doesn´t suppport codeview debug information any more. It now uses a different way of supplying debug information suited to Pelle´s IDE. I couldn´t get symbolic debugging to work with e.g. x96dbg - using MS´s link i could.

The nice things is, polink is redistrtibutable, the downside is, you cannot have symbols when debugging (at least i couldn´t get it to work)

The nice thing with MS´s link is, you can have symbols when debugging, the downside here is, it is not redistrtibutable, you must "steal" it from a VS or SDK installation.


JK 


Vortex

Hi JK,

Major changes between 8.00 and 9.00 :

QuoteLinker:

    Added support for Pelles C Debug Info, dropped support for Microsoft CodeView info.

http://www.smorgasbordet.com/pellesc/changes_800_900.htm

hutch--

JK,

> you must "steal" it from a VS or SDK installation.

You don't have to worry, its a legal download. Redistribution is the problem.

JK

I know, that´s why i used quotes.

jj2007

Quote from: JK on May 25, 2020, 01:21:09 AMBut when it comes to debugging polink´s latest version (9) doesn´t suppport codeview debug information

There is a simple solution: use version 8 :cool:

TimoVJL

polink.exe version 8 codeview support is only for 32-bit
May the source be with you

greenozon

Hi gentlemen

I"ve got the polink crash on my input files
I'm using polink.exe  version 8.0.2.0  (packaged into masm64 distributive)

Whom should I report the crash details?

2) is it the latest version? if no, please hint me where could I get the latest (and hopefully robust) one
thanks in advance!

TimoVJL

#9
Current version is 10 11
Pelles C download link
http://www.smorgasbordet.com/pellesc/

May the source be with you

Vortex

Hi greenozon,

Could post here your project causing the crash of the linker?

greenozon

Thanks for answers,
I've got the last release of Pelles C (ver 11.0)
and I'd like to test out the polink from that edition
I"ll post my findings tomorrow

Am I right supposing that one could just replace over po**.exe/dll from that installation over into masm64/bin64?

Vortex

Hello,
Quote
Am I right supposing that one could just replace over po**.exe/dll from that installation over into masm64/bin64?

Yes, you can replace.

greenozon

as promised,
attached a demo project
to run it:
assemble1-exe.bat test2
and observe the crash of polink, eg:

...
Assembling: test2.asm
CRT: unhandled exception (main) -- terminating

also you'll find the crash dumps generated be WerFault tool in crash dir
eg if you load it into VS: https://prnt.sc/sFGvEP-00uXl

Interesting fact! if you use the MS link.exe it'll also crash with CPU registers dumped out to screen...

2) I"m going to test today the latest po* binaries from Pelles C v11

zedd151

#14
I cant run it since its 64 bit, but I do see a glaring error. Right after the call to ShowWindow, there is a call to Exit Process.
I see no message loop in the code at all. Meaning no messages will be processed.


If you are successful in assembling and linking this, it will simply exit after creating the window.
Also, Why 30,000 icons in the resource file all pointing to the only icon???

Your Code:
START proc
    LOCAL wc     :WNDCLASSEX


           rcall GetModuleHandle, 0
           MOV WCINST,RAX
           MOV HINST,RAX


           mov WCICON, rv(LoadIcon,HINST, 10)
           invoke GetLastError
           mov HCURS,  rv(LoadCursor,0,IDC_NO)
           mov HBGND,  rv(GetStockObject, WHITE_BRUSH)


         mov wc.cbSize,         SIZEOF WNDCLASSEX
         mov wc.style,          CS_HREDRAW or CS_VREDRAW or CS_DBLCLKS or CS_OWNDC
         mov wc.lpfnWndProc,    ptr$(WndProc)
         mov wc.cbClsExtra,     0
         mov wc.cbWndExtra,     0
         mrm wc.hInstance,      WCINST
         mrm wc.hIcon,          WCICON
         mrm wc.hCursor,        HCURS
         mrm wc.hbrBackground,  HBGND
         mov wc.lpszMenuName,   0
         mov wc.lpszClassName,  ptr$(CLSNAME)
         mrm wc.hIconSm,        WCICON
            invoke RegisterClassEx, ADDR wc
            invoke GetLastError


           invoke CreateWindowEx,0, ADDR CLSNAME, ADDR WNDNAME, \
                  WS_OVERLAPPEDWINDOW or WS_VISIBLE, \
                   CW_USEDEFAULT,CW_USEDEFAULT,200,100,0,0,HINST,0
           MOV HWND1,RAX     ; Save handle
         invoke GetLastError
           invoke ShowWindow,EAX,SW_RESTORE


           invoke ExitProcess,0            ; Hasta la vista! baby
           ret
START endp



message loop code that could be added:
msgloop proc


    LOCAL msg    :MSG
    LOCAL pmsg   :QWORD


    mov pmsg, ptr$(msg)                     ; get the msg structure address
    jmp gmsg                                ; jump directly to GetMessage()


  mloop:
    invoke TranslateMessage,pmsg
    invoke DispatchMessage,pmsg
  gmsg:
    test rax, rv(GetMessage,pmsg,0,0,0)     ; loop until GetMessage returns zero
    jnz mloop


    ret


msgloop endp
Add 'call msgloop' after call to ShowWindow

Another error in your code
invoke GetLastError           
invoke ShowWindow,EAX,SW_RESTORE

First should be 'invoke ShowWindow,RAX,SW_SHOW'  or better: 'invoke ShowWindow,HWND1,SW_SHOW'
Second RAX overwritten by call to GetLastError so HWND1 no longer in RAX.