Non-relocatable DLLs and GCC -shared

Danny Smith danny_r_smith_2001@yahoo.co.nz
Mon Jul 21 22:02:00 GMT 2003


 --- Pascal Obry <p.obry@wanadoo.fr> wrote: > 
> Danny,

Thanks for your correction

> 
> 
> To build a non-relocatable DLL, the procedure was to build an .exp file,
> doing this will build a non-relocatable DLL:
> 
> $ dlltool --def code1.def --dllname dll1-nr.dll --output-lib libdll1.a --output-exp dll1.exp
> $ dlltool --def code2.def --dllname dll2-nr.dll --output-lib libdll2.a --output-exp dll2.exp
> $ gcc -mdll -o dll1-nr.dll dll1.exp code1.c
> $ gcc -mdll -o dll2-nr.dll dll2.exp code2.c
> $ gcc -o main-nr main.c libdll1.a libdll2.a
> $ ./main-nr
> 
> But since dlltool is called "obsolete", what should be used instead ?


If that works, use it.  I don't know why people keep saying that dlltool is obsolete
or deprecated.  It does things that ld --shared cannot do.  Building the mingw runtime
and w32api import libs  depend on it.

There was a discussuion on the cygwin lists some time ago about adding --non-relocatable switch
to ld, simply by stripping the .reloc section.
http://www.cygwin.com/ml/cygwin-apps/2001-07/msg00041.html
Maybe that could be re-visited. In any event, discussion should probably on binutils list.

Danny
> 
> Thanks,
> Pascal.
> 
> -- 
> 
> --|------------------------------------------------------
> --| Pascal Obry                           Team-Ada Member
> --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
> --|------------------------------------------------------
> --|         http://perso.wanadoo.fr/pascal.obry
> --| "The best way to travel is by means of imagination"
> --|
> --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
>  

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.



More information about the Gcc-help mailing list