From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24797 invoked by alias); 11 Oct 2002 19:14:03 -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 24719 invoked from network); 11 Oct 2002 19:14:01 -0000 Received: from unknown (HELO pd4mo1so.prod.shaw.ca) (24.71.223.10) by sources.redhat.com with SMTP; 11 Oct 2002 19:14:01 -0000 Received: from pd5mr3so.prod.shaw.ca (pd5mr3so-qfe3.prod.shaw.ca [10.0.141.144]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0H3U0028P02MUW@l-daemon> for gcc-help@gcc.gnu.org; Fri, 11 Oct 2002 13:13:34 -0600 (MDT) Received: from pn2ml9so.prod.shaw.ca (pn2ml9so-qfe0.prod.shaw.ca [10.0.121.7]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0H3U00JJT02MOL@l-daemon> for gcc-help@gcc.gnu.org; Fri, 11 Oct 2002 13:13:34 -0600 (MDT) Received: from [192.168.1.100] ([24.65.24.209]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0H3U00CL402LAZ@l-daemon> for gcc-help@gcc.gnu.org; Fri, 11 Oct 2002 13:13:34 -0600 (MDT) Date: Fri, 11 Oct 2002 12:14:00 -0000 From: Barry Leslie Subject: Limiting the exported symols in a shared library To: gcc-help@gcc.gnu.org Message-id: MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 X-SW-Source: 2002-10/txt/msg00127.txt.bz2 Hi, I want to create a shared lib and limit the symbols exported from it to the functions specified in an api list. I don't want all the global symbols to be visible. On many platforms this is done simply by listing the symbols in a file and then passing the file name in as a command line argument. For example on AIX you use -bE:api.exports and on Sun you use -M api.exports. What is the equivalent for the linker on Linux? I tried --retain-symbols-file api.exports but all the global variables and functions were still visible when I did a 'nm -g mylib.so'. Can anybody help me out here? Thanks, Barry