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

See the CrossGCC FAQ for lots more information.


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

problem create shared dll and -shared option


hello all:

I had built a cross compiler host=mingw32, target=arm-pe and now i have
a problem of create shared
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
2.
test.c
------------------------
int _DllMainCRTStartup(int pPcb, int op, void* arg3) {return 1;}

void TestFunc() {return;}
------------------------
building
gcc -O0 -c -fno-exceptions -fno-rtti -fms-extensions -w
-falign-functions=4 -mcpu=arm7dmi -march=armv4  test.c

3.	using ld to create dll
ld   --dll --subsystem console  --entry __DllMainCRTStartup   -Map
test.map --image-base 0x10000000 -o test.dll  test.exp test.o

But this dll doesn'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		// no relocations information
        executable
        line numbers stripped
        debugging information removed
        DLL
[snip]

I could do the same job with mingw32 gcc for win32, just two
differences:
a) at step 1,omit the leading underscore for TestFunc in def file;
b) at step 3, add -shared option for ld.exe
and this dll has relocation information.
Document said that -shared option of ld is" Create a shared library.
This is currently only supported on ELF, XCOFF and SunOS platforms...."
, i am not sure whether it support arm-pe configuration.
when give -shared option to my arm-pe gcc, ld reports:
Cannot export TestFunc: symbol not found
Cannot export _DllMainCRTStartup: symbol not found

Any ideas about this situation?
TIA
wreckor


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe at sources dot redhat dot com


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