mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
move getSymbolNMTypeChar to the one program that needs it: nm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193933 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -591,43 +591,6 @@ error_code MachOObjectFile::getSymbolType(DataRefImpl Symb,
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
error_code MachOObjectFile::getSymbolNMTypeChar(DataRefImpl Symb,
|
||||
char &Res) const {
|
||||
nlist_base Entry = getSymbolTableEntryBase(this, Symb);
|
||||
uint8_t NType = Entry.n_type;
|
||||
|
||||
char Char;
|
||||
switch (NType & MachO::N_TYPE) {
|
||||
case MachO::N_UNDF:
|
||||
Char = 'u';
|
||||
break;
|
||||
case MachO::N_ABS:
|
||||
Char = 's';
|
||||
break;
|
||||
case MachO::N_SECT: {
|
||||
section_iterator Sec = end_sections();
|
||||
getSymbolSection(Symb, Sec);
|
||||
DataRefImpl Ref = Sec->getRawDataRefImpl();
|
||||
StringRef SectionName;
|
||||
getSectionName(Ref, SectionName);
|
||||
StringRef SegmentName = getSectionFinalSegmentName(Ref);
|
||||
if (SegmentName == "__TEXT" && SectionName == "__text")
|
||||
Char = 't';
|
||||
else
|
||||
Char = 's';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Char = '?';
|
||||
break;
|
||||
}
|
||||
|
||||
if (NType & (MachO::N_EXT | MachO::N_PEXT))
|
||||
Char = toupper(static_cast<unsigned char>(Char));
|
||||
Res = Char;
|
||||
return object_error::success;
|
||||
}
|
||||
|
||||
error_code MachOObjectFile::getSymbolFlags(DataRefImpl DRI,
|
||||
uint32_t &Result) const {
|
||||
nlist_base Entry = getSymbolTableEntryBase(this, DRI);
|
||||
|
Reference in New Issue
Block a user