ld and export lists
Tue Jan 14 10:16:00 GMT 2003
Thanks. One more question this also works fi .sl right? I know WIN32 has
a completely different concept for shared libraries then Unix.
Nick Clifton wrote:
>>How does one define an export list for a shared library using
>By using a DEF file.
>Have a look at the information in the ld.texinfo file for more details
>about this. (You should get a copy of the latest version from the CVS
>repository, since this section has seen a lot of work in the last few
>months). In particular in the WIN32 section of the Machine Dependent
>Features section it says this:
> _exporting DLL symbols_
> The cygwin/mingw `ld' has several ways to export symbols for dll's.
> _using auto-export functionality_
> By default `ld' exports symbols with the auto-export
> functionality, which is controlled by the following command
> line options:
> --export-all-symbols [This is the default]
> _using a DEF file_
> Another way of exporting symbols is using a DEF file. A DEF
> file is an ASCII file containing definitions of symbols which
> should be exported when a dll is created. Usually it is
> named `<dll name>.def' and is added as any other object file
> to the linker's command line.
> gcc -o <output> <objectfiles> <dll name>.def
> Here is an example of a DEF file for a shared library called
> LIBRARY "xyz.dll" BASE=0x10000000
> _bar = bar
> This example defines a base address and three symbols. The
> third symbol is an alias for the second. For the complete
> format specification see ld/deffilep.y in the binutils
> While linking a shared dll, `ld' is able to create a DEF file
> with the `--output-def <file>' command line option.
Robert Schweikert MAY THE SOURCE BE WITH YOU
More information about the Binutils