从32bit迁移到64bit[2]

>> 如何查看一个DLL是不是64bit

在迁移过程中,需要编译X64的QT。因为编译64bit的方法与32bit一样,不同的就是在调用vcvasall.bat的参数。

---------------------------------------------------------------------------

call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" amd64
subst s: /d
subst s: f:/SolidMCP
cd /d S:\Components\CPlusPlus\QT\QT_4.7.3_Win64
configure -fast -opensource -declarative -confirm-license -platform win32-msvc2008 
nmake
md temp
move lib\*.pdb temp
nmake clean
move temp\*.pdb lib

---------------------------------------------------------------------------

因为编译的结果取决于一个小小的参数,自然有些心里发毛,自然Build结束之后有必要查看一把,到底是不是build了64bit。

Visual Studio自带的dumpbin可以干这个事情,而且还能dump出PE image中的Segments 的一些信息:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\vc\bin>dumpbin /headers  F:\SolidMCP\Components\CPlusPlus\QT\QT_4.6.2_Win64\bin\QtGui4.dll  >c:\dump.txt

-----------------------------------------------------------------------------------

Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file F:\SolidMCP\Components\CPlusPlus\QT\QT_4.6.2_Win64\bin\QtGui4.dll

PE signature found
File Type: DLL


FILE HEADER VALUES
            8664 machine (x64)
               6 number of sections
        4E4BD9D6 time date stamp Wed Aug 17 23:10:14 2011
               0 file pointer to symbol table
               0 number of symbols
              F0 size of optional header
            2022 characteristics
                   Executable
                   Application can handle large (>2GB) addresses
                   DLL

OPTIONAL HEADER VALUES
             20B magic # (PE32+)
            9.00 linker version
          64EE00 size of code
         
.... [200 words are skipped]

SECTION HEADER #1
   .text name
  64EC61 virtual size
    1000 virtual address (0000000065001000 to 000000006564FC60)
  64EE00 size of raw data
    
.... [200 words are skipped]

SECTION HEADER #2
  .rdata name
  2FB104 virtual size
  650000 virtual address (0000000065650000 to 000000006594B103)
  2FB200 size of raw data
 
.... [200 words are skipped]

SECTION HEADER #3
   .data name
    FBD0 virtual size
  94C000 virtual address (000000006594C000 to 000000006595BBCF)
   
.... [200 words are skipped]

SECTION HEADER #4
  .pdata name
   7A154 virtual size
  95C000 virtual address (000000006595C000 to 00000000659D6153)
  
.... [200 words are skipped]

SECTION HEADER #5
   .rsrc name
     5C4 virtual size
  9D7000 virtual address (00000000659D7000 to 00000000659D75C3)
    
.... [200 words are skipped]

SECTION HEADER #6
  .reloc name
   10C66 virtual size
  9D8000 virtual address (00000000659D8000 to 00000000659E8C65)
  
.... [200 words are skipped]

  Summary

       10000 .data
       7B000 .pdata
      2FC000 .rdata
       11000 .reloc
        1000 .rsrc
      64F000 .text
-----------------------------------------------------------------------------------

posted on 2011-07-05 08:04  飘行天下  阅读(660)  评论(0编辑  收藏  举报

导航