From e0bd25191e9c7b803b10675394aa2dba91692870 Mon Sep 17 00:00:00 2001 From: nickysn Date: Mon, 24 Aug 2015 13:46:37 +0000 Subject: [PATCH] + also take into account the frame method when converting the omf start address to a symbol git-svn-id: trunk@31383 - --- compiler/ogomf.pas | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/compiler/ogomf.pas b/compiler/ogomf.pas index 78361a6543..9894f9b7bf 100644 --- a/compiler/ogomf.pas +++ b/compiler/ogomf.pas @@ -1307,6 +1307,7 @@ implementation ModEndRec: TOmfRecord_MODEND; objsym: TObjSymbol; objsec: TOmfObjSection; + basegroup: TObjSectionGroup; begin Result:=False; ModEndRec:=TOmfRecord_MODEND.Create; @@ -1331,12 +1332,46 @@ implementation ModEndRec.Free; exit; end; + case ModEndRec.FrameMethod of + ffmSegmentIndex: + begin + if (ModEndRec.FrameDatum<1) or (ModEndRec.FrameDatum>objdata.ObjSectionList.Count) then + begin + InputError('Frame segment name index for start address out of range'); + ModEndRec.Free; + exit; + end; + if ModEndRec.FrameDatum<>ModEndRec.TargetDatum then + begin + InputError('Frame segment different than target segment is not supported supported for start address'); + ModEndRec.Free; + exit; + end; + basegroup:=nil; + end; + ffmGroupIndex: + begin + if (ModEndRec.FrameDatum<1) or (ModEndRec.FrameDatum>objdata.GroupsList.Count) then + begin + InputError('Frame group name index for start address out of range'); + ModEndRec.Free; + exit; + end; + basegroup:=TObjSectionGroup(objdata.GroupsList[ModEndRec.FrameDatum-1]); + end; + else + begin + InputError('Frame method for start address other than "Segment Index" or "Group Index" is not supported'); + ModEndRec.Free; + exit; + end; + end; objsec:=TOmfObjSection(objdata.ObjSectionList[ModEndRec.TargetDatum-1]); objsym:=objdata.CreateSymbol('..start'); objsym.bind:=AB_GLOBAL; objsym.typ:=AT_FUNCTION; - //objsym.group:=basegroup; + objsym.group:=basegroup; objsym.objsection:=objsec; objsym.offset:=ModEndRec.TargetDisplacement; objsym.size:=0;