本文整理汇总了C++中Symbol::SymbolName方法的典型用法代码示例。如果您正苦于以下问题:C++ Symbol::SymbolName方法的具体用法?C++ Symbol::SymbolName怎么用?C++ Symbol::SymbolName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symbol
的用法示例。
在下文中一共展示了Symbol::SymbolName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitElfContents
/**
This function initializes the Elf members
@internalComponent
@released
*/
void ElfProducer::InitElfContents() {
iElfHeader = new Elf32_Ehdr;
iSections = new Elf32_Shdr[MAX_SECTIONS+1];
iElfDynSym = new Elf32_Sym[iNSymbols];
iVersionTbl = new Elf32_Half[iNSymbols];
iVersionDef = new Elf32_Verdef[2];
iDSODaux = new Elf32_Verdaux[2];
iProgHeader = new Elf32_Phdr[2];
iCodeSectionData = new PLUINT32[iNSymbols];
iHashTbl = new Elf32_HashTable;
//premeditated
iHashTbl->nBuckets = (iNSymbols /3) + (iNSymbols % 0x3);
iHashTbl->nChains = iNSymbols;
iDSOBuckets = new Elf32_Sword[iHashTbl->nBuckets];
iDSOChains = new Elf32_Sword[iHashTbl->nChains];
Elf32_Sword aNullPtr = 0;
memset(iDSOBuckets, aNullPtr, sizeof(Elf32_Sword)*iHashTbl->nBuckets);
memset(iDSOChains, aNullPtr, sizeof(Elf32_Sword)*iHashTbl->nChains);
memset(iCodeSectionData, 0, sizeof(PLUINT32)*iNSymbols);
CreateElfHeader();
SymbolList::iterator aItr = iSymbolsList->begin();
SymbolList::iterator aEnd = iSymbolsList->end();
Symbol *aSym;
PLUINT32 aIdx = 1;
memset( &iElfDynSym[0], 0, sizeof(Elf32_Sym));
iDSOSymNameStrTbl.insert(iDSOSymNameStrTbl.end(), 0);
while(aItr != aEnd) {
String aSymName("");
aSym = *aItr;
aSymName = aSym->SymbolName();
//set symbol info..
iElfDynSym[aIdx].st_name = iDSOSymNameStrTbl.size();
iDSOSymNameStrTbl.insert(iDSOSymNameStrTbl.end(), aSymName.begin(), aSymName.end() );
iDSOSymNameStrTbl.insert(iDSOSymNameStrTbl.end(), 0);
SetSymolFields( aSym, &iElfDynSym[aIdx], aIdx);
//set version table info...
iVersionTbl[aIdx] = DEFAULT_VERSION;
AddToHashTable(aSym->SymbolName(), aIdx);
aItr++;aIdx++;
}
CreateVersionTable();
//Fill section headers...
CreateSections();
//Copy dyn entries..
CreateDynamicEntries();
//create code section data - this has the ordinal numbers...
CreateProgHeader();
}
示例2: GenerateAsmFile
/**
Function to generate ASM File.
@param afileName - ASM File name
@return 0 on success, otherwise throw error
@internalComponent
@released
*/
int FileDump::GenerateAsmFile(const char* afileName)//DumpAsm
{
DefFile *iDefFile = new DefFile();
SymbolList *aSymList;
aSymList = iDefFile->ReadDefFile(iParameterListInterface->DefInput());
FILE *fptr;
if((fptr=fopen(afileName,"w"))==NULL)
{
throw FileError(FILEOPENERROR,(char*)afileName);
}
else
{
SymbolList::iterator aItr = aSymList->begin();
SymbolList::iterator last = aSymList->end();
Symbol *aSym;
while( aItr != last)
{
aSym = *aItr;
if(aSym->Absent())
{
aItr++;
continue;
}
fputs("\tIMPORT ",fptr);
fputs(aSym->SymbolName(),fptr);
//Set the visibility of the symbols as default."DYNAMIC" option is
//added to remove STV_HIDDEN visibility warnings generated by every
//export during kernel build
fputs(" [DYNAMIC]", fptr);
fputs("\n",fptr);
aItr++;
}
// Create a directive section that instructs the linker to make all listed
// symbols visible.
fputs("\n AREA |.directive|, READONLY, NOALLOC\n\n",fptr);
fputs("\tDCB \"#<SYMEDIT>#\\n\"\n", fptr);
aItr = aSymList->begin();
while (aItr != last)
{
aSym = *aItr;
if ( aSym->Absent() )
{
aItr++;
continue;
}
// Example:
// DCB "EXPORT __ARM_ll_mlass\n"
fputs("\tDCB \"EXPORT ",fptr);
fputs(aSym->SymbolName(),fptr);
fputs("\\n\"\n", fptr);
aItr++;
}
fputs("\n END\n",fptr);
fclose(fptr);
}
return 0;
}