Ver Fonte

* Don't crash on a PLT-generating relocation to a local symbol (which should not normally appear, but nevertheless is possible).

git-svn-id: trunk@23481 -
sergei há 12 anos atrás
pai
commit
40c510403f
1 ficheiros alterados com 5 adições e 2 exclusões
  1. 5 2
      compiler/x86_64/cpuelf.pas

+ 5 - 2
compiler/x86_64/cpuelf.pas

@@ -212,8 +212,11 @@ implementation
         R_X86_64_PLTOFF64,
         R_X86_64_GOTPLT64:
           begin
-            objsym:=ObjReloc.symbol.exesymbol.ObjSymbol;
-            objsym.refs:=objsym.refs or symref_plt;
+            if assigned(ObjReloc.symbol) and assigned(ObjReloc.symbol.exesymbol) then
+              begin
+                objsym:=ObjReloc.symbol.exesymbol.ObjSymbol;
+                objsym.refs:=objsym.refs or symref_plt;
+              end;
           end;
       end;