Ver código fonte

* emit a warning, when encountering an omf reference to a section, that has been
removed due to smartlinking

git-svn-id: trunk@39226 -

nickysn 7 anos atrás
pai
commit
11cf2a6996
1 arquivos alterados com 9 adições e 1 exclusões
  1. 9 1
      compiler/ogomf.pas

+ 9 - 1
compiler/ogomf.pas

@@ -2883,7 +2883,15 @@ cleanup:
                 if objreloc.FrameGroup<>'' then
                   framebase:=TMZExeUnifiedLogicalGroup(ExeUnifiedLogicalGroups.Find(objreloc.FrameGroup)).MemPos
                 else
-                  framebase:=TOmfObjSection(objreloc.objsection).MZExeUnifiedLogicalSegment.MemBasePos;
+                  begin
+                    if assigned(TOmfObjSection(objreloc.objsection).MZExeUnifiedLogicalSegment) then
+                      framebase:=TOmfObjSection(objreloc.objsection).MZExeUnifiedLogicalSegment.MemBasePos
+                    else
+                      begin
+                        framebase:=0;
+                        Comment(V_Warning,'Encountered an OMF reference to a section, that has been removed by smartlinking: '+TOmfObjSection(objreloc.objsection).Name);
+                      end;
+                  end;
                 case objreloc.typ of
                   RELOC_ABSOLUTE16,RELOC_ABSOLUTE32,RELOC_SEG,RELOC_FARPTR,RELOC_FARPTR48:
                     fixupamount:=target-framebase;