flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid 08 Dec 2007, 18:01
Code: format MS COFF public ret5 as '_ret5' section '.code' code executable readable ret5: mov eax,5 retn |
|||
![]() |
|
emil 08 Dec 2007, 18:10
Thanks vid for fast reply.
But the routine ret5 did not appear in my DLL file. I have put this in my header file of my DLL __declspec(dllexport) int ret5 ( void ); And link with yor code but as I said it did not appear. So what could be the problem? |
|||
![]() |
|
vid 08 Dec 2007, 18:38
You could use some kind of command line argument or module definition file to export function, instead of __declspec(). But I don't know how to do this with MinGW.
If you linked with that file, and exported "ret5", then it should appear. Linker may silently ignore it, if you didn't export "ret5" properly. |
|||
![]() |
|
emil 08 Dec 2007, 19:46
Vid I am afraid, I did not think so.
ok look. I have made a tow functions in C++ , exported one of them and the other did not. Then compiled them to produce the Obj file by Mingw, then opened them with HexEditor program and found that the exported function was marked as export function with a prefix word “ –export:’ i.e “–export:functionName” . the other one was not . So I think you have to supply some extra information in the Obj file to tell the linker that there are some export functions those must be in the final DLL. Any help please? |
|||
![]() |
|
bitRAKE 08 Dec 2007, 21:24
The OBJ file can have commands for the linker embedded in it, but FASM does not do this - the "-export:" is a command for the linker, IIRC. You will need to supply the linker with the "-export:" commands.
|
|||
![]() |
|
Tomasz Grysztar 09 Dec 2007, 00:01
bitRAKE wrote: The OBJ file can have commands for the linker embedded in it, but FASM does not do this fasm does not do only when it's not told to. Try this with MS COFF output: Code: section '.drectve' linkinfo linkremove db '–export:functionName ' |
|||
![]() |
|
bitRAKE 09 Dec 2007, 00:45
That is very helpful! I was unaware of the ".drectve" section. It is good to include all the requirements within the source file. Thank you.
|
|||
![]() |
|
emil 09 Dec 2007, 06:30
Thanks Tomasz Grysztar
I think it needs more information or something else because I got this warning from the linker Warning: .drectve '–export:functionName ' unrecognized Any help please ? |
|||
![]() |
|
bitRAKE 09 Dec 2007, 08:55
functionName needs to be the name of your label (i.e. ret5).
|
|||
![]() |
|
emil 09 Dec 2007, 15:20
Of course it is the real name of the function , I am do aware of that.
I have changed it only in the post. |
|||
![]() |
|
vid 09 Dec 2007, 16:03
emil: post that object file here, so we can look at it
|
|||
![]() |
|
emil 09 Dec 2007, 16:41
Ok vid
Here is the asm file and the obj , it is your first example. http://bcxdx.spoilerspace.com/Ogre/ExportProblem.zip still has the linker error. |
|||
![]() |
|
emil 09 Dec 2007, 17:10
Ok , I am thinking in make the main DLL in asm and merge the OBJ files from Mingw C++ and export there functions in asm file just like the DLL example that comes with fasm.
The question is , does fasm accept obj file from Mingw C++ , and if so how to do that with fasm? |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.