diff options
Diffstat (limited to 'lib/Object/COFFObjectFile.cpp')
-rw-r--r-- | lib/Object/COFFObjectFile.cpp | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index d48f44c75a..f33caee334 100644 --- a/lib/Object/COFFObjectFile.cpp +++ b/lib/Object/COFFObjectFile.cpp @@ -207,74 +207,6 @@ error_code COFFObjectFile::getSymbolSize(DataRefImpl Symb, return object_error::success; } -error_code COFFObjectFile::getSymbolNMTypeChar(DataRefImpl Symb, - char &Result) const { - const coff_symbol *symb = toSymb(Symb); - StringRef name; - if (error_code ec = getSymbolName(Symb, name)) - return ec; - char ret = StringSwitch<char>(name) - .StartsWith(".debug", 'N') - .StartsWith(".sxdata", 'N') - .Default('?'); - - if (ret != '?') { - Result = ret; - return object_error::success; - } - - uint32_t Characteristics = 0; - if (symb->SectionNumber > 0) { - const coff_section *Section = NULL; - if (error_code ec = getSection(symb->SectionNumber, Section)) - return ec; - Characteristics = Section->Characteristics; - } - - switch (symb->SectionNumber) { - case COFF::IMAGE_SYM_UNDEFINED: - // Check storage classes. - if (symb->StorageClass == COFF::IMAGE_SYM_CLASS_WEAK_EXTERNAL) { - Result = 'w'; - return object_error::success; // Don't do ::toupper. - } else if (symb->Value != 0) // Check for common symbols. - ret = 'c'; - else - ret = 'u'; - break; - case COFF::IMAGE_SYM_ABSOLUTE: - ret = 'a'; - break; - case COFF::IMAGE_SYM_DEBUG: - ret = 'n'; - break; - default: - // Check section type. - if (Characteristics & COFF::IMAGE_SCN_CNT_CODE) - ret = 't'; - else if ( Characteristics & COFF::IMAGE_SCN_MEM_READ - && ~Characteristics & COFF::IMAGE_SCN_MEM_WRITE) // Read only. - ret = 'r'; - else if (Characteristics & COFF::IMAGE_SCN_CNT_INITIALIZED_DATA) - ret = 'd'; - else if (Characteristics & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA) - ret = 'b'; - else if (Characteristics & COFF::IMAGE_SCN_LNK_INFO) - ret = 'i'; - - // Check for section symbol. - else if ( symb->StorageClass == COFF::IMAGE_SYM_CLASS_STATIC - && symb->Value == 0) - ret = 's'; - } - - if (symb->StorageClass == COFF::IMAGE_SYM_CLASS_EXTERNAL) - ret = ::toupper(static_cast<unsigned char>(ret)); - - Result = ret; - return object_error::success; -} - error_code COFFObjectFile::getSymbolSection(DataRefImpl Symb, section_iterator &Result) const { const coff_symbol *symb = toSymb(Symb); |