[LLD][COFF] Reset outputSections for successive runs
The global variable outputSections in the COFF writer was not cleared between runs which caused successive calls to lld::coff::link to generate invalid binaries. These binaries when loaded would result in "invalid win32 applications" and/or "bad image" errors. Differential Revision: https://reviews.llvm.org/D86401
This commit is contained in:
		
							parent
							
								
									207d4499df
								
							
						
					
					
						commit
						54f5a4ea4c
					
				| 
						 | 
					@ -601,6 +601,9 @@ void Writer::finalizeAddresses() {
 | 
				
			||||||
void Writer::run() {
 | 
					void Writer::run() {
 | 
				
			||||||
  ScopedTimer t1(codeLayoutTimer);
 | 
					  ScopedTimer t1(codeLayoutTimer);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // First, clear the output sections from previous runs
 | 
				
			||||||
 | 
					  outputSections.clear();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  createImportTables();
 | 
					  createImportTables();
 | 
				
			||||||
  createSections();
 | 
					  createSections();
 | 
				
			||||||
  createMiscChunks();
 | 
					  createMiscChunks();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue