Author Topic: Polink bug?  (Read 2632 times)

jj2007

  • Member
  • *****
  • Posts: 10636
  • Assembler is fun ;-)
    • MasmBasic
Polink bug?
« on: December 11, 2015, 04:37:26 PM »
I have a library module that has a buffer in the .DATA? section; the symbol is not exported, i.e. the buffer is known only to the module.

Now I discovered that the start address coincides with the start of another buffer in a different module.

This happens only with polink, both with the Masm32 version of 16.4.2011 and the latest polink of 21.3.15

Is this a known problem? Any workaround?

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7607
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Polink bug?
« Reply #1 on: December 11, 2015, 05:46:31 PM »
This much, the module format without a stack frame is different to MASM.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jj2007

  • Member
  • *****
  • Posts: 10636
  • Assembler is fun ;-)
    • MasmBasic
Re: Polink bug?
« Reply #2 on: December 11, 2015, 06:20:59 PM »
Your answer is somewhat cryptic, dear Hutch ::)

Anyway, I've found the culprit, polink is innocent, M$ linkers are half guilty because they allocate memory too generously, so the missing dword went unnoticed for quite a while :redface:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7607
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Polink bug?
« Reply #3 on: December 11, 2015, 09:23:26 PM »
This is a leftover from 2006. A no-stack frame procedure.


; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

    .model flat, stdcall    ; 32 bit memory model
    option casemap :none    ; case sensitive
    option cstrings:on      ; enable C string escapes
 
  ; *************
  ; include files
  ; *************
    include \poasm\include\windows.inc
    include \poasm\include\plib.inc
    include \poasm\include\gdi32.inc
    include \poasm\include\user32.inc
    include \poasm\include\kernel32.inc
    include \poasm\include\Comctl32.inc
    include \poasm\include\comdlg32.inc
    include \poasm\include\shell32.inc
    include \poasm\include\msvcrt.inc
    include \poasm\macros\macros.asm

    EXTERNDEF [your label name] :DWORD
 
    .code

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

align 16

[your label name]:
 
  ; your code here

    ret [balance stack here]

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

    end
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: