-/// logic to decide if the symbol should be reported in the symbol table
-bool COFFSymbol::should_keep() const {
- // no section means its external, keep it
- if (!Section)
- return true;
-
- // if it has relocations pointing at it, keep it
- if (Relocations > 0) {
- assert(Section->Number != -1 && "Sections with relocations must be real!");
- return true;
- }
-
- // if this is a safeseh handler, keep it
- if (MC && (cast<MCSymbolCOFF>(MC)->isSafeSEH()))
- return true;
-
- // if the section its in is being droped, drop it
- if (Section->Number == -1)
- return false;
-
- // if it is the section symbol, keep it
- if (Section->Symbol == this)
- return true;
-
- // if its temporary, drop it
- if (MC && MC->isTemporary())
- return false;
-
- // otherwise, keep it
- return true;
-}
-