<div dir="ltr">I added some missing fields to the codeview symbol yaml mapping code in r305842 and r305857. This made check-lld msan clean for my locally.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 20, 2017 at 12:58 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Looking. This suggests that yaml2obj doesn't fully initialize certain records before writing them to disk.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 20, 2017 at 11:51 AM, Vitaly Buka <span dir="ltr"><<a href="mailto:vitalybuka@google.com" target="_blank">vitalybuka@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/5789/steps/check-lld%20msan/logs/stdio" target="_blank">http://lab.llvm.org:8011/build<wbr>ers/sanitizer-x86_64-linux-<wbr>fast/builds/5789/steps/check-<wbr>lld%20msan/logs/stdio</a><br><div><br></div><div><pre style="font-family:"Courier New",courier,monotype,monospace;color:rgb(0,0,0);font-size:medium"><span class="m_-8946434709452057674m_-6785930782614982899gmail-stdout">FAIL: lld :: COFF/pdb-comdat.test (73 of 1178)
******************** TEST 'lld :: COFF/pdb-comdat.test' FAILED ********************
Script:
--
rm -rf /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm_build_msan/tools/lld/<wbr>test/COFF/Output/pdb-comdat.<wbr>test.tmp && mkdir -p /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm_build_msan/tools/lld/<wbr>test/COFF/Output/pdb-comdat.<wbr>test.tmp && cd /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm_build_msan/tools/lld/<wbr>test/COFF/Output/pdb-comdat.<wbr>test.tmp
/mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm_build_msan/./bin/yaml2ob<wbr>j /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm/tools/lld/test/COFF/<wbr>Inputs/pdb_comdat_main.yaml -o pdb_comdat_main.obj
/mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm_build_msan/./bin/yaml2ob<wbr>j /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm/tools/lld/test/COFF/<wbr>Inputs/pdb_comdat_bar.yaml -o pdb_comdat_bar.obj
/mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm_build_msan/./bin/lld-<wbr>link pdb_comdat_main.obj pdb_comdat_bar.obj -out:t.exe -debug -pdb:t.pdb -nodefaultlib -entry:main
/mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm_build_msan/./bin/llvm-<wbr>pdbutil raw -l t.pdb | /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm_build_msan/./bin/FileChe<wbr>ck /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm/tools/lld/test/COFF/pdb-<wbr>comdat.test
/mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm_build_msan/./bin/lld-<wbr>link pdb_comdat_bar.obj pdb_comdat_main.obj -out:t.exe -debug -pdb:t.pdb -nodefaultlib -entry:main
/mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm_build_msan/./bin/llvm-<wbr>pdbutil raw -l t.pdb | /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm_build_msan/./bin/FileChe<wbr>ck /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm/tools/lld/test/COFF/pdb-<wbr>comdat.test --check-prefix=REORDER
--
Exit Code: 77
Command Output (stderr):
--
Uninitialized bytes in __interceptor_write at offset 692 inside [0x720000025000, 2337)
==19002==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x6c107a in llvm::raw_fd_ostream::write_im<wbr>pl(char const*, unsigned long) /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm/lib/Support/raw_ostream.<wbr>cpp:564:19
#1 0x49ed5b in flush /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm/include/llvm/Support/<wbr>raw_ostream.h:142:7
#2 0x49ed5b in main /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm/tools/yaml2obj/yaml2obj.<wbr>cpp:98
#3 0x7fde6ba3182f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so<wbr>.6+0x2082f)
#4 0x433e88 in _start (/mnt/b/sanitizer-buildbot3/sa<wbr>nitizer-x86_64-linux-fast/buil<wbr>d/llvm_build_msan/bin/yaml2obj<wbr>+0x433e88)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /mnt/b/sanitizer-buildbot3/san<wbr>itizer-x86_64-linux-fast/build<wbr>/llvm/lib/Support/raw_ostream.<wbr>cpp:564:19 in llvm::raw_fd_ostream::write_im<wbr>pl(char const*, unsigned long)
Exiting
--
********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 16.05s
********************
Failing Tests (1):
lld :: COFF/pdb-comdat.test</span></pre></div></div><div class="m_-8946434709452057674HOEnZb"><div class="m_-8946434709452057674h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 20, 2017 at 10:14 AM, Reid Kleckner via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rnk<br>
Date: Tue Jun 20 12:14:09 2017<br>
New Revision: 305811<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=305811&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=305811&view=rev</a><br>
Log:<br>
[PDB] Don't emit debug info associated with dead chunks<br>
<br>
Summary:<br>
Previously we didn't add debug info chunks to the SparseChunks array, so<br>
they didn't participate in section GC. Now we do.<br>
<br>
Reviewers: ruiu<br>
<br>
Subscribers: aprantl, llvm-commits<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D34356" rel="noreferrer" target="_blank">https://reviews.llvm.org/D3435<wbr>6</a><br>
<br>
Added:<br>
lld/trunk/test/COFF/Inputs/pdb<wbr>_comdat_bar.yaml<br>
lld/trunk/test/COFF/Inputs/pdb<wbr>_comdat_main.yaml<br>
lld/trunk/test/COFF/pdb-comdat<wbr>.test<br>
Modified:<br>
lld/trunk/COFF/Chunks.h<br>
lld/trunk/COFF/InputFiles.cpp<br>
lld/trunk/COFF/PDB.cpp<br>
lld/trunk/COFF/Writer.cpp<br>
<br>
Modified: lld/trunk/COFF/Chunks.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Chunks.h?rev=305811&r1=305810&r2=305811&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/lld/trunk/COFF/Chunks.h?<wbr>rev=305811&r1=305810&r2=305811<wbr>&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/COFF/Chunks.h (original)<br>
+++ lld/trunk/COFF/Chunks.h Tue Jun 20 12:14:09 2017<br>
@@ -177,6 +177,12 @@ public:<br>
// redundant when GC is enabled, as all comdat sections will start out dead.<br>
void markDiscarded() { Discarded = true; }<br>
<br>
+ // True if this is a codeview debug info chunk. These will not be laid out in<br>
+ // the image. Instead they will end up in the PDB, if one is requested.<br>
+ bool isCodeView() const {<br>
+ return SectionName == ".debug" || SectionName.startswith(".debug<wbr>$");<br>
+ }<br>
+<br>
// Allow iteration over the bodies of this chunk's relocated symbols.<br>
llvm::iterator_range<symbol_i<wbr>terator> symbols() const {<br>
return llvm::make_range(symbol_iterat<wbr>or(File, Relocs.begin()),<br>
<br>
Modified: lld/trunk/COFF/InputFiles.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/InputFiles.cpp?rev=305811&r1=305810&r2=305811&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/lld/trunk/COFF/InputFile<wbr>s.cpp?rev=305811&r1=305810&r2=<wbr>305811&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/COFF/InputFiles.cpp (original)<br>
+++ lld/trunk/COFF/InputFiles.cpp Tue Jun 20 12:14:09 2017<br>
@@ -132,17 +132,17 @@ void ObjectFile::initializeChunks() {<br>
if (!Config->Debug && Name.startswith(".debug"))<br>
continue;<br>
<br>
- // CodeView sections are stored to a different vector because they are<br>
- // not linked in the regular manner.<br>
- if (Name == ".debug" || Name.startswith(".debug$")) {<br>
- DebugChunks.push_back(make<Sec<wbr>tionChunk>(this, Sec));<br>
- continue;<br>
- }<br>
-<br>
if (Sec->Characteristics & llvm::COFF::IMAGE_SCN_LNK_REMO<wbr>VE)<br>
continue;<br>
auto *C = make<SectionChunk>(this, Sec);<br>
- Chunks.push_back(C);<br>
+<br>
+ // CodeView sections are stored to a different vector because they are not<br>
+ // linked in the regular manner.<br>
+ if (C->isCodeView())<br>
+ DebugChunks.push_back(C);<br>
+ else<br>
+ Chunks.push_back(C);<br>
+<br>
SparseChunks[I] = C;<br>
}<br>
}<br>
<br>
Modified: lld/trunk/COFF/PDB.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/PDB.cpp?rev=305811&r1=305810&r2=305811&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/lld/trunk/COFF/PDB.cpp?r<wbr>ev=305811&r1=305810&r2=305811&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/COFF/PDB.cpp (original)<br>
+++ lld/trunk/COFF/PDB.cpp Tue Jun 20 12:14:09 2017<br>
@@ -164,10 +164,7 @@ static void addObjectsToPDB(BumpPtrAlloc<br>
<br>
// Now do all line info.<br>
for (SectionChunk *DebugChunk : File->getDebugChunks()) {<br>
- // FIXME: Debug chunks do not have a correct isLive() bit.<br>
- // FIXME: When linker GC is off we need to ignore debug info whose<br>
- // associated symbol was discarded.<br>
- if (DebugChunk->getSectionName() != ".debug$S")<br>
+ if (!DebugChunk->isLive() || DebugChunk->getSectionName() != ".debug$S")<br>
continue;<br>
<br>
ArrayRef<uint8_t> RelocatedDebugContents =<br>
<br>
Modified: lld/trunk/COFF/Writer.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Writer.cpp?rev=305811&r1=305810&r2=305811&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/lld/trunk/COFF/Writer.cp<wbr>p?rev=305811&r1=305810&r2=3058<wbr>11&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/COFF/Writer.cpp (original)<br>
+++ lld/trunk/COFF/Writer.cpp Tue Jun 20 12:14:09 2017<br>
@@ -445,9 +445,12 @@ Optional<coff_symbol16> Writer::createSy<br>
if (isa<DefinedRelative>(Def))<br>
return None;<br>
<br>
- if (auto *D = dyn_cast<DefinedRegular>(Def))<br>
- if (!D->getChunk()->isLive())<br>
+ if (auto *D = dyn_cast<DefinedRegular>(Def)) {<br>
+ // Don't write dead symbols or symbols in codeview sections to the symbol<br>
+ // table.<br>
+ if (!D->getChunk()->isLive() || D->getChunk()->isCodeView())<br>
return None;<br>
+ }<br>
<br>
if (auto *Sym = dyn_cast<DefinedImportData>(De<wbr>f))<br>
if (!Sym->File->Live)<br>
<br>
Added: lld/trunk/test/COFF/Inputs/pdb<wbr>_comdat_bar.yaml<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/Inputs/pdb_comdat_bar.yaml?rev=305811&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/lld/trunk/test/COFF/Inpu<wbr>ts/pdb_comdat_bar.yaml?rev=305<wbr>811&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/test/COFF/Inputs/pdb<wbr>_comdat_bar.yaml (added)<br>
+++ lld/trunk/test/COFF/Inputs/pdb<wbr>_comdat_bar.yaml Tue Jun 20 12:14:09 2017<br>
@@ -0,0 +1,440 @@<br>
+--- !COFF<br>
+header:<br>
+ Machine: IMAGE_FILE_MACHINE_AMD64<br>
+ Characteristics: [ ]<br>
+sections:<br>
+ - Name: .drectve<br>
+ Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]<br>
+ Alignment: 1<br>
+ SectionData: 2020202F44454641554C544C49423<wbr>A224C4942434D5422202F444546415<wbr>54C544C49423A224F4C444E414D455<wbr>32220<br>
+ - Name: '.debug$S'<br>
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA<wbr>, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 1<br>
+ Subsections:<br>
+ - !Symbols<br>
+ Records:<br>
+ - Kind: S_OBJNAME<br>
+ ObjNameSym:<br>
+ Signature: 0<br>
+ ObjectName: 'C:\src\llvm-project\build\pdb<wbr>_comdat_bar.obj'<br>
+ - Kind: S_COMPILE3<br>
+ Compile3Sym:<br>
+ Flags: [ SecurityChecks, HotPatch ]<br>
+ Machine: X64<br>
+ FrontendMajor: 19<br>
+ FrontendMinor: 0<br>
+ FrontendBuild: 24215<br>
+ FrontendQFE: 1<br>
+ BackendMajor: 19<br>
+ BackendMinor: 0<br>
+ BackendBuild: 24215<br>
+ BackendQFE: 1<br>
+ Version: 'Microsoft (R) Optimizing Compiler'<br>
+ - !Symbols<br>
+ Records:<br>
+ - Kind: S_GPROC32_ID<br>
+ ProcSym:<br>
+ PtrParent: 0<br>
+ PtrEnd: 0<br>
+ PtrNext: 0<br>
+ CodeSize: 14<br>
+ DbgStart: 4<br>
+ DbgEnd: 9<br>
+ FunctionType: 4102<br>
+ Segment: 0<br>
+ Flags: [ ]<br>
+ DisplayName: bar<br>
+ - Kind: S_FRAMEPROC<br>
+ FrameProcSym:<br>
+ TotalFrameBytes: 40<br>
+ PaddingFrameBytes: 0<br>
+ OffsetToPadding: 0<br>
+ BytesOfCalleeSavedRegisters: 0<br>
+ OffsetOfExceptionHandler: 0<br>
+ SectionIdOfExceptionHandler: 0<br>
+ Flags: [ AsynchronousExceptionHandling, OptimizedForSpeed ]<br>
+ - Kind: S_PROC_ID_END<br>
+ ScopeEndSym:<br>
+ - !Lines<br>
+ CodeSize: 14<br>
+ Flags: [ ]<br>
+ RelocOffset: 0<br>
+ RelocSegment: 0<br>
+ Blocks:<br>
+ - FileName: 'c:\src\llvm-project\build\pdb<wbr>_comdat_bar.c'<br>
+ Lines:<br>
+ - Offset: 0<br>
+ LineStart: 3<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ - Offset: 4<br>
+ LineStart: 4<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ - Offset: 9<br>
+ LineStart: 5<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ Columns:<br>
+ - !Symbols<br>
+ Records:<br>
+ - Kind: S_GDATA32<br>
+ DataSym:<br>
+ Type: 116<br>
+ DisplayName: global<br>
+ - !FileChecksums<br>
+ Checksums:<br>
+ - FileName: 'c:\src\llvm-project\build\pdb<wbr>_comdat_bar.c'<br>
+ Kind: MD5<br>
+ Checksum: 365279DB4FCBEDD721BBFC3B14A953<wbr>C2<br>
+ - FileName: 'c:\src\llvm-project\build\foo<wbr>.h'<br>
+ Kind: MD5<br>
+ Checksum: D74D834EFAC3AE2B45E606A8320B1D<wbr>5C<br>
+ - !StringTable<br>
+ Strings:<br>
+ - 'c:\src\llvm-project\build\pdb<wbr>_comdat_bar.c'<br>
+ - 'c:\src\llvm-project\build\foo<wbr>.h'<br>
+ - !Symbols<br>
+ Records:<br>
+ - Kind: S_BUILDINFO<br>
+ BuildInfoSym:<br>
+ BuildId: 4110<br>
+ Relocations:<br>
+ - VirtualAddress: 168<br>
+ SymbolName: bar<br>
+ Type: IMAGE_REL_AMD64_SECREL<br>
+ - VirtualAddress: 172<br>
+ SymbolName: bar<br>
+ Type: IMAGE_REL_AMD64_SECTION<br>
+ - VirtualAddress: 224<br>
+ SymbolName: bar<br>
+ Type: IMAGE_REL_AMD64_SECREL<br>
+ - VirtualAddress: 228<br>
+ SymbolName: bar<br>
+ Type: IMAGE_REL_AMD64_SECTION<br>
+ - VirtualAddress: 288<br>
+ SymbolName: global<br>
+ Type: IMAGE_REL_AMD64_SECREL<br>
+ - VirtualAddress: 292<br>
+ SymbolName: global<br>
+ Type: IMAGE_REL_AMD64_SECTION<br>
+ - Name: '.debug$T'<br>
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA<wbr>, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 1<br>
+ Types:<br>
+ - Kind: LF_ARGLIST<br>
+ ArgList:<br>
+ ArgIndices: [ 0 ]<br>
+ - Kind: LF_PROCEDURE<br>
+ Procedure:<br>
+ ReturnType: 3<br>
+ CallConv: NearC<br>
+ Options: [ None ]<br>
+ ParameterCount: 0<br>
+ ArgumentList: 4096<br>
+ - Kind: LF_POINTER<br>
+ Pointer:<br>
+ ReferentType: 4097<br>
+ Attrs: 65548<br>
+ - Kind: LF_FUNC_ID<br>
+ FuncId:<br>
+ ParentScope: 0<br>
+ FunctionType: 4097<br>
+ Name: foo<br>
+ - Kind: LF_ARGLIST<br>
+ ArgList:<br>
+ ArgIndices: [ ]<br>
+ - Kind: LF_PROCEDURE<br>
+ Procedure:<br>
+ ReturnType: 3<br>
+ CallConv: NearC<br>
+ Options: [ None ]<br>
+ ParameterCount: 0<br>
+ ArgumentList: 4100<br>
+ - Kind: LF_FUNC_ID<br>
+ FuncId:<br>
+ ParentScope: 0<br>
+ FunctionType: 4101<br>
+ Name: bar<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 0<br>
+ String: 'C:\src\llvm-project\build'<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 0<br>
+ String: 'C:\PROGRA~2\MICROS~1.0\VC\Bin<wbr>\amd64\cl.exe'<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 0<br>
+ String: '-c -Z7 -MT -IC:\PROGRA~2\MICROS~1.0\VC\in<wbr>clude -IC:\PROGRA~2\MICROS~1.0\VC\at<wbr>lmfc\include -IC:\PROGRA~2\WI3CF2~1\10\incl<wbr>ude\10.0.14393.0\ucrt -IC:\PROGRA~2\WI3CF2~1\10\incl<wbr>ude\10.0.14393.0\shared -IC:\PROGRA~2\WI3CF2~1\10\incl<wbr>ude\10.0.14393.0\um'<br>
+ - Kind: LF_SUBSTR_LIST<br>
+ StringList:<br>
+ StringIndices: [ 4105 ]<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 4106<br>
+ String: ' -IC:\PROGRA~2\WI3CF2~1\10\incl<wbr>ude\10.0.14393.0\winrt -TC -X'<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 0<br>
+ String: pdb_comdat_bar.c<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 0<br>
+ String: 'C:\src\llvm-project\build\vc1<wbr>40.pdb'<br>
+ - Kind: LF_BUILDINFO<br>
+ BuildInfo:<br>
+ ArgIndices: [ 4103, 4104, 4108, 4109, 4107 ]<br>
+ - Name: .bss<br>
+ Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DA<wbr>TA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]<br>
+ Alignment: 4<br>
+ SectionData: ''<br>
+ - Name: '.text$mn'<br>
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 16<br>
+ SectionData: 4883EC28E8000000004883C428C3<br>
+ Relocations:<br>
+ - VirtualAddress: 5<br>
+ SymbolName: foo<br>
+ Type: IMAGE_REL_AMD64_REL32<br>
+ - Name: '.text$mn'<br>
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 16<br>
+ SectionData: 8B0500000000FFC0890500000000C<wbr>3<br>
+ Relocations:<br>
+ - VirtualAddress: 2<br>
+ SymbolName: global<br>
+ Type: IMAGE_REL_AMD64_REL32<br>
+ - VirtualAddress: 10<br>
+ SymbolName: global<br>
+ Type: IMAGE_REL_AMD64_REL32<br>
+ - Name: '.debug$S'<br>
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA<wbr>, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 1<br>
+ Subsections:<br>
+ - !Symbols<br>
+ Records:<br>
+ - Kind: S_GPROC32_ID<br>
+ ProcSym:<br>
+ PtrParent: 0<br>
+ PtrEnd: 0<br>
+ PtrNext: 0<br>
+ CodeSize: 15<br>
+ DbgStart: 0<br>
+ DbgEnd: 14<br>
+ FunctionType: 4099<br>
+ Segment: 0<br>
+ Flags: [ ]<br>
+ DisplayName: foo<br>
+ - Kind: S_FRAMEPROC<br>
+ FrameProcSym:<br>
+ TotalFrameBytes: 0<br>
+ PaddingFrameBytes: 0<br>
+ OffsetToPadding: 0<br>
+ BytesOfCalleeSavedRegisters: 0<br>
+ OffsetOfExceptionHandler: 0<br>
+ SectionIdOfExceptionHandler: 0<br>
+ Flags: [ MarkedInline, AsynchronousExceptionHandling, OptimizedForSpeed ]<br>
+ - Kind: S_PROC_ID_END<br>
+ ScopeEndSym:<br>
+ - !Lines<br>
+ CodeSize: 15<br>
+ Flags: [ ]<br>
+ RelocOffset: 0<br>
+ RelocSegment: 0<br>
+ Blocks:<br>
+ - FileName: 'c:\src\llvm-project\build\foo<wbr>.h'<br>
+ Lines:<br>
+ - Offset: 0<br>
+ LineStart: 2<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ - Offset: 0<br>
+ LineStart: 3<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ - Offset: 14<br>
+ LineStart: 4<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ Columns:<br>
+ Relocations:<br>
+ - VirtualAddress: 44<br>
+ SymbolName: foo<br>
+ Type: IMAGE_REL_AMD64_SECREL<br>
+ - VirtualAddress: 48<br>
+ SymbolName: foo<br>
+ Type: IMAGE_REL_AMD64_SECTION<br>
+ - VirtualAddress: 100<br>
+ SymbolName: foo<br>
+ Type: IMAGE_REL_AMD64_SECREL<br>
+ - VirtualAddress: 104<br>
+ SymbolName: foo<br>
+ Type: IMAGE_REL_AMD64_SECTION<br>
+ - Name: .xdata<br>
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA<wbr>, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 4<br>
+ SectionData: '0104010004420000'<br>
+ - Name: .pdata<br>
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA<wbr>, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 4<br>
+ SectionData: '000000000E00000000000000'<br>
+ Relocations:<br>
+ - VirtualAddress: 0<br>
+ SymbolName: '$LN3'<br>
+ Type: IMAGE_REL_AMD64_ADDR32NB<br>
+ - VirtualAddress: 4<br>
+ SymbolName: '$LN3'<br>
+ Type: IMAGE_REL_AMD64_ADDR32NB<br>
+ - VirtualAddress: 8<br>
+ SymbolName: '$unwind$bar'<br>
+ Type: IMAGE_REL_AMD64_ADDR32NB<br>
+symbols:<br>
+ - Name: .drectve<br>
+ Value: 0<br>
+ SectionNumber: 1<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 47<br>
+ NumberOfRelocations: 0<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 0<br>
+ Number: 0<br>
+ - Name: '.debug$S'<br>
+ Value: 0<br>
+ SectionNumber: 2<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 460<br>
+ NumberOfRelocations: 6<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 0<br>
+ Number: 0<br>
+ - Name: '.debug$T'<br>
+ Value: 0<br>
+ SectionNumber: 3<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 628<br>
+ NumberOfRelocations: 0<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 0<br>
+ Number: 0<br>
+ - Name: .bss<br>
+ Value: 0<br>
+ SectionNumber: 4<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 4<br>
+ NumberOfRelocations: 0<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 0<br>
+ Number: 0<br>
+ - Name: global<br>
+ Value: 0<br>
+ SectionNumber: 4<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL<br>
+ - Name: '.text$mn'<br>
+ Value: 0<br>
+ SectionNumber: 5<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 14<br>
+ NumberOfRelocations: 1<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 1682752513<br>
+ Number: 0<br>
+ - Name: '.text$mn'<br>
+ Value: 0<br>
+ SectionNumber: 6<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 15<br>
+ NumberOfRelocations: 2<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 1746394828<br>
+ Number: 0<br>
+ Selection: IMAGE_COMDAT_SELECT_ANY<br>
+ - Name: '.debug$S'<br>
+ Value: 0<br>
+ SectionNumber: 7<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 148<br>
+ NumberOfRelocations: 4<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 0<br>
+ Number: 6<br>
+ Selection: IMAGE_COMDAT_SELECT_ASSOCIATI<wbr>VE<br>
+ - Name: foo<br>
+ Value: 0<br>
+ SectionNumber: 6<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_FUNCTION<br>
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL<br>
+ - Name: bar<br>
+ Value: 0<br>
+ SectionNumber: 5<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_FUNCTION<br>
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL<br>
+ - Name: '$LN3'<br>
+ Value: 0<br>
+ SectionNumber: 5<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_LABEL<br>
+ - Name: .xdata<br>
+ Value: 0<br>
+ SectionNumber: 8<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 8<br>
+ NumberOfRelocations: 0<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 264583633<br>
+ Number: 0<br>
+ - Name: '$unwind$bar'<br>
+ Value: 0<br>
+ SectionNumber: 8<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ - Name: .pdata<br>
+ Value: 0<br>
+ SectionNumber: 9<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 12<br>
+ NumberOfRelocations: 3<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 361370162<br>
+ Number: 0<br>
+ - Name: '$pdata$bar'<br>
+ Value: 0<br>
+ SectionNumber: 9<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+...<br>
<br>
Added: lld/trunk/test/COFF/Inputs/pdb<wbr>_comdat_main.yaml<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/Inputs/pdb_comdat_main.yaml?rev=305811&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/lld/trunk/test/COFF/Inpu<wbr>ts/pdb_comdat_main.yaml?rev=30<wbr>5811&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/test/COFF/Inputs/pdb<wbr>_comdat_main.yaml (added)<br>
+++ lld/trunk/test/COFF/Inputs/pdb<wbr>_comdat_main.yaml Tue Jun 20 12:14:09 2017<br>
@@ -0,0 +1,446 @@<br>
+--- !COFF<br>
+header:<br>
+ Machine: IMAGE_FILE_MACHINE_AMD64<br>
+ Characteristics: [ ]<br>
+sections:<br>
+ - Name: .drectve<br>
+ Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ]<br>
+ Alignment: 1<br>
+ SectionData: 2020202F44454641554C544C49423<wbr>A224C4942434D5422202F444546415<wbr>54C544C49423A224F4C444E414D455<wbr>32220<br>
+ - Name: '.debug$S'<br>
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA<wbr>, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 1<br>
+ Subsections:<br>
+ - !Symbols<br>
+ Records:<br>
+ - Kind: S_OBJNAME<br>
+ ObjNameSym:<br>
+ Signature: 0<br>
+ ObjectName: 'C:\src\llvm-project\build\pdb<wbr>_comdat_main.obj'<br>
+ - Kind: S_COMPILE3<br>
+ Compile3Sym:<br>
+ Flags: [ SecurityChecks, HotPatch ]<br>
+ Machine: X64<br>
+ FrontendMajor: 19<br>
+ FrontendMinor: 0<br>
+ FrontendBuild: 24215<br>
+ FrontendQFE: 1<br>
+ BackendMajor: 19<br>
+ BackendMinor: 0<br>
+ BackendBuild: 24215<br>
+ BackendQFE: 1<br>
+ Version: 'Microsoft (R) Optimizing Compiler'<br>
+ - !Symbols<br>
+ Records:<br>
+ - Kind: S_GPROC32_ID<br>
+ ProcSym:<br>
+ PtrParent: 0<br>
+ PtrEnd: 0<br>
+ PtrNext: 0<br>
+ CodeSize: 24<br>
+ DbgStart: 4<br>
+ DbgEnd: 19<br>
+ FunctionType: 4102<br>
+ Segment: 0<br>
+ Flags: [ ]<br>
+ DisplayName: main<br>
+ - Kind: S_FRAMEPROC<br>
+ FrameProcSym:<br>
+ TotalFrameBytes: 40<br>
+ PaddingFrameBytes: 0<br>
+ OffsetToPadding: 0<br>
+ BytesOfCalleeSavedRegisters: 0<br>
+ OffsetOfExceptionHandler: 0<br>
+ SectionIdOfExceptionHandler: 0<br>
+ Flags: [ AsynchronousExceptionHandling, OptimizedForSpeed ]<br>
+ - Kind: S_PROC_ID_END<br>
+ ScopeEndSym:<br>
+ - !Lines<br>
+ CodeSize: 24<br>
+ Flags: [ ]<br>
+ RelocOffset: 0<br>
+ RelocSegment: 0<br>
+ Blocks:<br>
+ - FileName: 'c:\src\llvm-project\build\pdb<wbr>_comdat_main.c'<br>
+ Lines:<br>
+ - Offset: 0<br>
+ LineStart: 2<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ - Offset: 4<br>
+ LineStart: 3<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ - Offset: 9<br>
+ LineStart: 4<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ - Offset: 14<br>
+ LineStart: 5<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ - Offset: 19<br>
+ LineStart: 6<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ Columns:<br>
+ - !Symbols<br>
+ Records:<br>
+ - Kind: S_GDATA32<br>
+ DataSym:<br>
+ Type: 116<br>
+ DisplayName: global<br>
+ - !FileChecksums<br>
+ Checksums:<br>
+ - FileName: 'c:\src\llvm-project\build\pdb<wbr>_comdat_main.c'<br>
+ Kind: MD5<br>
+ Checksum: F969E51BBE373436D81492EB61387F<wbr>36<br>
+ - FileName: 'c:\src\llvm-project\build\foo<wbr>.h'<br>
+ Kind: MD5<br>
+ Checksum: D74D834EFAC3AE2B45E606A8320B1D<wbr>5C<br>
+ - !StringTable<br>
+ Strings:<br>
+ - 'c:\src\llvm-project\build\pdb<wbr>_comdat_main.c'<br>
+ - 'c:\src\llvm-project\build\foo<wbr>.h'<br>
+ - !Symbols<br>
+ Records:<br>
+ - Kind: S_BUILDINFO<br>
+ BuildInfoSym:<br>
+ BuildId: 4111<br>
+ Relocations:<br>
+ - VirtualAddress: 168<br>
+ SymbolName: main<br>
+ Type: IMAGE_REL_AMD64_SECREL<br>
+ - VirtualAddress: 172<br>
+ SymbolName: main<br>
+ Type: IMAGE_REL_AMD64_SECTION<br>
+ - VirtualAddress: 224<br>
+ SymbolName: main<br>
+ Type: IMAGE_REL_AMD64_SECREL<br>
+ - VirtualAddress: 228<br>
+ SymbolName: main<br>
+ Type: IMAGE_REL_AMD64_SECTION<br>
+ - VirtualAddress: 304<br>
+ SymbolName: global<br>
+ Type: IMAGE_REL_AMD64_SECREL<br>
+ - VirtualAddress: 308<br>
+ SymbolName: global<br>
+ Type: IMAGE_REL_AMD64_SECTION<br>
+ - Name: '.debug$T'<br>
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA<wbr>, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 1<br>
+ Types:<br>
+ - Kind: LF_ARGLIST<br>
+ ArgList:<br>
+ ArgIndices: [ 0 ]<br>
+ - Kind: LF_PROCEDURE<br>
+ Procedure:<br>
+ ReturnType: 3<br>
+ CallConv: NearC<br>
+ Options: [ None ]<br>
+ ParameterCount: 0<br>
+ ArgumentList: 4096<br>
+ - Kind: LF_POINTER<br>
+ Pointer:<br>
+ ReferentType: 4097<br>
+ Attrs: 65548<br>
+ - Kind: LF_FUNC_ID<br>
+ FuncId:<br>
+ ParentScope: 0<br>
+ FunctionType: 4097<br>
+ Name: foo<br>
+ - Kind: LF_ARGLIST<br>
+ ArgList:<br>
+ ArgIndices: [ ]<br>
+ - Kind: LF_PROCEDURE<br>
+ Procedure:<br>
+ ReturnType: 116<br>
+ CallConv: NearC<br>
+ Options: [ None ]<br>
+ ParameterCount: 0<br>
+ ArgumentList: 4100<br>
+ - Kind: LF_FUNC_ID<br>
+ FuncId:<br>
+ ParentScope: 0<br>
+ FunctionType: 4101<br>
+ Name: main<br>
+ - Kind: LF_FUNC_ID<br>
+ FuncId:<br>
+ ParentScope: 0<br>
+ FunctionType: 4097<br>
+ Name: bar<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 0<br>
+ String: 'C:\src\llvm-project\build'<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 0<br>
+ String: 'C:\PROGRA~2\MICROS~1.0\VC\Bin<wbr>\amd64\cl.exe'<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 0<br>
+ String: '-c -Z7 -MT -IC:\PROGRA~2\MICROS~1.0\VC\in<wbr>clude -IC:\PROGRA~2\MICROS~1.0\VC\at<wbr>lmfc\include -IC:\PROGRA~2\WI3CF2~1\10\incl<wbr>ude\10.0.14393.0\ucrt -IC:\PROGRA~2\WI3CF2~1\10\incl<wbr>ude\10.0.14393.0\shared -IC:\PROGRA~2\WI3CF2~1\10\incl<wbr>ude\10.0.14393.0\um'<br>
+ - Kind: LF_SUBSTR_LIST<br>
+ StringList:<br>
+ StringIndices: [ 4106 ]<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 4107<br>
+ String: ' -IC:\PROGRA~2\WI3CF2~1\10\incl<wbr>ude\10.0.14393.0\winrt -TC -X'<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 0<br>
+ String: pdb_comdat_main.c<br>
+ - Kind: LF_STRING_ID<br>
+ StringId:<br>
+ Id: 0<br>
+ String: 'C:\src\llvm-project\build\vc1<wbr>40.pdb'<br>
+ - Kind: LF_BUILDINFO<br>
+ BuildInfo:<br>
+ ArgIndices: [ 4104, 4105, 4109, 4110, 4108 ]<br>
+ - Name: '.text$mn'<br>
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 16<br>
+ SectionData: 4883EC28E800000000E800000000B<wbr>82A0000004883C428C3<br>
+ Relocations:<br>
+ - VirtualAddress: 5<br>
+ SymbolName: foo<br>
+ Type: IMAGE_REL_AMD64_REL32<br>
+ - VirtualAddress: 10<br>
+ SymbolName: bar<br>
+ Type: IMAGE_REL_AMD64_REL32<br>
+ - Name: '.text$mn'<br>
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 16<br>
+ SectionData: 8B0500000000FFC0890500000000C<wbr>3<br>
+ Relocations:<br>
+ - VirtualAddress: 2<br>
+ SymbolName: global<br>
+ Type: IMAGE_REL_AMD64_REL32<br>
+ - VirtualAddress: 10<br>
+ SymbolName: global<br>
+ Type: IMAGE_REL_AMD64_REL32<br>
+ - Name: '.debug$S'<br>
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA<wbr>, IMAGE_SCN_LNK_COMDAT, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 1<br>
+ Subsections:<br>
+ - !Symbols<br>
+ Records:<br>
+ - Kind: S_GPROC32_ID<br>
+ ProcSym:<br>
+ PtrParent: 0<br>
+ PtrEnd: 0<br>
+ PtrNext: 0<br>
+ CodeSize: 15<br>
+ DbgStart: 0<br>
+ DbgEnd: 14<br>
+ FunctionType: 4099<br>
+ Segment: 0<br>
+ Flags: [ ]<br>
+ DisplayName: foo<br>
+ - Kind: S_FRAMEPROC<br>
+ FrameProcSym:<br>
+ TotalFrameBytes: 0<br>
+ PaddingFrameBytes: 0<br>
+ OffsetToPadding: 0<br>
+ BytesOfCalleeSavedRegisters: 0<br>
+ OffsetOfExceptionHandler: 0<br>
+ SectionIdOfExceptionHandler: 0<br>
+ Flags: [ MarkedInline, AsynchronousExceptionHandling, OptimizedForSpeed ]<br>
+ - Kind: S_PROC_ID_END<br>
+ ScopeEndSym:<br>
+ - !Lines<br>
+ CodeSize: 15<br>
+ Flags: [ ]<br>
+ RelocOffset: 0<br>
+ RelocSegment: 0<br>
+ Blocks:<br>
+ - FileName: 'c:\src\llvm-project\build\foo<wbr>.h'<br>
+ Lines:<br>
+ - Offset: 0<br>
+ LineStart: 2<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ - Offset: 0<br>
+ LineStart: 3<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ - Offset: 14<br>
+ LineStart: 4<br>
+ IsStatement: true<br>
+ EndDelta: 0<br>
+ Columns:<br>
+ Relocations:<br>
+ - VirtualAddress: 44<br>
+ SymbolName: foo<br>
+ Type: IMAGE_REL_AMD64_SECREL<br>
+ - VirtualAddress: 48<br>
+ SymbolName: foo<br>
+ Type: IMAGE_REL_AMD64_SECTION<br>
+ - VirtualAddress: 100<br>
+ SymbolName: foo<br>
+ Type: IMAGE_REL_AMD64_SECREL<br>
+ - VirtualAddress: 104<br>
+ SymbolName: foo<br>
+ Type: IMAGE_REL_AMD64_SECTION<br>
+ - Name: .xdata<br>
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA<wbr>, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 4<br>
+ SectionData: '0104010004420000'<br>
+ - Name: .pdata<br>
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA<wbr>, IMAGE_SCN_MEM_READ ]<br>
+ Alignment: 4<br>
+ SectionData: '000000001800000000000000'<br>
+ Relocations:<br>
+ - VirtualAddress: 0<br>
+ SymbolName: '$LN3'<br>
+ Type: IMAGE_REL_AMD64_ADDR32NB<br>
+ - VirtualAddress: 4<br>
+ SymbolName: '$LN3'<br>
+ Type: IMAGE_REL_AMD64_ADDR32NB<br>
+ - VirtualAddress: 8<br>
+ SymbolName: '$unwind$main'<br>
+ Type: IMAGE_REL_AMD64_ADDR32NB<br>
+symbols:<br>
+ - Name: .drectve<br>
+ Value: 0<br>
+ SectionNumber: 1<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 47<br>
+ NumberOfRelocations: 0<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 0<br>
+ Number: 0<br>
+ - Name: '.debug$S'<br>
+ Value: 0<br>
+ SectionNumber: 2<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 480<br>
+ NumberOfRelocations: 6<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 0<br>
+ Number: 0<br>
+ - Name: '.debug$T'<br>
+ Value: 0<br>
+ SectionNumber: 3<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 648<br>
+ NumberOfRelocations: 0<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 0<br>
+ Number: 0<br>
+ - Name: '.text$mn'<br>
+ Value: 0<br>
+ SectionNumber: 4<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 24<br>
+ NumberOfRelocations: 2<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 492663294<br>
+ Number: 0<br>
+ - Name: '.text$mn'<br>
+ Value: 0<br>
+ SectionNumber: 5<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 15<br>
+ NumberOfRelocations: 2<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 1746394828<br>
+ Number: 0<br>
+ Selection: IMAGE_COMDAT_SELECT_ANY<br>
+ - Name: '.debug$S'<br>
+ Value: 0<br>
+ SectionNumber: 6<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 148<br>
+ NumberOfRelocations: 4<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 0<br>
+ Number: 5<br>
+ Selection: IMAGE_COMDAT_SELECT_ASSOCIATI<wbr>VE<br>
+ - Name: foo<br>
+ Value: 0<br>
+ SectionNumber: 5<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_FUNCTION<br>
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL<br>
+ - Name: bar<br>
+ Value: 0<br>
+ SectionNumber: 0<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_FUNCTION<br>
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL<br>
+ - Name: main<br>
+ Value: 0<br>
+ SectionNumber: 4<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_FUNCTION<br>
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL<br>
+ - Name: '$LN3'<br>
+ Value: 0<br>
+ SectionNumber: 4<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_LABEL<br>
+ - Name: .xdata<br>
+ Value: 0<br>
+ SectionNumber: 7<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 8<br>
+ NumberOfRelocations: 0<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 264583633<br>
+ Number: 0<br>
+ - Name: '$unwind$main'<br>
+ Value: 0<br>
+ SectionNumber: 7<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ - Name: .pdata<br>
+ Value: 0<br>
+ SectionNumber: 8<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ SectionDefinition:<br>
+ Length: 12<br>
+ NumberOfRelocations: 3<br>
+ NumberOfLinenumbers: 0<br>
+ CheckSum: 2942184094<br>
+ Number: 0<br>
+ - Name: '$pdata$main'<br>
+ Value: 0<br>
+ SectionNumber: 8<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_STATIC<br>
+ - Name: global<br>
+ Value: 0<br>
+ SectionNumber: 0<br>
+ SimpleType: IMAGE_SYM_TYPE_NULL<br>
+ ComplexType: IMAGE_SYM_DTYPE_NULL<br>
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL<br>
+...<br>
<br>
Added: lld/trunk/test/COFF/pdb-comdat<wbr>.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/pdb-comdat.test?rev=305811&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/lld/trunk/test/COFF/pdb-<wbr>comdat.test?rev=305811&view=au<wbr>to</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/test/COFF/pdb-comdat<wbr>.test (added)<br>
+++ lld/trunk/test/COFF/pdb-comdat<wbr>.test Tue Jun 20 12:14:09 2017<br>
@@ -0,0 +1,52 @@<br>
+Consider this example program with an inline function "foo":<br>
+<br>
+==> foo.h <==<br>
+extern int global;<br>
+__inline void foo() {<br>
+ ++global;<br>
+}<br>
+void bar();<br>
+==> pdb_comdat_main.c <==<br>
+#include "foo.h"<br>
+int main(void) {<br>
+ foo();<br>
+ bar();<br>
+ return 42;<br>
+}<br>
+==> pdb_comdat_bar.c <==<br>
+#include "foo.h"<br>
+void bar(void) {<br>
+ foo();<br>
+}<br>
+<br>
+Both object files will contain debug info for foo, but only the debug info from<br>
+pdb_comdat_main.obj should be included in the PDB.<br>
+<br>
+RUN: rm -rf %t && mkdir -p %t && cd %t<br>
+RUN: yaml2obj %S/Inputs/pdb_comdat_main.yaml -o pdb_comdat_main.obj<br>
+RUN: yaml2obj %S/Inputs/pdb_comdat_bar.yaml -o pdb_comdat_bar.obj<br>
+RUN: lld-link pdb_comdat_main.obj pdb_comdat_bar.obj -out:t.exe -debug -pdb:t.pdb -nodefaultlib -entry:main<br>
+RUN: llvm-pdbutil raw -l t.pdb | FileCheck %s<br>
+<br>
+CHECK: Lines<br>
+CHECK: ==============================<wbr>==============================<br>
+CHECK-LABEL: Mod 0000 | `{{.*}}pdb_comdat_main.obj`:<br>
+CHECK: c:\src\llvm-project\build\pdb<wbr>_comdat_main.c (MD5: F969E51BBE373436D81492EB61387F<wbr>36)<br>
+CHECK: c:\src\llvm-project\build\foo<wbr>.h (MD5: D74D834EFAC3AE2B45E606A8320B1D<wbr>5C)<br>
+CHECK-LABEL: Mod 0001 | `{{.*}}pdb_comdat_bar.obj`:<br>
+CHECK: c:\src\llvm-project\build\pdb<wbr>_comdat_bar.c (MD5: 365279DB4FCBEDD721BBFC3B14A953<wbr>C2)<br>
+CHECK-NOT: c:\src\llvm-project\build\foo<wbr>.h<br>
+CHECK-LABEL: Mod 0002 | `* Linker *`:<br>
+<br>
+Reorder the object files and verify that the other table is selected.<br>
+<br>
+RUN: lld-link pdb_comdat_bar.obj pdb_comdat_main.obj -out:t.exe -debug -pdb:t.pdb -nodefaultlib -entry:main<br>
+RUN: llvm-pdbutil raw -l t.pdb | FileCheck %s --check-prefix=REORDER<br>
+<br>
+REORDER-LABEL: Mod 0000 | `{{.*}}pdb_comdat_bar.obj`:<br>
+REORDER: c:\src\llvm-project\build\pdb<wbr>_comdat_bar.c (MD5: 365279DB4FCBEDD721BBFC3B14A953<wbr>C2)<br>
+REORDER: c:\src\llvm-project\build\foo<wbr>.h (MD5: D74D834EFAC3AE2B45E606A8320B1D<wbr>5C)<br>
+REORDER-LABEL: Mod 0001 | `{{.*}}pdb_comdat_main.obj`:<br>
+REORDER: c:\src\llvm-project\build\pdb<wbr>_comdat_main.c<br>
+REORDER-NOT: c:\src\llvm-project\build\foo<wbr>.h<br>
+REORDER-LABEL: Mod 0002 | `* Linker *`:<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>