Przeglądaj źródła

* Fixed 2 bugs introduced in r22951:
* Require symbol table presence only in dynamic objects; relocatable objects may not contain one (example is crtn.o).
* Attempt to write relocations from dynreloclist regardless of relative_reloc_count, the latter is typically 0 in executables.

git-svn-id: trunk@23115 -

sergei 12 lat temu
rodzic
commit
67a41e1e94
1 zmienionych plików z 6 dodań i 6 usunięć
  1. 6 6
      compiler/ogelf.pas

+ 6 - 6
compiler/ogelf.pas

@@ -1588,11 +1588,10 @@ implementation
             break;
           end;
 
-        if symtabndx=0 then
-          InternalError(2012110706);
-
         if dynobj then
           begin
+            if symtabndx=0 then
+              InternalError(2012110707);
             { Locate .dynamic and version sections. Expect a single one of a kind. }
             dynndx:=0;
             versymndx:=0;
@@ -2416,9 +2415,10 @@ implementation
       begin
         gotwritten:=true;
         { If target does not support sorted relocations, it is expected to write the
-          entire .rel[a].dyn section during FixupRelocations. Otherwise, only RELATIVE ones
-          should be written, space for non-relative relocations should remain. }
-        if assigned(dynrelocsec) and (relative_reloc_count>0) then
+          entire .rel[a].dyn section during FixupRelocations, and leave dynreloclist empty.
+          Otherwise, only RELATIVE ones should be written, space for non-relative relocations
+          should remain. }
+        if assigned(dynrelocsec) then
           begin
             if (dynrelocsec.size+(dynreloclist.count*dynrelocsec.shentsize)<>dynrelsize) then
               InternalError(2012110601);