From: SourceForge.net <no...@so...> - 2008-06-16 03:08:12
|
Bugs item #1901008, was opened at 2008-02-25 09:49 Message generated for change (Comment added) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1901008&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: binutils Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: jkarretero (jkarretero_) >Assigned to: Danny Smith (dannysmith) Summary: LD generates a non syntax valid definition file Initial Comment: Option --output-def of LD generates a non syntax valid definition file. Using: Windows XP SP2 mingw-runtime-3.14 binutils-2.18.50-20080109 gcc-core-3.4.5-20060117-1 w32api-3.11 Steps to reproduce the bug: We want to generate a dll with functions in function.c, and export its definition file. 1. Compile function.c. This function uses WlanReasonCodeToString in wlanapi.dll. gcc -c -Wall function.c -o function.o 2. Generate the dll and its definition file (if you don't have wlanapi.dll, you can use one of the wlanapi folder) ld -L./ -shared -o library.dll --output-def bad_syntax.def function.o -lwlanapi The generated DEF file may be used as a reference to automatically or implicitly exported symbols. In step 3 we are going to use the DEF file in this mentioned way. So we could check its syntax. 3. Create the dll using DEF file to indicate what symbols will be exported. ld -L./ -shared -o library.dll bad_syntax.def function.o -lwlanapi Ld gives the following error in step 3: ld: bad_syntax.def:2: syntax error ld:bad_syntax.def: file format not recognized; treating as linker script ld:bad_syntax.def:2: syntax error As we can see, --output-def of LD has generated a non syntax valid definition file. ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2008-06-16 15:08 Message: Logged In: YES user_id=11494 Originator: NO Hi, I see the problem. GNU ld does not treat the ILF (short format) MS import lib wlanapi.lib as an archive, as it does for the long format import libs that mingw and cygwin use. If you create an import lib for wlanapi.dll using dlltool, and use that implib, it will create a good def file and dll. I will investigate further. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1901008&group_id=2435 |