This is the mail archive of the cygwin-developers@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Exporting symbols from a .exe


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.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]