|
@@ -620,9 +620,10 @@ implementation
|
|
|
end;
|
|
|
|
|
|
|
|
|
- procedure doalign(alignment: byte; use_op: boolean; fillop: byte; out last_align: longint;lasthp:tai);
|
|
|
+ procedure doalign(alignment: byte; use_op: boolean; fillop: byte; maxbytes: byte; out last_align: longint;lasthp:tai);
|
|
|
var
|
|
|
i: longint;
|
|
|
+ alignment64 : int64;
|
|
|
{$ifdef m68k}
|
|
|
instr : string;
|
|
|
{$endif}
|
|
@@ -649,14 +650,33 @@ implementation
|
|
|
else
|
|
|
begin
|
|
|
{$endif m68k}
|
|
|
- writer.AsmWrite(#9'.balign '+tostr(alignment));
|
|
|
- if use_op then
|
|
|
- writer.AsmWrite(','+tostr(fillop))
|
|
|
+ alignment64:=alignment;
|
|
|
+ if (maxbytes<>alignment) and ispowerof2(alignment64,i) then
|
|
|
+ begin
|
|
|
+ if use_op then
|
|
|
+ begin
|
|
|
+ writer.AsmWrite(#9'.p2align '+tostr(i)+','+tostr(fillop)+','+tostr(maxbytes));
|
|
|
+ writer.AsmLn;
|
|
|
+ writer.AsmWrite(#9'.p2align '+tostr(i-1)+','+tostr(fillop));
|
|
|
+ end
|
|
|
+ else
|
|
|
+ begin
|
|
|
+ writer.AsmWrite(#9'.p2align '+tostr(i)+',,'+tostr(maxbytes));
|
|
|
+ writer.AsmLn;
|
|
|
+ writer.AsmWrite(#9'.p2align '+tostr(i-1));
|
|
|
+ end
|
|
|
+ end
|
|
|
+ else
|
|
|
+ begin
|
|
|
+ writer.AsmWrite(#9'.balign '+tostr(alignment));
|
|
|
+ if use_op then
|
|
|
+ writer.AsmWrite(','+tostr(fillop))
|
|
|
{$ifdef x86}
|
|
|
- { force NOP as alignment op code }
|
|
|
- else if (LastSecType=sec_code) and (asminfo^.id<>as_solaris_as) then
|
|
|
- writer.AsmWrite(',0x90');
|
|
|
+ { force NOP as alignment op code }
|
|
|
+ else if (LastSecType=sec_code) and (asminfo^.id<>as_solaris_as) then
|
|
|
+ writer.AsmWrite(',0x90');
|
|
|
{$endif x86}
|
|
|
+ end;
|
|
|
{$ifdef m68k}
|
|
|
end;
|
|
|
{$endif m68k}
|
|
@@ -746,7 +766,7 @@ implementation
|
|
|
|
|
|
ait_align :
|
|
|
begin
|
|
|
- doalign(tai_align_abstract(hp).aligntype,tai_align_abstract(hp).use_op,tai_align_abstract(hp).fillop,last_align,lasthp);
|
|
|
+ doalign(tai_align_abstract(hp).aligntype,tai_align_abstract(hp).use_op,tai_align_abstract(hp).fillop,tai_align_abstract(hp).maxbytes,last_align,lasthp);
|
|
|
end;
|
|
|
|
|
|
ait_section :
|