[fpc-devel] internal error #200602251

2010-09-26 Thread Willibald Krenn

Hi!

Lately I spent some time debugging the internal error problem and it 
turns out that in method TCoffObjSection.fixuprelocs the .stabs section 
gets damaged: AFAICT the data.write statement in that method tries to 
replace a 4-byte offset pointer with an 8-byte (RELOC_ABSOLUTE) one.


Hence, I'd propose to (a) add some check for the data size to the method

  data.Seek(objreloc.dataoffset);
  data.Write(address,address_size);

  if (data.size  Size) then
 internal error

and (b) there needs to be a patch for .stabs offsets (relocs) to be 
4(?!) bytes only. To address (b) I tried to change 
TInternalAssembler.WriteStab(p:pchar) to use RELOC_ABSOLUTE32 but that 
did not seem to work. Also, I don't know whether the lines


if reloctype=RELOC_RELATIVE then
  begin
if win32 then
  dec(data,len-4)

in TCoffObjData.writereloc could potenially pose a problem. So in 
summing up, perhaps someone of the core-fpc developers can take over 
from here and do a fix for this problem?


TIA,
 Willi
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] internal error #200602251

2010-09-26 Thread Willibald Krenn

 Also, I don't know whether the lines


if reloctype=RELOC_RELATIVE then
begin
if win32 then
dec(data,len-4)

in TCoffObjData.writereloc could potenially pose a problem.


Please ignore the above comment in my previous mail.

Cheers,
 Willi
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel