Kaynağa Gözat

* More correct fix for overflow check for RELOC_RELATIVE_24.
* Fixed 2007062701 while linking DLL.

git-svn-id: trunk@11484 -

yury 17 yıl önce
ebeveyn
işleme
eb9c9c77d8
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 3 3
      compiler/ogcoff.pas

+ 3 - 3
compiler/ogcoff.pas

@@ -840,10 +840,10 @@ const pemagic : array[0..3] of byte = (
 {$ifdef arm}
               RELOC_RELATIVE_24:
                 begin
-                  relocval:=(relocval - mempos - objreloc.dataoffset) shr 2 - 2;
+                  relocval:=longword(relocval - mempos - objreloc.dataoffset) shr 2 - 2;
                   address:=address or (relocval and $ffffff);
                   relocval:=relocval shr 24;
-                  if (relocval<>$ff) and (relocval<>0) then
+                  if (relocval<>$3f) and (relocval<>0) then
                     internalerror(200606085);  { offset overflow }
                 end;
 {$endif arm}
@@ -2604,7 +2604,7 @@ const pemagic : array[0..3] of byte = (
                     if not (objreloc.typ in [{$ifdef x86_64}RELOC_ABSOLUTE32,{$endif x86_64}RELOC_ABSOLUTE]) then
                       continue;
                     offset:=objsec.MemPos+objreloc.dataoffset;
-                    if offset<pgaddr then
+                    if (offset<pgaddr) and (pgaddr<>longword(-1)) then
                       Internalerror(2007062701);
                     if (offset-pgaddr>=4096) or (pgaddr=longword(-1)) then
                       begin