[PATCH] D46419: Object: Align resource sections correctly.

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 4 02:08:28 PDT 2018


hans added a comment.

I tried to verify this, but it seems cvtres.exe does not set alignment for the .rsrc sections:

  rc /fo test_resource.res /nologo test_resource.rc && cvtres /machine:X86 /readonly /nologo /out:test_resource.obj.coff test_resource.res && dumpbin /headers test_resource.obj.coff
  test_resource.rc(8) : warning RC4204 : ASCII character not equivalent to virtual key code
  Microsoft (R) COFF/PE Dumper Version 14.12.25834.0
  Copyright (C) Microsoft Corporation.  All rights reserved.
  
  
  Dump of file test_resource.obj.coff
  
  File Type: COFF OBJECT
  
  FILE HEADER VALUES
               14C machine (x86)
                 3 number of sections
          5AEC2266 time date stamp Fri May  4 11:05:42 2018
               C38 file pointer to symbol table
                10 number of symbols
                 0 size of optional header
               100 characteristics
                     32 bit word machine
  
  SECTION HEADER #1
  .debug$S name
         0 physical address
         0 virtual address
       13C size of raw data
        8C file pointer to raw data (0000008C to 000001C7)
         0 file pointer to relocation table
         0 file pointer to line numbers
         0 number of relocations
         0 number of line numbers
  42100040 flags
           Initialized Data
           Discardable
           1 byte align
           Read Only
  
  SECTION HEADER #2
  .rsrc$01 name
         0 physical address
         0 virtual address
       290 size of raw data
       1C8 file pointer to raw data (000001C8 to 00000457)
       458 file pointer to relocation table
         0 file pointer to line numbers
         8 number of relocations
         0 number of line numbers
  40000040 flags
           Initialized Data
           (no align specified)
           Read Only
  
  SECTION HEADER #3
  .rsrc$02 name
         0 physical address
         0 virtual address
       790 size of raw data
       4A8 file pointer to raw data (000004A8 to 00000C37)
         0 file pointer to relocation table
         0 file pointer to line numbers
         0 number of relocations
         0 number of line numbers
  40000040 flags
           Initialized Data
           (no align specified)
           Read Only
  
    Summary
  
           13C .debug$S
           290 .rsrc$01
           790 .rsrc$02


https://reviews.llvm.org/D46419





More information about the llvm-commits mailing list