[fpc-pascal] UDF+FREEBSD+FIREBIRD

KES kes-kes at yandex.ru
Wed Nov 12 21:03:45 CET 2008


Здравствуйте, Marc.

Вы писали 12 ноября 2008 г., 21:20:23:

MS> Am Mittwoch, den 12.11.2008, 20:00 +0100 schrieb Marc Santhoff:
>> Am Mittwoch, den 12.11.2008, 20:02 +0200 schrieb KES:
>> > I have tryed in C:
>> > 
>> > extern int fntest();
>> > 
>> > int fntest()
>> > {
>> > return 8;
>> > }
>> > 
>> > this work, but fpc does not (((
>> 
>> Maybe looking at the .o with nm helps to show you how the function name
>> is mangled.
>> 
>> Or use "fpc -s ..." and "gcc -S -fverbose-asm ..." on both source files
>> for comparing the labels in the generated assembler code.

MS> Oops, I meant "fpc -a ...".

MS> Marc



# Compiler executable checksum: 420481ffe9facb411cc92bbca2cb4405

        .text
        .p2align 4,,15
.globl fntest
        .type   fntest, @function
fntest:
        pushl   %ebp    #
        movl    %esp, %ebp      #,
        movl    $8, %eax        #, D.1541
        popl    %ebp    #
        ret
        .size   fntest, .-fntest
        .ident  "GCC: (GNU) 4.2.1 20070719  [FreeBSD]"



        .file "tkes2"
# Begin asmlist al_begin
# End asmlist al_begin
# Begin asmlist al_stabs
# End asmlist al_stabs
# Begin asmlist al_procedures

.section .text
        .balign 4,0x90
.globl  P$TKES2_SOMEFN$$LONGINT
        .type   P$TKES2_SOMEFN$$LONGINT, at function
P$TKES2_SOMEFN$$LONGINT:
.globl  somefn
        .type   somefn, at function
somefn:
        pushl   %ebp
        movl    %esp,%ebp
        subl    $4,%esp
        movl    $3,-4(%ebp)
        movl    -4(%ebp),%eax
        leave
        ret
.Le0:
        .size   P$TKES2_SOMEFN$$LONGINT, .Le0 - P$TKES2_SOMEFN$$LONGINT

.section .text
        .balign 4,0x90
.globl  PASCALMAIN
        .type   PASCALMAIN, at function
PASCALMAIN:
.globl  P$TKES2_main
        .type   P$TKES2_main, at function
P$TKES2_main:
        pushl   %ebp
        movl    %esp,%ebp
        call    FPC_INITIALIZEUNITS
        leave
        ret
.Le1:
        .size   P$TKES2_main, .Le1 - P$TKES2_main

.section .text
        .balign 4,0x90
.globl  _somefn
        .type   _somefn, at function
_somefn:
        jmp     P$TKES2_SOMEFN$$LONGINT
.Le2:
        .size   _somefn, .Le2 - _somefn
# End asmlist al_procedures
# Begin asmlist al_globals

.section .data
        .balign 4
.globl  THREADVARLIST_P$TKES2
        .type   THREADVARLIST_P$TKES2, at object
THREADVARLIST_P$TKES2:
        .long   0
.Le3:
        .size   THREADVARLIST_P$TKES2, .Le3 - THREADVARLIST_P$TKES2

.section .data
        .balign 4
.globl  INITFINAL
        .type   INITFINAL, at object
INITFINAL:
        .long   2,0
        .long   INIT$_SYSTEM
        .long   0
        .long   INIT$_OBJPAS
        .long   FINALIZE$_OBJPAS
.Le4:
        .size   INITFINAL, .Le4 - INITFINAL

.section .data
        .balign 4
.globl  FPC_THREADVARTABLES
        .type   FPC_THREADVARTABLES, at object
FPC_THREADVARTABLES:
        .long   3
        .long   THREADVARLIST_SYSTEM
        .long   THREADVARLIST_OBJPAS
        .long   THREADVARLIST_P$TKES2
.Le5:
        .size   FPC_THREADVARTABLES, .Le5 - FPC_THREADVARTABLES
.section .data
        .balign 4
.globl  FPC_RESOURCESTRINGTABLES
        .type   FPC_RESOURCESTRINGTABLES, at object
FPC_RESOURCESTRINGTABLES:
        .long   0
.Le6:
        .size   FPC_RESOURCESTRINGTABLES, .Le6 - FPC_RESOURCESTRINGTABLES

.section .fpc
        .balign 4
        .ascii  "FPC 2.2.0 [2008/11/09] for i386 - FreeBSD"

.section .data
        .balign 4
.globl  __stklen
        .type   __stklen, at object
__stklen:
        .long   262144

.section .data
        .balign 4
.globl  __heapsize
        .type   __heapsize, at object
__heapsize:
        .long   0

.section .data
.globl  __fpc_valgrind
        .type   __fpc_valgrind, at object
__fpc_valgrind:
        .byte   0
# End asmlist al_globals
# Begin asmlist al_const
# End asmlist al_const
# Begin asmlist al_typedconsts
# End asmlist al_typedconsts
# Begin asmlist al_rotypedconsts
# End asmlist al_rotypedconsts
# Begin asmlist al_threadvars
# End asmlist al_threadvars
# Begin asmlist al_imports
# End asmlist al_imports
# Begin asmlist al_exports
# End asmlist al_exports
# Begin asmlist al_resources
# End asmlist al_resources
# Begin asmlist al_rtti
# End asmlist al_rtti
# Begin asmlist al_dwarf
# End asmlist al_dwarf
# Begin asmlist al_dwarf_info
# End asmlist al_dwarf_info
# Begin asmlist al_dwarf_abbrev
# End asmlist al_dwarf_abbrev
# Begin asmlist al_dwarf_line
# End asmlist al_dwarf_line
# Begin asmlist al_picdata
# End asmlist al_picdata
# Begin asmlist al_resourcestrings
# End asmlist al_resourcestrings
# Begin asmlist al_end
# End asmlist al_end


-- 
С уважением,
 KES                          mailto:kes-kes at yandex.ru




More information about the fpc-pascal mailing list