summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaroly <karoly@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-16 17:03:41 +0000
committerkaroly <karoly@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-04-16 17:03:41 +0000
commit72d1077628ad1e44cf473884c01e89b4368e9ce1 (patch)
tree909f94b741801495a203aaab9b16cbca020cf787
parentc6e448e2909f4a88d83a1bff4147f6478b2ef707 (diff)
downloadfpc-72d1077628ad1e44cf473884c01e89b4368e9ce1.tar.gz
sinclairql: added startup code support for the 'packed' relocation table format in vlink. disabled for now.
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@49211 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--rtl/sinclairql/si_prc.pp24
1 files changed, 24 insertions, 0 deletions
diff --git a/rtl/sinclairql/si_prc.pp b/rtl/sinclairql/si_prc.pp
index e0b97cdff7..0d4133ee82 100644
--- a/rtl/sinclairql/si_prc.pp
+++ b/rtl/sinclairql/si_prc.pp
@@ -79,12 +79,36 @@ asm
move.l (a1)+,d7
beq @noreloc
+{.$DEFINE PACKEDRELOCS}
+{$IFNDEF PACKEDRELOCS}
@relocloop:
{ we read the offsets and relocate them }
move.l (a1)+,d1
add.l d0,(a0,d1)
subq.l #1,d7
bne @relocloop
+{$ELSE PACKEDRELOCS}
+ moveq #0,d2
+@relocloop:
+ { we read the offsets and relocate them }
+ moveq #0,d1
+ move.b (a1)+,d1
+ bne @addoffs
+ { if byte = 0, we have a long offset following }
+ move.b (a1)+,d1
+ lsl.w #8,d1
+ move.b (a1)+,d1
+ swap d1
+ move.b (a1)+,d1
+ lsl.w #8,d1
+ move.b (a1)+,d1
+ subq.l #4,d7
+@addoffs:
+ add.l d1,d2
+ add.l d0,(a0,d2)
+ subq.l #1,d7
+ bpl @relocloop
+{$ENDIF PACKEDRELOCS}
@noreloc:
move.l a7,a0