Jonas Maebe wrote:

On 01 Jun 2009, at 12:30, Jonas Maebe wrote:

On 01 Jun 2009, at 11:40, Coco Pascal wrote:

It looks as if the code isn't executed at all. Maybe Firebird requires PIC.

That is extremely unlikely (I'd say "impossible", but that's dangerous). Whether or not the code in the library is position-independent is something Firebird has no clue about (unless it starts disassembling the library and/or reading the relocation information).

Not to mention that it would make no difference for the function you posted, since it does not refer to any other code nor to global data.

This made me start a test again with a clean sheet and guess...

function VV(const AValue: LongInt): LongInt; cdecl; export;
begin
Result := AValue;
end;

works fine now.
But if I add the following function it returns wrong results. This one does refer to other code.

function Y_Odd(const AValue: LongInt): LongInt; cdecl; export;
begin
if Odd(AValue) then
Result := -1
else
Result := 0;
end;

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to