[fpc-devel] Re: Bug in revision 9781/2

Daniël Mantione daniel.mantione at freepascal.org
Sat Jan 19 10:33:52 CET 2008



Op Sat, 19 Jan 2008, schreef Karl-Michael Schindler:

> Hallo, it's me again.
>
> Bug is fixed with revision 9785

Well, not fixed, but just disabled on Darwin. However, it did finally 
succeed on Win32 this night.

>> Hi there,
>> 
>> when cycling fpc on macosx/darwin-386 (10.5) I get this error:
>> 
>> i386.inc(1198,1) Error: Unknown label identifier .LPIC
>> 
>> with revision 9781/2. I tried 2.3.1 and 2.2.1
>> 
>> "call .LPic" is actually one line before the declaration of ".LPic". My 
>> knowledge of asm is near zero. So, no idea whether this is allowed or not.

To access global variables in a PIC environment you need to get the value 
of the program counter. "call" puts the value on the stack and jumps to 
the label. You don't want to jump, just push the program counter, so you 
declare a label immedeately after the call instruction.

The "pop ebx" after it retrieves the pushed program counter from the stack 
again in ebx. So this code is correct. The reason why it didn't compile 
was case sensitivity of the ATT assembler reader, which Jonas did correct.

Jonas did disable it on Darwin as it apparently still did not work for 
him. It has to be the Darwin PIC code, allthough to the eye it seems 
correct to me.

Daniël


More information about the fpc-devel mailing list