X64 calling convention test issue

Discussion in 'Windows Vista Drivers' started by Pamela, Aug 12, 2005.

  1. Pamela

    Pamela Guest

    When I test my 64bit driver with hct12.1, I found that the X64 calling
    convetntion test failed as "There is not enough debug information in
    executable image file". And I tried to add "-Zi" compiler option and
    "-profile" linker option according to HCT document. But I encountered this
    error no matter how to add these opinions or
    not. Even the checked version encounter the same issue.

    Anyone has some ideas about how to set these option correctly? Thanks in
    Pamela, Aug 12, 2005
    1. Advertisements

  2. Pamela

    Joe Guest

    Add the "/debug" and "/debugtype:coff" linker options.
    Joe, Aug 13, 2005
    1. Advertisements

  3. Pamela

    Pamela Guest

    Nice to hear from you.

    When I add /debug and /debugtype:coff to my makefiles file, if build with
    the W2003 checked AMD64 bit build enviroment, There is warning
    " LINK : warning LNK4224: /DEBUGTYPE:COFF is no longer supported; ignored".
    Even I test X64 calling convemtions with this checked version, it still
    fails as"There is not enough debug information in executable image file".

    And in my makefile, the linker and compiler flagss is set as:-
    I wonder if there is any error in this setting.
    Pamela, Aug 15, 2005
  4. Can you report `link -dump -headers` for your driver ?
    Possibly the `exception` directory is not there, or it's incomplete.

    20B magic # (PE32+)

    299B50 [ 16A5] RVA [size] of Export Directory
    297FD0 [ 104] RVA [size] of Import Directory
    2CC000 [ A9C8] RVA [size] of Resource Directory
    2B4000 [ 17C34] RVA [size] of Exception Directory <<<<<<<<<<<<

    Alternatively, can you post the full compiler and linker command lines ?
    Are you using assembly from an external *.ASM file ?
    If yes, do you use correctly leaf and nested entries ?
    Can you repro the problem with the DDK build.exe / SOURCES ?
    Ivan Brugiolo [MSFT], Aug 15, 2005
  5. Pamela

    Pamela Guest

    Thanks for your advise.

    In my driver , there is no assembler. I have replaced all assember code with

    And I found no DDK\SRC which have -Zi and -profile in their sources for
    makefile. Can you indicate which one can pass this test?

    Below is full compiler and linker command lines,
    cl -nologo -Iamd64\ -I. -ID:\WINDDK~1\inc\mfc42 -ID:\WINDDK~1\inc\ddk\wnet
    -Iobjfre_wnet_AMD64\amd64 -ID:\WINDDK~1\inc\wnet -ID:\WINDDK~1\inc\wnet
    -ID:\WINDDK~1\inc\ddk\wdm\wnet -ID:\WINDDK~1\inc\crt -D_WIN64 -D_AMD64_
    -DWINNT=1 -D_WIN32_WINNT=0x0502 /DWINVER=0x0502 -D_WIN32_IE=0x0600
    -DNDEBUG -DPNP_POWER -DUSBCAMD2 /c /Zel /Zp8 /Gy /Gi- -cbstring /W3 /Wp64
    /WX /GX- /GR- /GF -Z7 /Oxt -FID:\WINDDK~1\inc\wnet\warning.h
    /d1noWchar_t .\dbglog.c >>>>>

    Linking f:\projects\64bits\working\driver directory ********************
    'nmake.exe /c BUILDMSG=Stop. -i LINKONLY=1 NOPASS0=1 NTTEST= UMTEST= AMD64=1'
    link -out:eek:bjfre_wnet_AMD64\amd64\P0620Vid.sys -machine:amd64
    Microsoft (R) Incremental Linker Version 8.00.2207
    Copyright (C) Microsoft Corporation. All rights reserved.

    -driver -driver:wdm
    -align:0x0080 /stub:D:\WINDDK~1\lib\wnet\stub512.com

    And below is the link -dump -headers for the driver file,
    Dump of file p0620vid.sys

    PE signature found


    8664 machine (AMD64)
    8 number of sections
    43014D27 time date stamp Tue Aug 16 10:19:19 2005
    0 file pointer to symbol table
    0 number of symbols
    F0 size of optional header
    12E characteristics
    Line numbers stripped
    Symbols stripped
    Application can handle large (>2GB) addresses
    32 bit word machine

    20B magic # (PE32+)
    8.00 linker version
    15880 size of code
    9200 size of initialized data
    0 size of uninitialized data
    BD00 entry point (000000000001BD00) DriverEntry
    500 base of code
    10000 image base (0000000000010000 to 000000000002EF7F)
    80 section alignment
    80 file alignment
    5.02 operating system version
    5.02 image version
    1.10 subsystem version
    0 Win32 version
    1EF80 size of image
    500 size of headers
    2BD53 checksum
    1 subsystem (Native)
    2000 DLL characteristics
    WDM Driver
    40000 size of stack reserve
    1000 size of stack commit
    100000 size of heap reserve
    1000 size of heap commit
    0 loader flags
    10 number of directories
    0 [ 0] RVA [size] of Export Directory
    1E100 [ 50] RVA [size] of Import Directory
    1E880 [ 340] RVA [size] of Resource Directory
    1D580 [ AEC] RVA [size] of Exception Directory
    0 [ 0] RVA [size] of Certificates Directory
    1EC00 [ 288] RVA [size] of Base Relocation Directory
    157F0 [ 1C] RVA [size] of Debug Directory
    0 [ 0] RVA [size] of Architecture Directory
    0 [ 0] RVA [size] of Global Pointer Directory
    0 [ 0] RVA [size] of Thread Storage Directory
    0 [ 0] RVA [size] of Load Configuration Directory
    0 [ 0] RVA [size] of Bound Import Directory
    15600 [ 1E8] RVA [size] of Import Address Table Directory
    0 [ 0] RVA [size] of Delay Import Directory
    0 [ 0] RVA [size] of COM Descriptor Directory
    0 [ 0] RVA [size] of Reserved Directory

    May I know if there is something missing?

    Pamela, Aug 16, 2005
  6. If you compile your code with exactly the DDK defaults, does it pass ?
    If you #ifdef -out the assembly code, does it pass ?

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Use of any included script samples are subject to the terms specified at

    Ivan Brugiolo [MSFT], Aug 16, 2005
  7. Pamela

    Pamela Guest

    If you compile your code with exactly the DDK defaults, does it pass ?
    I built the source driver under /ddk/src/WDM/videoacapture/usbintel, still
    encounter the same error.

    My DDK build enviroment is Windows 2003 DDK + Windows 2000 + Windows
    2003SDK. I wonder is the Windows 2003 SP1 DDK in needed for this test?
    Pamela, Aug 17, 2005
  8. I'm sure there has been compiler changes and exception unwinding
    changes before RTM of Win2003-SP1-X64.

    I remember that binaries compiled with old tools were in fact chocking-out
    in miserable ways while dispathching exceptions,
    and the fix was always to recompile them.
    Ivan Brugiolo [MSFT], Aug 17, 2005
  9. Pamela

    Pamela Guest

    Yes, there is difference among different DDK versions. When I upgraded the
    DDK to W2003 DDK SP1, the source code under DDK\src can pass the X64 calling
    convention test.
    Pamela, Aug 18, 2005
  10. I'm glad that at least the baseline is now estabilished.
    Ivan Brugiolo [MSFT], Aug 18, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.