+ optimization: don't emit relative relocation entries to the same section in

the omf obj writer

git-svn-id: trunk@30808 -
This commit is contained in:
nickysn 2015-05-06 10:05:15 +00:00
parent d0b365c99a
commit 328a4fa19a

View File

@ -472,6 +472,14 @@ implementation
objreloc:=TOmfRelocation.CreateSymbol(CurrObjSec.Size,p,Reloctype);
CurrObjSec.ObjRelocations.Add(objreloc);
end
{ relative relocations within the same section can be calculated directly,
without the need to emit a relocation entry }
else if (p.objsection=CurrObjSec) and
(p.bind<>AB_COMMON) and
(Reloctype=RELOC_RELATIVE) then
begin
data:=data+symaddr-len-CurrObjSec.Size;
end
else
begin
objreloc:=TOmfRelocation.CreateSection(CurrObjSec.Size,p.objsection,Reloctype);