[fpc-devel] internal error #200602251

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


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


   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
                     if win32 then

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?


More information about the fpc-devel mailing list