windows: imported functions in empty program executable

novice2 sorryno at em.ail
Fri Feb 19 19:29:43 UTC 2021


LDC - the LLVM D compiler (1.25.0-beta1)

File test.d contain one line:
void main () {}

Compiled to test.exe by command:
ldc2 -release -O3 test.d

Result test.exe imported many functions, for example delete 
registry, networking.
Is this bug, or i can change something to avoid this imports?

> dumpbin /imports test.exe

'...' - skipped lines

Dump of file test.exe
File Type: EXECUTABLE IMAGE
  Section contains the following imports:
  ...
     WS2_32.dll
        ...
        1E WSACleanup
        2F WSAGetLastError
        3A WSAIoctl
        58 WSAStartup
        A1 accept
        A2 bind
        A3 closesocket
        A4 connect
        A7 gethostbyaddr
        A8 gethostbyname
        AB getpeername
        AC getprotobyname
        AD getprotobynumber
        AE getservbyname
        AF getservbyport
        B0 getsockname
        B1 getsockopt
        B2 htonl
        B4 inet_addr
        B5 inet_ntoa
        B8 ioctlsocket
        B9 listen
        BA ntohl
        BB ntohs
        BC recv
        BD recvfrom
        BF send
        C0 sendto
        C1 setsockopt
        C2 shutdown
        C3 socket
     ...
     ADVAPI32.dll
        25B RegCloseKey
        264 RegCreateKeyExW
        26F RegDeleteKeyW
        273 RegDeleteValueW
        27A RegEnumKeyExW
        27D RegEnumValueW
        27E RegFlushKey
        28C RegOpenKeyExW
        28F RegOpenKeyW
        293 RegQueryInfoKeyW
        299 RegQueryValueExW
        2A9 RegSetValueExW



More information about the digitalmars-d-ldc mailing list