This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


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

Re[6]: Importing a variable from a DLL


Hello Mumit,

Mumit Khan <khan@xraylith.wisc.EDU> wrote:


MK> I'm currently adding changes to GCC so that exported data items have
MK> the correct "data" tag in the .drectve section. This will enable us
MK> to handle this in dlltool and dllwrap when the import libraries are
MK> created. I'll hopefully test the gcc and dlltool changes this weekend
MK> (it's pretty trivial).

    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);
        }
      }
  }

MK> Now the import library will have what Paul suggests.

MK> Regards,
MK> Mumit


Best regards,
 Paul                            mailto:paul-ml@is.lg.ua



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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