From 3f62c5f5ef62b791b22aadf5059041619e88a5a2 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Tue, 21 Apr 2020 06:05:14 +0000 Subject: [PATCH] + introduce a virtual method for writing the section flags git-svn-id: trunk@44928 - --- compiler/aggas.pas | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/compiler/aggas.pas b/compiler/aggas.pas index e2f28b261e..9a4d641d09 100644 --- a/compiler/aggas.pas +++ b/compiler/aggas.pas @@ -49,6 +49,7 @@ interface function sectionattrs(atype:TAsmSectiontype):string;virtual; function sectionattrs_coff(atype:TAsmSectiontype):string;virtual; function sectionalignment_aix(atype:TAsmSectiontype;secalign: longint):string; + function sectionflags(secflags:TSectionFlags):string;virtual; procedure WriteSection(atype:TAsmSectiontype;const aname:string;aorder:TAsmSectionOrder;secalign:longint; secflags:TSectionFlags=[];secprogbits:TSectionProgbits=SPB_None);virtual; procedure WriteExtraHeader;virtual; @@ -454,6 +455,24 @@ implementation end; + function TGNUAssembler.sectionflags(secflags:TSectionFlags):string; + var + secflag : TSectionFlag; + begin + result:=''; + for secflag in secflags do begin + case secflag of + SF_A: + result:=result+'a'; + SF_W: + result:=result+'w'; + SF_X: + result:=result+'x'; + end; + end; + end; + + function TGNUAssembler.sectionalignment_aix(atype:TAsmSectiontype;secalign: longint): string; var l: longint; @@ -544,16 +563,7 @@ implementation begin if usesectionflags then begin - s:=',"'; - for secflag in secflags do - case secflag of - SF_A: - s:=s+'a'; - SF_W: - s:=s+'w'; - SF_X: - s:=s+'x'; - end; + s:=',"'+sectionflags(secflags); writer.AsmWrite(s+'"'); end; if usesectionprogbits then