From 322a64dbca8bcb5a573a1bdffca511fc035ca95f Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 21 Nov 2018 00:32:21 +0000 Subject: [PATCH] binmunge: allow relocations for function vector register loads sdcc can generate this kind of code, so we need to generate stubs for 16bit register load fixups in code space cp #1 jr z, 1f ld hl,#func jr 2f 1f: ld hl,#func2 2f: push de push bc jp callhl pop bc pop de --- Kernel/tools/binmunge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kernel/tools/binmunge.c b/Kernel/tools/binmunge.c index b7f9ebec..c52aa86f 100644 --- a/Kernel/tools/binmunge.c +++ b/Kernel/tools/binmunge.c @@ -153,6 +153,9 @@ void code_reloc(uint8_t sbank, uint16_t ptr, uint8_t dbank) } switch(buf[sbank][ptr-1]) { + case 0x01: /* LD BC, */ + case 0x11: /* LD DE, */ + case 0x21: /* LD HL/IX/IY, */ case 0xC3: /* JP - needs stub */ if (v) printf("Converting JP at %04x to stub\n", ptr); -- 2.34.1