From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 23DFEBB81 for ; Fri, 11 Nov 2005 16:28:39 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jABFSc2c019278 for ; Fri, 11 Nov 2005 16:28:38 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA25029 for ; Fri, 11 Nov 2005 16:28:38 +0100 (MET) Received: from mx2.mail.ru (mx2.mail.ru [194.67.23.122]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jABFSbWR017036 for ; Fri, 11 Nov 2005 16:28:38 +0100 Received: from [64.74.207.33] (port=59240 helo=bely) by mx2.mail.ru with asmtp id 1EaapQ-000Jji-00 for caml-list@inria.fr; Fri, 11 Nov 2005 18:28:37 +0300 Received: from localhost (HELO BELY) [127.0.0.1] by bely (0.0.0.2) with ESMTP (Classic Hamster Vr. 2.0 Build 2.0.0.1) ; Fri, 11 Nov 2005 18:29:54 +0300 X-Comment-To: malc To: caml-list@inria.fr Subject: Re: [Caml-list] No unused code linking? References: From: Dmitry Bely Date: Fri, 11 Nov 2005 18:29:54 +0300 In-Reply-To: (malc@pulsesoft.com's message of "Wed, 9 Nov 2005 15:44:01 +0300 (MSK)") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (chayote, windows-nt) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Posting-Agent: Hamster/2.0.0.1 X-Miltered: at concorde with ID 4374B8A6.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4374B8A5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 malc:01 malc:01 pulsesoft:01 cmx:01 ocaml:01 ocaml:01 foo:01 mli:01 val:01 val:01 foo:01 source-level:01 mli:01 ...:98 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 malc writes: >> 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. >>> All in all this would require quite an effort in restructuring almost >>> everything. I wouldn't count on it. >> >> Probably you are right, but I still hope for a miracle :-) >> > Right rigth, that's exactly what's required As the Ocaml team people remain silent I am afraid your analysis is correct. OK, we cannot easily do the job during the code generation but maybe we can rearrange the source files? Say, if we have [foo.mli] val f1: ... val f2: ... [foo.ml] let f1 = ... let f2 = ... could we transform them (with some camlp4-based source-level tool) to [foo_f1.mli] val f1: ... [foo_f2.mli] val f2: ... [foo.mli] open Foo_f1 open Foo_f2 [foo_f1.ml] let f1 = ... [foo_f2.ml] let f2 = ... Isn't it equivalent to the initial version but can be linked separately? - Dmitry Bely