This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: dll create problem with gcc configured with arm-pe


I add a leading underscore to def file i.e from TestFunc to _TestFunc in
test.def
and in ld option, i omit -shared option, this time i could get the dll
file but i don't think this one is what i expected.
This dll don't have relocation table.

objdump -x test.dll

test.dll:     file format pei-arm-little
test.dll
architecture: armv4, flags 0x00000132:
EXEC_P, HAS_SYMS, HAS_LOCALS, D_PAGED
start address 0x10001000

Characteristics 0x6607
        relocations stripped
        executable
        line numbers stripped
        debugging information removed
        DLL
[snip]
I look up information for -shared and it said that:
-shared 
-Bshareable
	Create a shared library. This is currently only supported on
ELF, XCOFF and SunOS platforms....

any ideas?

> -----Original Message-----
> From: longchuan [mailto:longchuan at koretide dot com dot cn] 
> Sent: Wednesday, March 26, 2003 12:59
> To: 'binutils at sources dot redhat dot com'
> 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.sr
c.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
> 


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