[fpc-pascal] BUG: FPC must not expect main for shared library

KES kes-kes at yandex.ru
Fri Nov 21 18:04:10 CET 2008

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

Вы писали 17 ноября 2008 г., 12:01:39:

MVC> On Sun, 16 Nov 2008, KES wrote:

>> MVC>> loading library failed testudf.so: cannot open shared object file: No such file or directory
>> MVC>> Of course,  you must correct the names.
>> MVC>> Michael.
>> K> home# ./a.out
>> K> loading library failed /usr/lib/libtestudf.so: Undefined symbol "main"
>> K> in output of nm libtetudf.so
>> K> I have noticed this:
>> K> 0001d950 t gcc2_compiled.
>> K>          U main
>> K> 00039758 B operatingsystem_parameter_argc
>> K> "U main" what this mean??

MVC> Apparently, the FPC library startup code expects there to be a "main" symbol,
MVC> (normally the main program entry point) and it isn't there in FreeBSD.

MVC> That is why the library cannot be loaded. I don't know how to solve this,
MVC> I expect Marco Van de Voort or Ales Katona to be able to answer that.

for example in C shared library there is no 'main' entry point:
testudf.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (FreeBSD), dynamically linked, not stripp
00001630 A _DYNAMIC
         w _Jv_RegisterClasses
000016f4 d __CTOR_END__
000016f0 d __CTOR_LIST__
000016fc d __DTOR_END__
000016f8 d __DTOR_LIST__
0000162c r __FRAME_END__
00001700 d __JCR_END__
00001700 d __JCR_LIST__
0000171c A __bss_start
         w __cxa_finalize@@FBSD_1.0
00000550 t __do_global_ctors_aux
000004a0 t __do_global_dtors_aux
00001624 d __dso_handle
00000537 t __i686.get_pc_thunk.bx
0000171c A _edata
00001720 A _end
00000584 T _fini
0000046c T _init
00000540 T c_test
0000171c b completed.4685
00000500 t frame_dummy
00001628 d p.4683

I think FPC must not expect 'main' entry point

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

More information about the fpc-pascal mailing list