mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Increase member chunk size to avoid linker crash
This commit is contained in:
parent
a1fd8d1397
commit
31af480c92
1 changed files with 7 additions and 10 deletions
|
@ -555,6 +555,7 @@ void BeCOFFObject::DbgTEndTag()
|
||||||
BF_ASSERT(mTTagStartPos != -1);
|
BF_ASSERT(mTTagStartPos != -1);
|
||||||
DbgTAlign();
|
DbgTAlign();
|
||||||
int tagSize = mDebugTSect.mData.GetPos() - mTTagStartPos;
|
int tagSize = mDebugTSect.mData.GetPos() - mTTagStartPos;
|
||||||
|
BF_ASSERT(tagSize <= 0xFFFF);
|
||||||
*((int16*)&mDebugTSect.mData.mData[mTTagStartPos]) = (int16)(tagSize - 2);
|
*((int16*)&mDebugTSect.mData.mData[mTTagStartPos]) = (int16)(tagSize - 2);
|
||||||
mTTagStartPos = -1;
|
mTTagStartPos = -1;
|
||||||
}
|
}
|
||||||
|
@ -598,10 +599,6 @@ int BeCOFFObject::DbgGetTypeId(BeDbgType* dbgType, bool doDefine)
|
||||||
for (auto member : structType->mMembers)
|
for (auto member : structType->mMembers)
|
||||||
{
|
{
|
||||||
auto type = member->mType;
|
auto type = member->mType;
|
||||||
//TODO:
|
|
||||||
//if (member->mName == "VersionName")
|
|
||||||
//continue;
|
|
||||||
|
|
||||||
DbgGetTypeId(type);
|
DbgGetTypeId(type);
|
||||||
}
|
}
|
||||||
for (auto func : structType->mMethods)
|
for (auto func : structType->mMethods)
|
||||||
|
@ -627,7 +624,7 @@ int BeCOFFObject::DbgGetTypeId(BeDbgType* dbgType, bool doDefine)
|
||||||
auto _CheckFieldOverflow = [&]()
|
auto _CheckFieldOverflow = [&]()
|
||||||
{
|
{
|
||||||
int tagSize = mDebugTSect.mData.GetPos() - mTTagStartPos;
|
int tagSize = mDebugTSect.mData.GetPos() - mTTagStartPos;
|
||||||
if (tagSize >= 2000)
|
if (tagSize >= 0xE000)
|
||||||
{
|
{
|
||||||
int extFieldListTag = mCurTagId++;
|
int extFieldListTag = mCurTagId++;
|
||||||
|
|
||||||
|
@ -1014,7 +1011,6 @@ void BeCOFFObject::DbgStartSection(int sectionNum)
|
||||||
{
|
{
|
||||||
auto& outS = mDebugSSect.mData;
|
auto& outS = mDebugSSect.mData;
|
||||||
BF_ASSERT(mSectionStartPos == -1);
|
BF_ASSERT(mSectionStartPos == -1);
|
||||||
|
|
||||||
outS.Write((int32)sectionNum);
|
outS.Write((int32)sectionNum);
|
||||||
outS.Write(0); // Temporary - size
|
outS.Write(0); // Temporary - size
|
||||||
mSectionStartPos = outS.GetPos();
|
mSectionStartPos = outS.GetPos();
|
||||||
|
@ -1024,6 +1020,7 @@ void BeCOFFObject::DbgEndSection()
|
||||||
{
|
{
|
||||||
auto& outS = mDebugSSect.mData;
|
auto& outS = mDebugSSect.mData;
|
||||||
int totalLen = outS.GetPos() - mSectionStartPos;
|
int totalLen = outS.GetPos() - mSectionStartPos;
|
||||||
|
BF_ASSERT(totalLen <= 0xFFFF);
|
||||||
*((int32*)&outS.mData[mSectionStartPos - 4]) = totalLen;
|
*((int32*)&outS.mData[mSectionStartPos - 4]) = totalLen;
|
||||||
mSectionStartPos = -1;
|
mSectionStartPos = -1;
|
||||||
while ((outS.GetPos() & 3) != 0)
|
while ((outS.GetPos() & 3) != 0)
|
||||||
|
@ -1132,7 +1129,7 @@ void BeCOFFObject::DbgSEndTag()
|
||||||
{
|
{
|
||||||
BF_ASSERT(mSTagStartPos != -1);
|
BF_ASSERT(mSTagStartPos != -1);
|
||||||
int tagSize = mDebugSSect.mData.GetPos() - mSTagStartPos;
|
int tagSize = mDebugSSect.mData.GetPos() - mSTagStartPos;
|
||||||
|
BF_ASSERT(tagSize <= 0xFFFF);
|
||||||
*((uint16*)&mDebugSSect.mData.mData[mSTagStartPos]) = (uint16)(tagSize - 2);
|
*((uint16*)&mDebugSSect.mData.mData[mSTagStartPos]) = (uint16)(tagSize - 2);
|
||||||
mSTagStartPos = -1;
|
mSTagStartPos = -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue