mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 07:34:28 +02:00
* do not generate blx instructions, the generation of blx instead of bl was introduced some years ago but today it proves to be wrong: if necessary, the linker converts the bl into a blx, this is also how gcc and clang handle it
git-svn-id: trunk@32788 -
This commit is contained in:
parent
c929bb32ae
commit
3f2057a2f2
@ -646,11 +646,13 @@ unit cgcpu;
|
||||
sym : TAsmSymbol;
|
||||
begin
|
||||
{ check not really correct: should only be used for non-Thumb cpus }
|
||||
if (CPUARM_HAS_BLX_LABEL in cpu_capabilities[current_settings.cputype]) and
|
||||
{ WinCE GNU AS (not sure if this applies in general) does not support BLX imm }
|
||||
(target_info.system<>system_arm_wince) then
|
||||
branchopcode:=A_BLX
|
||||
else
|
||||
// if (CPUARM_HAS_BLX_LABEL in cpu_capabilities[current_settings.cputype]) and
|
||||
// { WinCE GNU AS (not sure if this applies in general) does not support BLX imm }
|
||||
// (target_info.system<>system_arm_wince) then
|
||||
// branchopcode:=A_BLX
|
||||
// else
|
||||
{ use always BL as newer binutils do not translate blx apparently
|
||||
generating BL is also what clang and gcc do by default }
|
||||
branchopcode:=A_BL;
|
||||
if not(weak) then
|
||||
sym:=current_asmdata.RefAsmSymbol(s)
|
||||
|
@ -547,11 +547,14 @@ asm
|
||||
{$endif}
|
||||
stmfd sp!, {r1, lr}
|
||||
sub r0, r1, #8
|
||||
{$if defined(CPUARM_HAS_BLX_LABEL) and not(defined(WINCE))}
|
||||
blx InterLockedDecrement
|
||||
{$else defined(CPUARM_HAS_BLX_LABEL) and not(defined(WINCE))}
|
||||
|
||||
// We use always bl, as newer binutils apparently never translate blx into bl
|
||||
// {$if defined(CPUARM_HAS_BLX_LABEL) and not(defined(WINCE))}
|
||||
// blx InterLockedDecrement
|
||||
// {$else defined(CPUARM_HAS_BLX_LABEL) and not(defined(WINCE))}
|
||||
bl InterLockedDecrement
|
||||
{$endif defined(CPUARM_HAS_BLX_LABEL) and not(defined(WINCE))}
|
||||
// {$endif defined(CPUARM_HAS_BLX_LABEL) and not(defined(WINCE))}
|
||||
|
||||
// InterLockedDecrement is a nice guy and sets the z flag for us
|
||||
// if the reference count dropped to 0
|
||||
ldmnefd sp!, {r1, pc}
|
||||
|
Loading…
Reference in New Issue
Block a user