Преглед на файлове

avoid generating addressing like <label>+8(aX), since this might fail during linking if label is more than 32k away, fixes linking with lineinfo unit here

git-svn-id: trunk@26826 -
Károly Balogh преди 11 години
родител
ревизия
74533a7c90
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      compiler/m68k/cgcpu.pas

+ 6 - 0
compiler/m68k/cgcpu.pas

@@ -176,6 +176,12 @@ unit cgcpu;
      function isvalidreference(const ref: treference): boolean;
        begin
          isvalidreference:=isvalidrefoffset(ref) and
+
+           { don't try to generate addressing with symbol and base reg and offset
+             it might fail in linking stage if the symbol is more than 32k away (KB) }
+           not (assigned(ref.symbol) and (ref.base <> NR_NO) and (ref.offset <> 0)) and
+
+           { coldfire and 68000 cannot handle non-addressregs as bases }
            not ((current_settings.cputype in cpu_coldfire+[cpu_mc68000]) and
                 not isaddressregister(ref.base));
        end;