I'm trying to build a DLL with MinGW and I need to augment the exports it is generating. I need to assign specific ordinal numbers to certain exported functions.
I created a .DEF file, but I can't find the option to tell MinGW linker to use it. Is it even possible?
Turned out to be extremely easy. Simply link together with the .def file like so:
gcc obj1.o obj2.o obj.def -shared -omylib.dll
All the ordinals can be listed in the .def file (ordinal @0 doesn't work though, causes a crash of ld).
Example .def file:
EXPORTS
Insert @1
Delete @2
Replace @3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With