From 45e03d768e9daa0d0761e28408d613e0f3ecd68e Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Tue, 11 Mar 2014 23:18:54 +0000 Subject: [PATCH] * handle ARM PIC jump tables in determining the maximum offset for pc-relative loads git-svn-id: trunk@27105 - --- compiler/arm/aasmcpu.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/arm/aasmcpu.pas b/compiler/arm/aasmcpu.pas index 83d66b0984..1e0ba73e2a 100644 --- a/compiler/arm/aasmcpu.pas +++ b/compiler/arm/aasmcpu.pas @@ -1037,9 +1037,10 @@ implementation begin case taicpu(hp).opcode of A_BX, - A_LDR: + A_LDR, + A_ADD: { approximation if we hit a case jump table } - if ((taicpu(hp).opcode=A_LDR) and not(GenerateThumbCode or GenerateThumb2Code) and + if ((taicpu(hp).opcode in [A_ADD,A_LDR]) and not(GenerateThumbCode or GenerateThumb2Code) and (taicpu(hp).oper[0]^.typ=top_reg) and (taicpu(hp).oper[0]^.reg=NR_PC)) or ((taicpu(hp).opcode=A_BX) and (GenerateThumbCode) and