https://issues.dlang.org/show_bug.cgi?id=13334
Walter Bright <bugzi...@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WORKSFORME --- Comment #3 from Walter Bright <bugzi...@digitalmars.com> --- Modernizing the test case to: import core.sys.windows.windows; extern(Windows) void ExitProcess(DWORD); void start() { ExitProcess(0); } pragma(startaddress, start); pragma(lib, "kernel32"); and compiling with: dmd -betterC test2 produces: 02/15/2018 10:38 PM 2,076 test2.exe and strings produces: C:\cbx\bug>strings test2.exe MZ` Requires Win32 $ .idata @_TEXT `.reloc @.debug ExitProcess KERNEL32.dll and obj2asm produces: C:\cbx\bug>obj2asm test2 _TEXT segment dword use32 public 'CODE' ;size is 0 _TEXT ends _DATA segment para use32 public 'DATA' ;size is 0 _DATA ends CONST segment para use32 public 'CONST' ;size is 0 CONST ends _BSS segment para use32 public 'BSS' ;size is 0 _BSS ends FLAT group extrn _D5test25startFZv includelib kernel32.lib extrn _ExitProcess@4 _D5test25startFZv COMDAT flags=x0 attr=x0 align=x0 _TEXT segment assume CS:_TEXT _TEXT ends _DATA segment _DATA ends CONST segment CONST ends _BSS segment _BSS ends _D5test25startFZv comdat assume CS:_D5test25startFZv L0: push 0 call near ptr _ExitProcess@4 ret _D5test25startFZv ends end which looks satisfactory. --