Question about static or dynamic linking of userspace app

Andrew Stubbs ams at codesourcery.com
Wed Feb 9 10:03:53 UTC 2011


On 09/02/11 08:31, Fabio Giovagnini wrote:
> Two questions:
> 1) is this the last release of the toolchian for uclinux with FDPIC support?

There is a new, updated toolchain here:

http://www.codesourcery.com/sgpp/lite/superh

> 2) Now I have 4 MiB of jffs2 filesystem. The libuClibc-0.9.30-svn.so is 51,1 MB
> (53583624 byte). I understand it is not possible to have dynamic linking in
> this conditions. It it true?

I'm not sure I fully understand the question. Are you saying that you 
can't have dynamic libraries because they are too large for your 
file-system? If so, then you may well be right, but there is still hope!

In addition to the usual things like stripping the binaries or using a 
compressed file system, you might be able to use the "mklibs" Library 
Reduction Utility to reduce the binary size.

CodeSourcery does not bundle this tool into the Lite editions, but it 
does feature in the full products (there isn't one for FDPIC, but the 
regular Linux version might work with some tweaking - I believe it just 
needs to be pointed at the correct linker/objdump tools), and of course 
you can get it from the upstream repository.

This tool removes everything from the dynamic libraries that are not 
used by the set of binaries you specify. This means that the code 
remains shared, and so reduces both run-time memory usage, and 
file-system storage space. The down-side is that you can't run arbitrary 
binaries on your system - you have to be sure they don't have additional 
symbol dependencies.

Hope that helps

Andrew



More information about the superh-gnu-discuss mailing list