bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug: LD generates a non syntax valid definition file


From: Jesus Carretero
Subject: Bug: LD generates a non syntax valid definition file
Date: Tue, 5 Feb 2008 10:43:22 +0100

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.

Attachment: ld_bug.zip
Description: Zip archive


reply via email to

[Prev in Thread] Current Thread [Next in Thread]