GNU ld has many options regarding DLLs, but we shall only focus on four (help information follows):
--add-stdcall-alias Export symbols with and without @nn
--kill-at Remove @nn from exported symbols
--out-implib Generate import library
--output-def Generate a .DEF file for the built DLL