[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] dynamic libs



W dniu 11.10.2011 20:40, Peter Slegg pisze:
On Tue, 11 Oct 2011 15:45:28 , Adam K?obukowski wrote:
W dniu 10.10.2011 20:17, Peter Slegg pisze:

I just wondered what the current thoughts are.

Fromm Gcc viewpoint, it does not matter if dynamic lib is shared or not.
If it is not shared - every application loads its own copy. If it is
shared - (usually) every process lives in its own address space, so it
sees its 'own' copy, and all changes to it are done locally anyway.

It is also possible to have shared libs with common address space for
all processes, but extra care must be taken when writing such libs (it
must be reentrant).

AdamK


So could, for instance Highwire, be compiled to load its own libs at
runtime instead of static linking ?

What would be required to do this ? Do the libs have to be changed or
is is it just a matter of making sure the right parts are installed on
the system ?

Atm, nothing - we have SLBs - they can be loaded at runtime. But an app has to do it on its own.

A better solution would be a proper unix style dynamic (shared) libraries suppoert with ELF binary format, ld and so on. This way we would have dynamic libs support for all uinx software out-of-the-box, and a simple hello world program compiled with GCC (and MiNTLib if it would go dynamic) would be few KB, not half meg :)

AdamK