[Issue 13431] New: pragma(startaddress) doesn't work with COFF

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Sep 6 03:50:04 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13431

          Issue ID: 13431
           Summary: pragma(startaddress) doesn't work with COFF
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Keywords: link-failure
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: thecybershadow at gmail.com

I don't know if the COFF object file format supports indicating the entry
point, but if it does, then DMD does not emit this information when
pragma(startaddress) is used.

Example program:

////////// test.d //////////
import win32.winbase;

void start()
{
    ExitProcess(0);
}

pragma(startaddress, start);
////////////////////////////

When compiling with -m64 or -m32mscoff, the linker complains:

LINK : fatal error LNK1561: entry point must be defined

--


More information about the Digitalmars-d-bugs mailing list