I am able to create a DLL with the latest JWlink but the exported functions are always decorated. I tried the EXPORT switch to get an undecorated exported symbol but I received the following error message :
Inserting double quotes between _StdOut@4 didn't help too. I am probably not using correctly the EXPORT directive. Could Japheth or any other member point me in the right way?
Thanks,
Vortex
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Checking the exported functions with dumpbin, I found that there exists an extra decorated symbol named _ClearScreen@
\masm32\bin\dumpbin.exe /EXPORTS ConsFuncs.dll
File Type: DLL
Section contains the following exports for ConsFuncs.dll
0 characteristics
0 time date stamp Thu Jan 01 02:00:00 1970
0.00 version
1 ordinal base
4 number of functions
4 number of names
ordinal hint RVA name
2 0 000010A0 ClearScreen
1 1 0000106A StdOut
4 2 000010A0 _ClearScreen@
3 3 0000106A
the dumpbin protocol revealed a bug in jwlink: it sometimes calculated the size of the export data 4 bytes too small - that's why the last entry in the protocol has "no name" ( it "should" have been _StdOut@4 ). This has been fixed now.
The issue that both variants, the decorated and the undecorated names, are contained in the export table is "expected behavior". MS link behaves equally. Technically spoken, the problem is that the "export" attribute in Masm/JWasm will make the assembler add an "-export" entry in the .drectve section. That's why the linker will find -export directives for ALL variants.
there are 2l workarounds if you don't want the decorated entries:
- don't use the EXPORT attribute in the assembler source
- use JWasm's -zze switch
Instead of using the EXPORT attribute, you could also try to write the export directives for the linker manually in the .drectve section in the assembly source.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> Removing the EXPORT attribute and specifying the switch -zze solved the problem.
Just for the record: my suggestion was to remove the attribute OR adding -zze. -zze has no effect at all if no EXPORT attributes were found in the source.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am able to create a DLL with the latest JWlink but the exported functions are always decorated. I tried the EXPORT switch to get an undecorated exported symbol but I received the following error message :
Inserting double quotes between _StdOut@4 didn't help too. I am probably not using correctly the EXPORT directive. Could Japheth or any other member point me in the right way?
Thanks,
Vortex
> Inserting double quotes between _StdOut@4 didn't help too.
It must be SINGLE quotes - don't ask me why! I'll add this hint to the jwlink help file.
Sample ( found in JWasm's OWWinDll.mak):
system nt_dll op export AssembleModule='_AssembleModule@4', ParseCmdline='_ParseCmdline@8'
Hi Japheth,
Many thanks for your support. Now, It works fine :
Checking the exported functions with dumpbin, I found that there exists an extra decorated symbol named _ClearScreen@
Here is the example project :
http://vortex.masmcode.com/misc/DLLtest.zip
Vortex,
the dumpbin protocol revealed a bug in jwlink: it sometimes calculated the size of the export data 4 bytes too small - that's why the last entry in the protocol has "no name" ( it "should" have been _StdOut@4 ). This has been fixed now.
The issue that both variants, the decorated and the undecorated names, are contained in the export table is "expected behavior". MS link behaves equally. Technically spoken, the problem is that the "export" attribute in Masm/JWasm will make the assembler add an "-export" entry in the .drectve section. That's why the linker will find -export directives for ALL variants.
there are 2l workarounds if you don't want the decorated entries:
- don't use the EXPORT attribute in the assembler source
- use JWasm's -zze switch
Instead of using the EXPORT attribute, you could also try to write the export directives for the linker manually in the .drectve section in the assembly source.
Hi Japheth,
Many thanks for the new release of Jwlink. Removing the EXPORT attribute and specifying the switch -zze solved the problem.
> Removing the EXPORT attribute and specifying the switch -zze solved the problem.
Just for the record: my suggestion was to remove the attribute OR adding -zze. -zze has no effect at all if no EXPORT attributes were found in the source.