MCPcopy Create free account
hub / github.com/beefytech/Beef / PopulateIData_LookupTable

Method PopulateIData_LookupTable

IDEHelper/Linker/BlContext.cpp:2006–2034  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2004}
2005
2006void BlContext::PopulateIData_LookupTable(BlSegment* iDataSect, int& hintNameTableSize)
2007{
2008 int importLookupTableSize = ((int)mImportLookups.size() + (int)mImportFiles.size()) * 8;
2009 int importDirectoryTableSize = ((int)mImportFiles.size() + 1) * 20;
2010 int hintNameTableOfs = importLookupTableSize + importDirectoryTableSize + importLookupTableSize;
2011
2012 // Import lookup table
2013 for (auto& importFilePair : mImportFiles)
2014 {
2015 auto& importFile = importFilePair.second;
2016 for (auto lookup : importFile.mLookups)
2017 {
2018 if (lookup->mName.empty())
2019 {
2020 mImportStream.Write((int64)0x8000000000000000LL | lookup->mHint);
2021 }
2022 else
2023 {
2024 mImportStream.Write((int64)iDataSect->mRVA + hintNameTableOfs + hintNameTableSize);
2025 hintNameTableSize += 2;
2026 hintNameTableSize += (int)lookup->mName.length() + 1;
2027 if ((hintNameTableSize % 2) == 1)
2028 hintNameTableSize++;
2029 }
2030 }
2031
2032 mImportStream.Write((int64)0);
2033 }
2034}
2035
2036void BlContext::PopulateIData(BlSegment* iDataSect)
2037{

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
emptyMethod · 0.45
WriteMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected