Contents

Using Shared Library on uClinux

Shared Library support is important for various cases. Especially if you are using uClinux with LGPL library, if there is no Shared Library support with your system, that means you get hit by GPL/LGPL license issue because LGPL library can only be linked by Shared Library (dynamic link) or the application source code needs to be provided to the customer (if the customer wants).

There were various efforts for supporting Shared Library on uClinux so far. This page describes those efforts with corresponding information.

Shared FLAT

The Shared FLAT format follows the FLAT format in terms of being an extremely stripped down and lightweight format:

minimal file header (~48 bytes)

minimal relocation table

only sections actually needed at runtime are retained (.text/.data/etc...)

However, these things come by sacrificing flexibility:

every shared library has a unique hardcoded ID numbers which must be managed manually

maximum of ~256 shared libs

no dynamic support (libdl -- dlopen/dlsym/dlclose/etc...)

maximum individual executable size of 8megs

FDPIC ELF

The FDPIC ELF format brings all the amenities of the standard ELF format as seen on Desktop Linux systems. The trade offs are mostly obvious:

Kernel 2.6.x status

There are two options with recent kernels:

Shared FLAT format (grep the kernel for CONFIG_BINFMT_SHARED_FLAT)

FDPIC ELF (originally the implemented for FR-V)

Most no-mmu Linux architectures support Shared FLAT, but the FDPIC ELF format is gathering ports. Support will greatly depend on the exact kernel version you are using, so check the fs/Kconfig.binfmt file if you are unsure.

When they stopped, some of their code was released under GPL because they had something to do with Texas Instruments. Monta Vista may have some more information on this but currently none has seen Ridge Run's Shared Library implementation code at the open source region.

But after they are back to their business, the new Ridge Run has set up xflat as an open source project at http://www.xflat.org

m68knommu

Shared library support was working in gcc 2.95.3 with older 2.4 kernels from Snapgear.

GCC 3.x does not work with shared libraries.

The Code Sourcery toolchain 4.4-216 is working with linux kernel 2.6.34.

Credit

This rough page was originally created by Shawn Kwon but most of the information were collected from comments of various people including Paul Mundt, Steve Bunch, Tim Bird, Greg Ungerer, Todd Fischer, Alan Carvalho de Assis at celinux-dev mailing list. All the credit should go to them.