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

Re: [MiNT] Shareable/loadable libraries: a preliminary document



On Fri, 2004-10-29 at 22:16 +0200, Philipp Donzé wrote:
> Hi,
> 
> Nice work!
> It still needs some "clean up" from a native english speaking person, 
> as there are some parts which aren't very clearly formulated. For 
> example the paragraphe starting with: "The only advantage of static 
> linking is ...".
> I think there are some people here who can do this job...
> 

I will do this...  But not until Sunday.

> I don't know much about dynamic linking and how it's done on other 
> systems, nevertheless here are my remarks:
> 
> What about dependencies? Is it allowed to have a dynamic library to be 
> dependent on other dynamic libraries?
> If yes, I think we need also a well defined library format containing 
> this information.
> 

This is quite allowed.  On linux for instance, there is a huge depedency
train that always goes back to libc.  For instance a software might link
to glib2 which in turn links to a bunch of other libs which link back to
libc dynamically, but also glib2 itself links back to glibc.  The linux
ldd util helps track these deps.  You can run ldd "binname" and it will
tell which .so libs the binary needs.  Then you can run ldd on one of
those libraries to see which libraries it needs, etc.

> Dynamic libraries have to be position independent. (i.e. can't have 
> their own "relocation table".)
> 

Does gcc on our platform offer -fPIC?  I thought I tried it before and
it failed.

> DATA and BSS segment of the library have to be directly after the TEXT 
> segment, and the linker has to align the BSS and DATA segment onto a 
> multiple of the MMU page size. The compiler also needs to know the page 
> size to generate proper access to DATA and BSS segment. (Perhaps GCC 
> does this already?)

Gcc itself likely can do everything we need since it does it on x86
platforms.  But it could be a matter of enabling those features at
compile time or porting for mint properly.

Thanks,
-- 
Mark Duckworth <mduckworth@atari-source.com>
Atari-source.com