library project1;

{$mode objfpc}{$H+}

function foo: LongInt;
var
  x: LongInt = 0;
begin
  Result := x;
end;

exports
  foo;

{$R *.res}

begin
end.

the following is in the diff when i switch from program to library:

***************
*** 12,19 ****
        pushl   %ebp
        movl    %esp,%ebp
        subl    $8,%esp
-       movl    TC_P$PROJECT1_FOO$$LONGINT_defaultx,%eax
-       movl    %eax,-8(%ebp)
        movl    -8(%ebp),%eax
        movl    %eax,-4(%ebp)
        movl    -4(%ebp),%eax

These two assembler statements are missing when compiled as library, but the
TC_P$PROJECT1_FOO$$LONGINT_defaultx
in the data section at the end is still there and there:

.section .data.n_tc_p$project1_foo$$longint_defaultx
        .balign 4
.globl  TC_P$PROJECT1_FOO$$LONGINT_defaultx
TC_P$PROJECT1_FOO$$LONGINT_defaultx:
        .long   0

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to