diff options
author | sergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2012-07-26 10:04:12 +0000 |
---|---|---|
committer | sergei <sergei@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2012-07-26 10:04:12 +0000 |
commit | ad4f252baaf0d4f888a3b8f3dc27b7f8243b8d32 (patch) | |
tree | 273a1c218b328a16d689f77f7a30e5c1f762762f /compiler/ognlm.pas | |
parent | c2babe690fb7cbb6afe1afda78cfb5f0ed9ca17b (diff) | |
download | fpc-ad4f252baaf0d4f888a3b8f3dc27b7f8243b8d32.tar.gz |
+ Implemented two-stage removal of empty exe sections. Candidates for removal are first marked with oso_disabled flag, then actually removed. Descendants of TExeOutput that override MemPos_Start may modify list of sections pending removal. In particular, the COFF-specific .reloc section no longer has to be handled in base TExeOutput class.
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21971 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/ognlm.pas')
-rw-r--r-- | compiler/ognlm.pas | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/ognlm.pas b/compiler/ognlm.pas index 42606b3af1..74c2b0f59c 100644 --- a/compiler/ognlm.pas +++ b/compiler/ognlm.pas @@ -281,7 +281,7 @@ const NLM_MAX_DESCRIPTION_LENGTH = 127; procedure DataPos_Header;override; procedure fillNlmVersionHeader; procedure GenerateLibraryImports(ImportLibraryList:TFPHashObjectList);override; - procedure Order_End;override; + procedure MemPos_Start;override; procedure MemPos_ExeSection(const aname:string);override; procedure DataPos_ExeSection(const aname:string);override; procedure NLMwriteString (const s : string; terminateWithZero : boolean); @@ -1172,7 +1172,7 @@ function SecOpts(SecOptions:TObjSectionOptions):string; exesec:=FindExeSection('.reloc'); if exesec=nil then exit; - objsec:=internalObjData.createsection('.reloc',0,exesec.SecOptions+[oso_data]); + objsec:=internalObjData.createsection('.reloc',0,[oso_data,oso_load,oso_keep]); exesec.AddObjSection(objsec); for i:=0 to ExeSectionList.Count-1 do begin @@ -1227,15 +1227,15 @@ function SecOpts(SecOptions:TObjSectionOptions):string; end; - procedure TNLMexeoutput.Order_End; + procedure TNLMexeoutput.MemPos_Start; var exesec : TExeSection; begin - inherited; exesec:=FindExeSection('.reloc'); if exesec=nil then - exit; - exesec.SecOptions:=exesec.SecOptions + [oso_Data,oso_keep,oso_load]; + InternalError(2012072602); + exesec.SecOptions:=exesec.SecOptions-[oso_disabled]; + inherited; end; |