Kaynağa Gözat

+ create a symbol relocation for external symbols in TOmfObjData.writeReloc

git-svn-id: trunk@30512 -
nickysn 10 yıl önce
ebeveyn
işleme
e1ae2d9387
1 değiştirilmiş dosya ile 11 ekleme ve 3 silme
  1. 11 3
      compiler/ogomf.pas

+ 11 - 3
compiler/ogomf.pas

@@ -335,9 +335,17 @@ implementation
             { real address of the symbol }
             symaddr:=p.address;
 
-            objreloc:=TOmfRelocation.CreateSection(CurrObjSec.Size,p.objsection,Reloctype);
-            CurrObjSec.ObjRelocations.Add(objreloc);
-            inc(data,symaddr);
+            if p.bind=AB_EXTERNAL then
+              begin
+                objreloc:=TOmfRelocation.CreateSymbol(CurrObjSec.Size,p,Reloctype);
+                CurrObjSec.ObjRelocations.Add(objreloc);
+              end
+            else
+              begin
+                objreloc:=TOmfRelocation.CreateSection(CurrObjSec.Size,p.objsection,Reloctype);
+                CurrObjSec.ObjRelocations.Add(objreloc);
+                inc(data,symaddr);
+              end;
           end;
         CurrObjSec.write(data,len);
       end;