From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10317 invoked by alias); 9 Sep 2004 18:51:39 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 10309 invoked from network); 9 Sep 2004 18:51:39 -0000 Received: from unknown (HELO uni.thekramers.net) (66.92.68.235) by sourceware.org with SMTP; 9 Sep 2004 18:51:39 -0000 Received: by uni.thekramers.net (Postfix, from userid 500) id B7E071C181; Thu, 9 Sep 2004 14:51:37 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by uni.thekramers.net (Postfix) with ESMTP id B785C1CB1C6 for ; Thu, 9 Sep 2004 14:51:37 -0400 (EDT) Date: Thu, 09 Sep 2004 18:51:00 -0000 From: David Kramer To: gcc-help@gcc.gnu.org Subject: GNU g++ / AIX ld question Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-09/txt/msg00073.txt.bz2 I have a two-fold problem at work, where I am trying to move the company's AIX 5.2 xlC-compiled C++ application to gcc (note that I just can't get binutils to work right, so I'm using the native linker). 1) The table of contents is > 64K, and according to their respective documentations, all options that either make the TOC bigger in ld, or put less in the TOC in gcc, make the program run slower. This is not desirable, but not a show-stopper. 2) A library of ours (tccommon) that we are linking in has classes that reference another class (status) in another library (tcdb). The application I am trying to link requires some classes from tccommon, but not any of the ones that require the status class. However, the linker is complaining that the status class is missing (undefine symbols) anyway. I thought they would have been garbage collected out. The xlC compiler has an option, "-qfuncsect", which puts each function in a separate csect. This seems equivalent to g++'s "-ffunction-sections". The kicker is that xlC has an option "-qtwolink" to do a two-pass link to eliminate any sections containing only unreferenced objects. That killed both birds with two stones. I can't seem to find a comparable g++ option to not link in objects that are not referenced, and that means when I link my application against tccommon, it's claiming that the status class methods are undefined, even though nothing the application is using from tccommon uses the status class. Thanks in advance. -- DDDD David Kramer david@thekramers.net http://thekramers.net DK KD DKK D Should you trust a stockbroker who's married to a travel agent? DK KD DDDD