* 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 -
This commit is contained in:
sergei 2012-12-05 15:49:45 +00:00
parent 7524b9219c
commit 67a41e1e94

View File

@ -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);