News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

a error

Started by lw, February 04, 2007, 12:23:47 PM

Previous topic - Next topic

jorgon

lw

This problem arose because:-


  • Some of the function names in libhttpd.dll were "decorated" (name-mangled) ie. containing an underscore before the function name and "@xx" after the name, where xx was the number of bytes PUSHed before the call.
  • The Microsoft system DLLs do not contain decorated symbols.
  • Many compilers and assemblers add such decoration to the symbols in the object files which they create to indicate that the symbol is imported and to specify the method of call.
  • The Microsoft linker expects such decoration in the case of a symbol which is imported.  But in order to deal with the fact that the imported symbols will be decorated in the object file, but not decorated in the DLLs, the linker ignores such decoration when looking for the correct symbol in the DLL or any LIB file made from the DLL.
  • GoLink also ignores any such decoration.  This allows GoLink to link object files containing decorated symbols.  Also GoAsm adds decoration to the symbols in the object file if the /ms switch is specified. This allows GoAsm object files to be linked using the Microsoft linker.
  • In the case of libhttpd.dll however, this arrangement does not work because the decoration must not be ignored by the linker.  Unusually, the decoration forms part of the symbol name.
  • I suspect that the symbols in libhttpd.dll are decorated because the DLL is designed to be used by a specific (non-Windows) linker which works that way.
  • Anyway, the solution in the case of GoAsm+GoLink is for GoAsm to inform GoLink whether the symbols in the object file are decorated because the /ms switch was specified.  This is done in the latest version of GoAsm 0.56.01 beta (attached).  Now if GoLink is looking for a symbol in an object file made by GoAsm it will only ignore any decoration if the /ms switch has been specified.  This happens in the latest version of GoLink (0.26.8) (attached).
  • With these versions of GoAsm and GoLink you can require GoLink to look for a decorated symbol in the DLL.  Just give the decoration but do not specify /ms in the command line.

So, lw hopefully this will now allow you to proceed.  There is no need to amend your code.
Thanks for pointing out this problem.


[attachment deleted by admin]
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)