English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
No unused code linking?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-11 (13:42)
From: Florian Weimer <fw@d...>
Subject: Re: [Caml-list] No unused code linking?
>> IMHO, each header item can be placed into the separate DATA section, so
>> it's not the real problem (the frame table is).
>
> No it can not. The moduler header must be contiguous and not rearranged by
> linker. In absence of .cmx (and name -> mangled name table) OCaml uses the
> header to call functions by position. Thus, as it is now, no part of
> header can be eliminated, which in reality means that almost everything,
> from linkers perspective, is reachable and can not be removed by 
> --gc-functions.

The module header oculd be generated by the linker, omitting
references to unused functions (filling the place with a null pointer
or something like that).