FpDebug: Handle overflow for relocation with 32bit target. RelocationOffset is stored as QWord, but can be negative. For 32bit targets the overflow must be masked out.

(cherry picked from commit 0fad4e40d9)
This commit is contained in:
Martin 2023-10-14 14:05:39 +02:00
parent 6169d36d26
commit b2d23daac6
2 changed files with 4 additions and 2 deletions

View File

@ -5386,6 +5386,8 @@ begin
{$push}
{$Q-}{$R-}
Result := AValue + FOwner.RelocationOffset;
if FAddressSize = 4 then
Result := DWORD(Result);
{$pop}
end;

View File

@ -531,8 +531,8 @@ begin
SymbolName:=pchar(SymbolStr+SymbolArr32^[i].st_name);
{$Q-}{$R-}
AfpSymbolInfo.Add(SymbolName, TDBGPtr(SymbolArr32^[i].st_value+RelocationOffset),
Sect^.Address + Sect^.Size+RelocationOffset);
AfpSymbolInfo.Add(SymbolName, DWord(SymbolArr32^[i].st_value+RelocationOffset),
DWORD(Sect^.Address + Sect^.Size+RelocationOffset));
end;
{$pop}
end