summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-04-26 15:35:03 +0000
committernickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-04-26 15:35:03 +0000
commit7a6e13f7653cce58d37ff58d853865da45deb4b1 (patch)
tree86f059ee5389db6504d58c6797f020046eaa4699
parenta50cd07756a7a58dd567665986b90454dc97e62e (diff)
downloadfpc-7a6e13f7653cce58d37ff58d853865da45deb4b1.tar.gz
* fixed section writing with smartlinking the sdcc-sdasz80 asm writer
git-svn-id: https://svn.freepascal.org/svn/fpc/branches/z80@45103 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/z80/agsdasz80.pas18
1 files changed, 11 insertions, 7 deletions
diff --git a/compiler/z80/agsdasz80.pas b/compiler/z80/agsdasz80.pas
index 0c331f4660..e161aa1c0b 100644
--- a/compiler/z80/agsdasz80.pas
+++ b/compiler/z80/agsdasz80.pas
@@ -525,7 +525,7 @@ unit agsdasz80;
var
lasthp,
hp: tai;
- s: string;
+ s, LastSecName: string;
counter,lines,i,j,l,tokens,pos,last_align: longint;
quoted, do_line: Boolean;
consttype: taiconst_type;
@@ -533,6 +533,8 @@ unit agsdasz80;
InlineLevel : longint;
prevfileinfo : tfileposinfo;
previnfile : tinputfile;
+ LastAlign: Integer;
+ LastSecOrder: TAsmSectionOrder;
begin
if not assigned(p) then
exit;
@@ -815,20 +817,22 @@ unit agsdasz80;
end;
{ avoid empty files }
LastSecType:=sec_none;
- //LastSecName:='';
- //LastAlign:=4;
+ LastSecName:='';
+ LastSecOrder:=secorder_default;
+ LastAlign:=1;
while assigned(hp.next) and (tai(hp.next).typ in [ait_cutobject,ait_section,ait_comment]) do
begin
if tai(hp.next).typ=ait_section then
begin
LastSecType:=tai_section(hp.next).sectype;
- {LastSecName:=tai_section(hp.next).name^;
- LastAlign:=tai_section(hp.next).secalign;}
+ LastSecName:=tai_section(hp.next).name^;
+ LastSecOrder:=tai_section(hp.next).secorder;
+ LastAlign:=tai_section(hp.next).secalign;
end;
hp:=tai(hp.next);
end;
- {if LastSecType<>sec_none then
- WriteSection(LastSecType,LastSecName,LastAlign);}
+ if LastSecType<>sec_none then
+ WriteSection(LastSecType,LastSecName,LastSecOrder,LastAlign);
writer.MarkEmpty;
//NewObject:=true;
end;