How to specify exact ordinals for dll export to MinGW?

I am trying to create a DLL with MinGW, and I need to increase the export that it generates. I need to assign specific sequence numbers for certain exported functions.

I created a .DEF file, but I cannot find a way to tell the MinGW linker to use it. Is it possible?

+4
source share
1 answer

It turned out to be very easy. Just connect to the .def file as follows:

gcc obj1.o obj2.o obj.def -shared -omylib.dll 

All ordinals can be listed in the .def file (serial number @ 0 does not work, causes ld to fail).

Example .def file:

 EXPORTS Insert @1 Delete @2 Replace @3 
+10
source

Source: https://habr.com/ru/post/1379672/


All Articles