mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 17:49:13 +02:00
Take care about endianess in arm instruction binary code generator
This commit is contained in:
parent
318e31487a
commit
ce702df526
@ -5835,7 +5835,23 @@ implementation
|
|||||||
bytes:=((bytes shr 16) and $FFFF) or ((bytes and $FFFF) shl 16);
|
bytes:=((bytes shr 16) and $FFFF) or ((bytes and $FFFF) shl 16);
|
||||||
|
|
||||||
{ we're finished, write code }
|
{ we're finished, write code }
|
||||||
objdata.writebytes(bytes,bytelen);
|
if source_info.endian<>target_info.endian then
|
||||||
|
begin
|
||||||
|
if (bytelen=4) then
|
||||||
|
if target_info.endian=endian_little then
|
||||||
|
objdata.writeInt32LE(int32(bytes))
|
||||||
|
else
|
||||||
|
objdata.writeInt32BE(int32(bytes))
|
||||||
|
else if (bytelen=2) then
|
||||||
|
if target_info.endian=endian_little then
|
||||||
|
objdata.writeInt16LE(int32(bytes))
|
||||||
|
else
|
||||||
|
objdata.writeInt16BE(int32(bytes))
|
||||||
|
else
|
||||||
|
internalerror(2024022601);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
objdata.writebytes(bytes,bytelen);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user