From: <dan...@ya...> - 2000-12-29 22:36:37
|
Hello Paul Happy New Year --- Paul Sokolovsky <pf...@us...> wrote: > Hello Danny, > > Danny Smith wrote on Wednesday, December 06, 2000: > > > [] > DS> Here is a C example of what I mean, using libiberty.a: > > DS> /* cdll.c */ > DS> #include <libiberty.h> > DS> #include <stdio.h> > DS> void my_pwd(){ > DS> char* dll_pwd=getpwd(); > DS> printf("pwd from dll: %s \n", dll_pwd); > DS> return; > DS> } > > DS> /* test.c */ > DS> #include <libiberty.h> > DS> void my_pwd(); > > DS> int main(){ > DS> char* liberty_pwd=getpwd(); > DS> my_pwd(); > DS> return 1; > DS> } > > DS> Using this script > > DS> cc -c cdll.c > DS> gcc -shared -Wl,--out-implib,libmycdll.a,--output-def,mycdll.def > \ > DS> -o mycdll.dll cdll.o -liberty > DS> gcc -c main.c > DS> rem This works > DS> gcc -o test1.exe main.o -L. -lmycdll -liberty > DS> test1 > DS> rem This doesn't, even though getpwd is exported from dll > DS> rem The auto-import warning tells us why > DS> gcc -o test2.exe main.o -L. -lmycdll > DS> test2 > > DS> The ouput-def looks like this: > DS> EXPORTS > DS> _xexit_cleanup @1 DATA > DS> getpwd @2 DATA > DS> my_pwd @3 > DS> xcalloc @4 > DS> xexit @5 DATA > DS> xmalloc @6 DATA > DS> xmalloc_set_program_name @7 > DS> xrealloc @8 > > [] > > I cannot reproduce this problem with all the latest binutils. I > have > > EXPORTS > _xexit_cleanup @1 DATA > getpwd @2 > my_pwd @3 > xcalloc @4 > xexit @5 > xmalloc @6 > xmalloc_failed @7 > xmalloc_set_program_name @8 > xrealloc @9 > > and both cases build successfully. Btw, there's no getpwd() in the > libiberty as distributed with Mumit's gcc, so I'll replace it with > latest from binutils. > > If you'll answer, please cc: to me, I seem to have mail routing > probs with pf...@us..., from which I subscribed. > > For above example I am using binutils-20001103, ld-20001204, libbfd-20001204 from your distros and static libiberty from binutils-20001212 (my build). I still cannot get "lastest" ld-20001217 from your distro to work (access violation in libbfd-2.10.91.dll). The diff file for ld-20001217 is identical to diff file for ld-20001204 and no debugging info in binary so haven't been able to find source of access violation. The "latest" binutils-20001225.zip at SourceForge is an empty file. Can you suggest anything to help me track down my problem. Cheers Danny _____________________________________________________________________________ http://au.classifieds.yahoo.com/au/car/ - Yahoo! Cars - Buy, sell or finance a car.. |