Black Lives Matter. Support the Equal Justice Initiative.

Source file src/cmd/link/testdata/pe-llvm/main.go

Documentation: cmd/link/testdata/pe-llvm

     1  // Copyright 2020 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Test that a PE rsrc section is handled correctly, when the object files
     6  // have been created by llvm-rc or msvc's rc.exe, which means there's the
     7  // @feat.00 symbol as well as split .rsrc$00 and .rsrc$01 section to deal with.
     8  //
     9  // rsrc.syso is created using llvm with:
    10  //    {i686,x86_64,armv7,arm64}-w64-mingw32-windres -i a.rc -o rsrc_$GOARCH.syso -O coff
    11  // where this windres calls into llvm-rc and llvm-cvtres. The source file,
    12  // a.rc, simply contains a reference to its own bytes:
    13  //
    14  //    resname RCDATA a.rc
    15  //
    16  // Object dumping the resultant rsrc.syso, we can see the split sections and
    17  // the @feat.00 SEH symbol:
    18  //
    19  //     rsrc.syso:      file format coff-x86-64
    20  //
    21  //     architecture: x86_64
    22  //     start address: 0x0000000000000000
    23  //
    24  //     Export Table:
    25  //     Sections:
    26  //     Idx Name          Size     VMA              Type
    27  //       0 .rsrc$01      00000068 0000000000000000 DATA
    28  //       1 .rsrc$02      00000018 0000000000000000 DATA
    29  //
    30  //     SYMBOL TABLE:
    31  //     [ 0](sec -1)(fl 0x00)(ty   0)(scl   3) (nx 0) 0x00000011 @feat.00
    32  //     [ 1](sec  1)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .rsrc$01
    33  //     AUX scnlen 0x68 nreloc 1 nlnno 0 checksum 0x0 assoc 0 comdat 0
    34  //     [ 3](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 1) 0x00000000 .rsrc$02
    35  //     AUX scnlen 0x18 nreloc 0 nlnno 0 checksum 0x0 assoc 0 comdat 0
    36  //     [ 5](sec  2)(fl 0x00)(ty   0)(scl   3) (nx 0) 0x00000000 $R000000
    37  //     RELOCATION RECORDS FOR [.rsrc$01]:
    38  //     OFFSET           TYPE                     VALUE
    39  //     0000000000000048 IMAGE_REL_AMD64_ADDR32NB $R000000
    40  
    41  package main
    42  
    43  func main() {}
    44  

View as plain text