Hi, We are implementing uclibc port for CR16 target with shared library support. However, there was an issue observed during testing the port with shared library.
The following link was referred to compile the applications with static and shared libraries:- http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html The application contains a main.c file which calls lib_func function in lib.c file. ======================================================================= static int val = 1 ; static void init( void ) { val = 13 ; } int lib_func( const char* s ) { printf( "\tEntering %s, called from %s\n\n", __FUNCTION__, s ) ; return val ; } ======================================================================= The application with static library generates correct output "13" by calling init function init(). However, with shared library; it does not seem to call init() and generates wrong output "1" as follows:- ================================================== Starting ./test.out... Entering lib_func, called from ./test.out lib_func() returned 1 ================================================== Please find attached the command file "command" which shows exact commands used for application and library compilation. On investigation, the problem seem to be due to the incorrect calling of initialization routines in crt files. It was observed that the shared library calls "shared_flat_add_library" in crt1.S file. The same routine is used in bfin and m68k code. Please find attached the initialization files crt1.S file present in uClibc/libc/sysdeps/linux/cr16 folder. Please let us know if anything else should be done for the proper functioning of initialization code in shared libraries. Thanks & Regards, Naveen
crt1.S
Description: crt1.S
FILE QUARANTINED Microsoft Forefront Protection for Exchange Server HC01 removed a file since it was found to match a filter. File name: "winmail.dat->command.sh" Filter name: "FILE FILTER= Custom Filter: *.sh"
_______________________________________________ uClibc mailing list [email protected] http://lists.busybox.net/mailman/listinfo/uclibc
