This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
dll create problem with gcc configured with arm-pe
- From: "longchuan" <longchuan at koretide dot com dot cn>
- To: <binutils at sources dot redhat dot com>
- Date: Wed, 26 Mar 2003 12:59:23 +0800
- Subject: dll create problem with gcc configured with arm-pe
hello all:
I had built a cross compiler host=mingw32, target=arm-pe and now i have
a problem of create
dll.(binutils-2.13-20020903-1-src.tar.gz,gcc-3.2-20020817-1.src.tar.gz
from mingw)
1.
test.def
------------------------
LIBRARY test.dll
EXPORTS
TestFunc
----------------------------
building
dlltool -d test.def -e test.exp -C -D test.dll -l test.lib -f
-mcpu=arm7dmi -f -march=armv4
then test.c
2.
test.c
------------------------
int _DllMainCRTStartup(int pPcb, int op, void* arg3)
{
return 1;
}
//asm (".section .drectve");
//asm (".ascii \"-export:TestFunc\"");
__declspec(dllexport) void TestFunc()
{
return;
}
------------------------
building
gcc -O0 -c -fno-exceptions -fno-rtti -fms-extensions -w
-falign-functions=4 -mcpu=arm7dmi -march=armv4
-D_sm_arm -D_gnu_arm -D_GNUC -D_arm -D_DEBUG test.c
3. then using ld to create dll
ld --dll --subsystem console --entry __DllMainCRTStartup -Map
test.map --image-base 0x10000000 --shared -o test.dll test.exp test.o
ld failed with message:
Cannot export TestFunc: symbol not defined
test.exp(.edata+0x40): undefined reference to `TestFunc'
nm test.exp
00000000 b .bss
00000000 d .data
00000000 e .edata
00000000 t .text
00000040 e afuncs
00000044 e anames
00000048 e anords
0000004a e n1
00000028 e name
U TestFunc
i notice that TestFunc symbols without a leading underscore then using
-U option for dlltool, but get the same.
I could built this dll with mingw gcc 3.2 with the same commands( just
different machine and architecture), and the test.exp generated by
mingw32 gcc dlltool do have a symbols name _TestFunc, i think that is
the main difference.
Is something wrong with dlltool for arm-pe target?
TIA
wreckor