[fpc-devel] internal error #200602251

Willibald Krenn Willibald.Krenn at gmx.at
Sun Sep 26 23:33:37 CEST 2010


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



More information about the fpc-devel mailing list