Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <199908271515.KAA20714@mercury.xraylith.wisc.edu> To: Paul Sokolovsky cc: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Re[6]: Importing a variable from a DLL In-Reply-To: Your message of "Fri, 27 Aug 1999 18:00:26 +0400." <4750 DOT 990827 AT is DOT lg DOT ua> Date: Fri, 27 Aug 1999 10:15:51 -0500 From: Mumit Khan Paul Sokolovsky writes: > > I also made mine, it requires changing only dlltool.c: (against > b20 distribution) > > *** dlltool.c.org Tue Oct 27 03:04:10 1998 > --- dlltool.c Thu Aug 26 22:31:32 1999 > *************** > *** 1144,1149 **** > --- 1144,1150 ---- > { > asymbol *sym; > const char *symbol_name; > + int data; > > sym = bfd_minisymbol_to_symbol (abfd, false, from, store); > if (sym == NULL) > *************** > *** 1153,1166 **** > if (bfd_get_symbol_leading_char (abfd) == symbol_name[0]) > ++symbol_name; > > ! def_exports (xstrdup (symbol_name) , 0, -1, 0, 0, 0); > > if (add_stdcall_alias && strchr (symbol_name, '@')) > { > char *exported_name = xstrdup (symbol_name); > char *atsym = strchr (exported_name, '@'); > *atsym = '\0'; > ! def_exports (exported_name, xstrdup (symbol_name), -1, 0, 0, 0); > } > } > } > --- 1154,1171 ---- > if (bfd_get_symbol_leading_char (abfd) == symbol_name[0]) > ++symbol_name; > > ! /* Don't use bfd_decode_symclass() - remember, symbols with constant > ! values dumped to code section */ > ! data = !(sym->flags&BSF_FUNCTION); > ! > ! def_exports (xstrdup (symbol_name) , 0, -1, 0, 0, data); > > if (add_stdcall_alias && strchr (symbol_name, '@')) > { > char *exported_name = xstrdup (symbol_name); > char *atsym = strchr (exported_name, '@'); > *atsym = '\0'; > ! def_exports (exported_name, xstrdup (symbol_name), -1, 0, 0, data); > } > } > } > Thanks. This is only a partial solution for --export-all case. The other one is handled by looking at .drectve section for symbols exported explicitly via dllexport attribute. See scan_drectve_symbols in dlltool.c. A small GCC change is necessary to support that one. btw, please use the -p option when creating diffs; it helps to see the function name in the patch. Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com