From 83f2f7bf375bd50366d8ae859ae88fcdc8ad795d Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Sun, 26 Sep 2021 03:56:56 +0300 Subject: [PATCH] + introduced TObjData.SymbolPairDefine, to allow custom handling of symbol pairs in the internal object writer --- compiler/aasmbase.pas | 2 ++ compiler/aasmtai.pas | 2 -- compiler/assemble.pas | 6 ++++++ compiler/ogbase.pas | 6 ++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/compiler/aasmbase.pas b/compiler/aasmbase.pas index bb55c0e022..27e2a7d0c6 100644 --- a/compiler/aasmbase.pas +++ b/compiler/aasmbase.pas @@ -78,6 +78,8 @@ interface info alt_dbgline and alt_dbgfile, etc. } TAsmLabelType = (alt_jump,alt_addr,alt_data,alt_dbgline,alt_dbgfile,alt_dbgtype,alt_dbgframe,alt_eh_begin,alt_eh_end); + TSymbolPairKind = (spk_set, spk_set_global, spk_thumb_set, spk_localentry); + const asmlabeltypeprefix : array[TAsmLabeltype] of string[2] = ('j','a','d','l','f','t','c','eb','ee'); asmsymbindname : array[TAsmsymbind] of string[23] = ('none', 'external','common', diff --git a/compiler/aasmtai.pas b/compiler/aasmtai.pas index c5cffe27ac..7829cf9766 100644 --- a/compiler/aasmtai.pas +++ b/compiler/aasmtai.pas @@ -432,8 +432,6 @@ interface ash_pushnv,ash_savenv ); - TSymbolPairKind = (spk_set, spk_set_global, spk_thumb_set, spk_localentry); - const regallocstr : array[tregalloctype] of string[10]=('allocated','released','sync','resized','used'); diff --git a/compiler/assemble.pas b/compiler/assemble.pas index 925f137653..7e8641c62a 100644 --- a/compiler/assemble.pas +++ b/compiler/assemble.pas @@ -1790,6 +1790,9 @@ Implementation internalerror(2009090804); ;} ObjData.SymbolDefine(Tai_symbol(hp).sym); end; + ait_symbolpair : + with tai_symbolpair(hp) do + ObjData.SymbolPairDefine(kind,sym^,value^); ait_label : ObjData.SymbolDefine(Tai_label(hp).labsym); ait_string : @@ -1951,6 +1954,9 @@ Implementation objsym:=ObjData.SymbolRef(Tai_symbol_end(hp).sym); objsym.size:=ObjData.CurrObjSec.Size-objsym.offset; end; + ait_symbolpair: + with tai_symbolpair(hp) do + ObjData.SymbolPairDefine(kind,sym^,value^); ait_label : ObjData.SymbolDefine(Tai_label(hp).labsym); ait_string : diff --git a/compiler/ogbase.pas b/compiler/ogbase.pas index 547b7b8063..6bc210f7cf 100644 --- a/compiler/ogbase.pas +++ b/compiler/ogbase.pas @@ -435,6 +435,7 @@ interface function symboldefine(const aname:string;abind:TAsmsymbind;atyp:Tasmsymtype):TObjSymbol; function symbolref(asmsym:TAsmSymbol):TObjSymbol; function symbolref(const aname:string):TObjSymbol; + procedure symbolpairdefine(akind: TSymbolPairKind;const asym, avalue: string);virtual; procedure ResetCachedAsmSymbols; { Allocation } procedure alloc(len:TObjSectionOfs); @@ -1546,6 +1547,11 @@ implementation end; + procedure TObjData.symbolpairdefine(akind: TSymbolPairKind; const asym, avalue: string); + begin + end; + + procedure TObjData.ResetCachedAsmSymbols; var i : longint;