AnsweredAssumed Answered

application linked with shared libraries

Question asked by dbutter on Aug 7, 2013
Latest reply on Jun 4, 2014 by dbutter



For my application I need to use shared libraries on uClinux/blackfin. I have build the kernel and usespace with support for FDPIC/shared, but I cannot get a simple hello world (dynamically linked) to run. I'm using buildroot/kernel/toolchain checked out from about 1-week ago.The target is a BF537.


Here is an example:


/* testlib.c --- */

/* Code: */

#include <stdio.h>

int hello()


  printf("hello from shared library\n");

  return 0;


/* testlib.c ends here */


/* test.c --

/* Code: */

#include <stdio.h>

int hello();


int main()



  return 0;


/* test.c ends here */


Then I build it as follows:


db@dbl:/opt/nfs$ bfin-linux-uclibc-gcc -Wall -c testlib.c

db@dbl:/opt/nfs$ bfin-linux-uclibc-gcc -Wall -o testlib.o -shared -Wl,-soname,

db@dbl:/opt/nfs$ bfin-linux-uclibc-gcc -Wall -c test.c

db@dbl:/opt/nfs$ bfin-linux-uclibc-gcc -o test test.o -L. -ltest

db@dbl:/opt/nfs$ bfin-linux-uclibc-ldd ./test

checking sub-depends for ''

checking sub-depends for 'not found'

checking sub-depends for 'not found' => (0x00000000) => not found (0x00000000) => not found (0x00000000)

    not a dynamic executable


So I made sure the referenced libraries are in a standard path (/lib) on target and run "test" on target:


root:/opt/nfs> ./test

sh: can't execute './test': No such file or directory


What am I missing here?




Regards, Devin