File tree Expand file tree Collapse file tree 3 files changed +396
-4
lines changed 
test/tools/llvm-objcopy/COFF Expand file tree Collapse file tree 3 files changed +396
-4
lines changed Original file line number Diff line number Diff line change @@ -94,13 +94,17 @@ Error COFFWriter::finalizeSymbolContents() {
9494  return  Error::success ();
9595}
9696
97- Error COFFWriter::finalizeCFGuardContents  () {
97+ Error COFFWriter::finalizeSymIdxContents  () {
9898  //  CFGuards shouldn't be present in PE
9999  if  (Obj.IsPE )
100100    return  Error::success ();
101101
102+   //  Currently handle only sections consisting only of .symidx.
103+   //  TODO: other sections such as .impcall and .hybmp$x require more complex
104+   //  handling as they have more complex layout.
102105  auto  IsSymIdxSection = [](StringRef Name) {
103-     return  Name == " .gljmp$y"   || Name == " .giats$y"   || Name == " .gfids$y"  ;
106+     return  Name == " .gljmp$y"   || Name == " .giats$y"   || Name == " .gfids$y"   ||
107+            Name == " .gehcont$y"  ;
104108  };
105109
106110  DenseMap<size_t , size_t > SymIdMap;
@@ -254,7 +258,7 @@ Error COFFWriter::finalize(bool IsBigObj) {
254258    return  E;
255259  if  (Error E = finalizeSymbolContents ())
256260    return  E;
257-   if  (Error E = finalizeCFGuardContents ())
261+   if  (Error E = finalizeSymIdxContents ())
258262    return  E;
259263
260264  size_t  SizeOfHeaders = 0 ;
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class COFFWriter {
3434  template  <class  SymbolTy > std::pair<size_t , size_t > finalizeSymbolTable ();
3535  Error finalizeRelocTargets ();
3636  Error finalizeSymbolContents ();
37-   Error finalizeCFGuardContents ();
37+   Error finalizeSymIdxContents ();
3838  void  layoutSections ();
3939  Expected<size_t > finalizeStringTable ();
4040
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments