LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-12-2005, 08:59 AM   #1
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 144

Rep: Reputation: 15
Unhappy Problem with shared libraries (uClibc) on small embedded system. Help !


I’m trying to get a small embedded system running with shared libraries. It all works when I build my programs with “–static”, but to save room I now need to share libraries. But I’m having no joy. I’ve read the Program Library HOWTO and done everything that seems relevant

Development is on a 2.2.16 kernel, and the embedded system is a 2.4.8. I’m using uClibc which may be in odd place, but it works.

I’m creating a file system image for my embedded system in a subdirectory called tiny-linux, then generate a rom file system, and gzip the result into an initrd image. It all works OK until I try to build/run a program using shared libraries.

Build on the development system goes like …

[mike@local mapit]$ make
gcc -Wall -g -isystem/usr/i386-linux-uclibc/usr/include/ -O -c mapit.c
gcc -Wall -o mapit mapit.o -nostdlib -nostartfiles /usr/i386-linux-uclibc/usr/li
b/crt0.o -L/usr/i386-linux-uclibc/usr/lib/ -lc -lm
[mike@local mapit]$ ldd mapit
/lib/libNoVersion.so.1 => /lib/libNoVersion.so.1 (0x40017000)
libc.so.0 => /usr/i386-linux-uclibc/lib/libc.so.0 (0x40022000)
libm.so.0 => /usr/i386-linux-uclibc/lib/libm.so.0 (0x4005f000)
libc.so.6 => /lib/libc.so.6 (0x40066000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
[mike@local mapit]$

[root@local work]# ldconfig -p -r./tiny-linux
9 libs found in cache `/etc/ld.so.cache'
libutil.so.0 (ELF) => /lib/libutil.so.0
libresolv.so.0 (ELF) => /lib/libresolv.so.0
libpthread.so.0 (ELF) => /lib/libpthread.so.0
libnsl.so.0 (ELF) => /lib/libnsl.so.0
libm.so.0 (ELF) => /lib/libm.so.0
libdl.so.0 (ELF) => /lib/libdl.so.0
libcrypt.so.0 (ELF) => /lib/libcrypt.so.0
libc.so.0 (ELF) => /lib/libc.so.0
ld-uClibc.so.0 (ELF) => /lib/ld-uClibc.so.0
[root@local work]#

When I run it on the target system all I get is

# ls -l /bin/mapit
-rwxr-xr-x 1 root root 27161 Jan 1 1970 /bin/mapit
# ./bin/mapit
./bin/mapit: No such file or directory
#

As I said, if I build the program with “-static” everything is OK.

It seems to me that it’s down to the libraries needed to resolve stuff when I build the program. I assume ld-linux.so is the loader, can I simply copy the loader from my development system, or should I be using ld-uClibc.so, in which case how do I tell the linker to use that rather then ld-linux.so.

Also libNoVersion. What’s that for ? Is there some way I can discover why that’s being linked to.

And lib.so.6, why is it using that rather than lib.so.0

Any help appreciated.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Will more shared libraries slow down my system? Yalla-One Slackware 5 04-20-2005 03:01 PM
shared libraries problem after install shadow-4.0.4.1 oluijks Linux From Scratch 0 05-11-2004 04:10 PM
Problem with shared libraries(gtk) k0ljat Linux - Software 1 04-12-2004 01:25 PM
Idraw shared libraries problem sicone Linux - Software 2 03-16-2004 08:49 PM
problem with shared libraries when printing blinux1 Linux - Newbie 4 03-25-2003 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration