Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-09

internal error #200602251

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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

Reply by email

Willibald Krenn
to Willibald Krenn

Also, I don't know whether the lines

Show quoted text 7 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

Reply by email

Pierre Free Pascal
to Willibald Krenn

Thank you so much!

It's been a while that I was trying to understand why stabs generation was messed up for win64 target.
Your suggestion is correct, I was able to
complete a cycle with DEBUG=1 using internal object writer and linker and get correct stabs information.
I will test a complete 'make clean all FPC=ppcx64 DEBUG=1' at fpcsrc level and check in the fix if it completes successfully.

Thanks again.

Pierre Muller

Show quoted text 15 lines
-----Message d'origine----- De : [mailto:fpc-devel- De la part de Willibald Krenn Envoyé : Tuesday, September 28, 2010 1:28 AM À : FPC developers' list Objet : Re: [fpc-devel] internal error #200602251 Proposed fix now in mantis, #0017500. Turns out RELOC_ABSOLUTE32 seems to work, I had forgotten to do a proper clean before checking.. :-\ Cheers, Willi _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Pierre Free Pascal
to Pierre Free Pascal

The complete compilation worked.

Patch committed in rev 16056 in trunk.

Thanks again!

Pierre

Show quoted text 41 lines
-----Message d'origine----- De : [mailto:fpc-devel- De la part de Pierre Free Pascal Envoyé : Tuesday, September 28, 2010 11:40 AM À : 'FPC developers' list' Objet : RE: [fpc-devel] internal error #200602251 Thank you so much! It's been a while that I was trying to understand why stabs generation was messed up for win64 target. Your suggestion is correct, I was able to complete a cycle with DEBUG=1 using internal object writer and linker and get correct stabs information. I will test a complete 'make clean all FPC=ppcx64 DEBUG=1' at fpcsrc level and check in the fix if it completes successfully. Thanks again. Pierre Muller > -----Message d'origine----- > De : [mailto:fpc-devel- > De la part de Willibald Krenn > Envoyé : Tuesday, September 28, 2010 1:28 AM > À : FPC developers' list > Objet : Re: [fpc-devel] internal error #200602251 > > Proposed fix now in mantis, #0017500. Turns out RELOC_ABSOLUTE32 seems > to work, I had forgotten to do a proper clean before checking.. :-\ > > Cheers, > Willi > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Willibald Krenn
to Pierre Free Pascal: Thank you so much! It's been a while that I was trying to understand why stabs generation…

Wow, that was quick! Thanks for putting this into trunk in record time! Cool, now I've got a working FPC and can start hacking on Delphi-like package stuff :)

Cheers,
Willi

Pierre Free Pascal wrote 13 lines
Thank you so much! It's been a while that I was trying to understand why stabs generation was messed up for win64 target. Your suggestion is correct, I was able to complete a cycle with DEBUG=1 using internal object writer and linker and get correct stabs information. I will test a complete 'make clean all FPC=ppcx64 DEBUG=1' at fpcsrc level and check in the fix if it completes successfully. Thanks again. Pierre Muller

Reply by email

Sven Barth
to Willibald Krenn
Willibald Krenn wrote
Wow, that was quick! Thanks for putting this into trunk in record time! Cool, now I've got a working FPC and can start hacking on Delphi-like package stuff :)

Keep us informed about your progress, please :D

Regards,
Sven

Reply by email