Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com Date: Thu, 15 Feb 2001 09:23:58 -0500 From: Jason Tishler To: cygwin-developers AT cygwin DOT com Subject: Re: Exporting symbols from a .exe Message-ID: <20010215092358.W436@dothill.com> Mail-Followup-To: cygwin-developers AT cygwin DOT com References: <20010215013211 DOT A2451 AT redhat DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010215013211.A2451@redhat.com>; from cgf@redhat.com on Thu, Feb 15, 2001 at 01:32:11AM -0500 Organization: Dot Hill Systems Corp. Chris, On Thu, Feb 15, 2001 at 01:32:11AM -0500, Christopher Faylor wrote: > I know that in a past life I was able to export symbols from a normal > executable without too much work. > > ... > > The above produces an executable file with an exported "foo" function > when linked with Visual C. foo() never seems to be exported when linked > with the current binutils, though. > > So, this is a bug, right? I could really use this functionality for an > performance improvement idea that I have for Cygwin. The PostgreSQL folks seems to have figured out how to do this with postgres.exe using the current binutils. For example: $ objdump -p postgres.exe ... There is an export table in .edata at 0x573000 ... Export Address Table -- Ordinal Base 1 [ 0] +base[ 1] 10bb70 Export RVA [ 1] +base[ 2] cb1b8 Export RVA [ 2] +base[ 3] 1dc8c Export RVA ... [Ordinal/Name Pointer] Table [2855] AMI_OVERRIDE [ 1] AbortBufferIO [ 2] AbortCurrentTransaction ... The following is a snippet from a PostgreSQL make: dlltool --export-all --output-def postgres.def access/SUBSYS.o ... dlltool --dllname postgres.exe --def postgres.def --output-lib libpostgres.a dlltool --dllname postgres.exe --output-exp postgres.exp --def postgres.def gcc -g -o postgres.exe -Wl,--base-file,postgres.base postgres.exp access/SUBSYS.o ... dlltool --dllname postgres.exe --base-file postgres.base --output-exp postgres.exp --def postgres.def gcc -g -o postgres.exe postgres.exp access/SUBSYS.o ... rm postgres.exp postgres.base Although, the above seems to be somewhat convoluted, hopefully you can use the same sequence to accomplish whatever you are trying to do. Jason -- Jason Tishler Director, Software Engineering Phone: +1 (732) 264-8770 x235 Dot Hill Systems Corp. Fax: +1 (732) 264-8798 82 Bethany Road, Suite 7 Email: Jason DOT Tishler AT dothill DOT com Hazlet, NJ 07730 USA WWW: http://www.dothill.com