llvm.org GIT mirror llvm / f16503a
Fix bug in symbol generation for resource COFF Symbols in the resource COFF file should be for .rsrc$02, where the actual resource data is, not .rsrc$01, which contains the directory tree. Differential Revision: https://reviews.llvm.org/D34832 Patch by Joe Ranieri. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306853 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Beckmann 2 years ago
2 changed file(s) with 34 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
571571 Symbol = reinterpret_cast(BufferStart + CurrentOffset);
572572 strncpy(Symbol->Name.ShortName, RelocationName, (size_t)COFF::NameSize);
573573 Symbol->Value = DataOffsets[i];
574 Symbol->SectionNumber = 1;
574 Symbol->SectionNumber = 2;
575575 Symbol->Type = COFF::IMAGE_SYM_DTYPE_NULL;
576576 Symbol->StorageClass = COFF::IMAGE_SYM_CLASS_STATIC;
577577 Symbol->NumberOfAuxSymbols = 0;
0 // Check COFF emission of cvtres
1 // The input was generated with the following command, using the original Windows
2 // rc.exe:
3 // > rc /fo test_resource.res /nologo test_resource.rc
4 // The object file we are comparing against was generated with this command using
5 // the original Windows cvtres.exe.
6 // > cvtres /machine:X86 /readonly /nologo /out:test_resource.obj.coff \
7 // test_resource.res
8
9 RUN: llvm-cvtres /verbose /out:%t %p/Inputs/test_resource.res
10 RUN: llvm-readobj -symbols %t | FileCheck %s
11
12 CHECK: Name: $R000000
13 CHECK-NEXT: Value: 0
14 CHECK-NEXT: Section: .rsrc$02
15 CHECK: Name: $R000018
16 CHECK-NEXT: Value: 24
17 CHECK-NEXT: Section: .rsrc$02
18 CHECK: Name: $R000340
19 CHECK-NEXT: Value: 832
20 CHECK-NEXT: Section: .rsrc$02
21 CHECK: Name: $R000668
22 CHECK-NEXT: Value: 1640
23 CHECK-NEXT: Section: .rsrc$02
24 CHECK: Name: $R000698
25 CHECK-NEXT: Value: 1688
26 CHECK-NEXT: Section: .rsrc$02
27 CHECK: Name: $R000720
28 CHECK-NEXT: Value: 1824
29 CHECK-NEXT: Section: .rsrc$02
30 CHECK: Name: $R000750
31 CHECK-NEXT: Value: 1872
32 CHECK-NEXT: Section: .rsrc$02