News:

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

a problem?

Started by lw, January 20, 2008, 10:09:13 AM

Previous topic - Next topic

lw

make a dll ,not export function name :    _myfunc@4,  only myfunc
sorry my poor english

jorgon

Hi Lw

It does work for me!

Could you explain what assembler and linker you are using and how you are looking at the exported symbol?  If you look at the DLL using the debugger GoBug, for example, the decoration is stripped out (_myfunc@4 will appear as myfunc but it is actually _myfunc@4 in the DLL).  This might also happen with other debuggers.


Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

donkey

DLLs that I make with GoAsm do not have decorated function names, for example a menu hook DLL for my current projects export section looks like this

00000E00 00 00 00 00 70 DF 87 47 - 00 00 00 00 34 50 00 00 ....p߇G....4P..
00000E10 01 00 00 00 01 00 00 00 - 01 00 00 00 30 50 00 00 ............0P..
00000E20 2C 50 00 00 28 50 00 00 - 00 00 00 00 41 50 00 00 ,P..(P......AP..
00000E30 42 10 00 00 4D 65 6E 75 - 48 6F 6F 6B 2E 64 6C 6C B...MenuHook.dll
00000E40 00 49 6E 73 74 61 6C 6C - 48 6F 6F 6B 00 00 00 00 .InstallHook....


With InstallHook being the only export. Be sure that your GoAsm command line does not include the /ms switch which will decorate export names for use with Microsoft tools (ie LINK.EXE or LIB.EXE)

Donkey
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

lw

i want to use golink.exe ,its very simple, not need " lib "

test.asm:
.code
start:
   mov eax, 1
   ret 12

_myfunc@4:
   mov eax,1
   ret

----------------------------
C:\test>goasm test.asm

GoAsm.Exe Version 0.56.03a- Copyright Jeremy Gordon 2001/7 - JG@JGnet.co.uk
Output file: test.obj

C:\test>golink test.obj /dll /export _myfunc@4

GoLink.Exe Version 0.26.8 - Copyright Jeremy Gordon 2002/7-JG@JGnet.co.uk

Error!
The following exported symbol was not defined in the object file or files:-
_myfunc
Output file not made
-----------------------------------

donkey

Support for decorated names is included for those who wish to use Microsoft tools, GoLink expects a filename after @ to indicate a command file. If you wish to use the decorated names you will have to use Microsofts's link.exe or lib.exe not GoLink. I don't know any way to export a decorated name using GoLink, though perhaps Jeremy might have included one. Your code would look something like this, that is if you wish to get rid of the decoration which is how I understand your original post...

test.asm:
.code
start:
   mov eax, 1
   retn 12

myfunc:
   mov eax,1
   retn 4

C:\GoAsm.EXE "test.asm"
C:\GoLink.exe /dll /entry start "test.obj"

"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

lw

thank donkey,i need export function name include '@',other program need it

jorgon

lw

Yes this was a fault in GoLink.

Many thanks for pointing this out.

The fix is in the attached GoLink 0.26.9c.





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