forked from OSchip/llvm-project
				
			Check Live instead of the section type.
By the time we get here all live sections should have been combined into InputSections. llvm-svn: 304243
This commit is contained in:
		
							parent
							
								
									a85e8dda54
								
							
						
					
					
						commit
						e39709b20d
					
				| 
						 | 
				
			
			@ -291,12 +291,14 @@ LinkerScript::computeInputSections(const InputSectionDescription *Cmd) {
 | 
			
		|||
    size_t SizeBefore = Ret.size();
 | 
			
		||||
 | 
			
		||||
    for (InputSectionBase *Sec : InputSections) {
 | 
			
		||||
      if (!isa<InputSection>(Sec))
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if (Sec->Assigned)
 | 
			
		||||
        continue;
 | 
			
		||||
 | 
			
		||||
      if (!Sec->Live) {
 | 
			
		||||
        reportDiscarded(Sec);
 | 
			
		||||
        continue;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      // For -emit-relocs we have to ignore entries like
 | 
			
		||||
      //   .rela.dyn : { *(.rela.data) }
 | 
			
		||||
      // which are common because they are in the default bfd script.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -351,7 +351,7 @@ static bool canMergeToProgbits(unsigned Type) {
 | 
			
		|||
         Type == SHT_NOTE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void reportDiscarded(InputSectionBase *IS) {
 | 
			
		||||
void elf::reportDiscarded(InputSectionBase *IS) {
 | 
			
		||||
  if (!Config->PrintGcSections)
 | 
			
		||||
    return;
 | 
			
		||||
  message("removing unused section from '" + IS->Name + "' in file '" +
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -149,6 +149,7 @@ private:
 | 
			
		|||
};
 | 
			
		||||
 | 
			
		||||
uint64_t getHeaderSize();
 | 
			
		||||
void reportDiscarded(InputSectionBase *IS);
 | 
			
		||||
 | 
			
		||||
} // namespace elf
 | 
			
		||||
} // namespace lld
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue