Преглед изворни кода

Fix an issue with local BLX branches not being turned into BL branches.

git-svn-id: branches/laksen/armiw@29355 -
Jeppe Johansen пре 10 година
родитељ
комит
cbd75428c0
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      compiler/arm/aasmcpu.pas

+ 5 - 0
compiler/arm/aasmcpu.pas

@@ -3377,6 +3377,11 @@ implementation
                   else
                   else
                     begin
                     begin
                       offset:=((currsym.offset-insoffset-8) and $3fffffe);
                       offset:=((currsym.offset-insoffset-8) and $3fffffe);
+
+                      { Turn BLX into BL if the destination isn't odd, could happen with recursion }
+                      if not odd(offset shr 1) then
+                        bytes:=(bytes and $EB000000) or $EB000000;
+
                       bytes:=bytes or ((offset shr 2) and $ffffff);
                       bytes:=bytes or ((offset shr 2) and $ffffff);
                       bytes:=bytes or ((offset shr 1) and $1) shl 24;
                       bytes:=bytes or ((offset shr 1) and $1) shl 24;
                     end;
                     end;