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 04C8CBB81 for ; Fri, 11 Nov 2005 14:42:08 +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 jABDg70p007269 for ; Fri, 11 Nov 2005 14:42:07 +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 OAA22538 for ; Fri, 11 Nov 2005 14:42:06 +0100 (MET) Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jABDg5vV008133 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 11 Nov 2005 14:42:06 +0100 Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by albireo.enyo.de with esmtp id 1EaZAK-0004Yu-EY; Fri, 11 Nov 2005 14:42:04 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.54) id 1EaZAF-00060O-0B; Fri, 11 Nov 2005 14:41:59 +0100 From: Florian Weimer To: malc Cc: Dmitry Bely , caml-list@inria.fr Subject: Re: [Caml-list] No unused code linking? References: Date: Fri, 11 Nov 2005 14:41:58 +0100 In-Reply-To: (malc@pulsesoft.com's message of "Wed, 9 Nov 2005 15:44:01 +0300 (MSK)") Message-ID: <87u0ej1eu1.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at concorde with ID 43749FAF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43749FAD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 cmx:01 ocaml:01 omitting:01 pointer:01 imho:01 functions:01 functions:01 data:02 florian:02 linking:03 module:03 generated:05 problem:05 reachable:05 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 >> 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).