From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23851 invoked by alias); 10 Jul 2006 06:50:39 -0000 Received: (qmail 23842 invoked by uid 22791); 10 Jul 2006 06:50:38 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.191) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 10 Jul 2006 06:50:36 +0000 Received: by nf-out-0910.google.com with SMTP id g2so416581nfe for ; Sun, 09 Jul 2006 23:50:33 -0700 (PDT) Received: by 10.78.177.11 with SMTP id z11mr1539381hue; Sun, 09 Jul 2006 23:50:33 -0700 (PDT) Received: by 10.78.154.7 with HTTP; Sun, 9 Jul 2006 23:50:33 -0700 (PDT) Message-ID: <4d77c5f20607092350j26ab6056t9c9a3b40fdb5493@mail.gmail.com> Date: Mon, 10 Jul 2006 06:50:00 -0000 From: "Tzu-Chien Chiu" To: binutils@sourceware.org Subject: LD: function-level linking MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00112.txt.bz2 Hello all. I'm looking for a similar feature available in Visual C++. Function-level linking. In Visual C++, there is an option "/Gy" which enables "function-level linking". That is, each function is packaged separately as a COMDAT, and later the linker option "/OPT:REF" eliminates the COMDATs which are never referenced. FYI: http://msdn2.microsoft.com/en-us/library/bxwfs976.aspx In this way, the entire object file won't have to be linked as a whole when only one of the functions in it is referenced. It's preferred linking for embedded system software. Not all libraries are design ed as glibc, which has a separate file for each file, and it's sometimes not easy or feasible to modify the source code of the libraries. I can not find similar compiler and linker options in the GNU tool chain. What I missed? -- Tzu-Chien Chiu - SMedia Technology Corp. URL: http://www.csie.nctu.edu.tw/~jwchiu/