zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "maurice s. barnum" <pixi@burble.org>,
	"Peter Stephenson" <pws@cambridgesiliconradio.com>
Cc: "Zsh hackers list" <zsh-workers@sunsite.auc.dk>
Subject: RE: Getting dynamic loading to work on cygwin
Date: Thu, 6 Jul 2000 14:15:28 +0400	[thread overview]
Message-ID: <000701bfe733$1bdc6440$21c9ca95@mow.siemens.ru> (raw)
In-Reply-To: <m2r9agun9c.fsf@bloodbath.burble.org>


> :
> : Yuk, it looks like your right.  Using dlsym to get the
> symbol works OK, but
> : simply linking against the DLL and loading it doesn't seem
> to pick up the
> : right value.  That will screw up a lot of things.
>
> Data references can be imported on Win32, but you need help from the
> compiler to generate an extra indirection on access to the
> imported data.
> This of course implies that the compiler needs to know what data is
> being imported, which with normal Win32 compilers is indicated by
> decorating the extern declaration with '__import' or
> '__declspec(dllimport)'.
> I don't have cygwin or it's documentation handy, so I don't know if
> gcc supports this or some alternate spelling.
>

Cygwin supports __declspec(dllimport/export) but it different matter.
The following case works (foo.dll is assumed to access variable in
bar.dll)

build bar.dll that defines and exports variable
build foo.dll with bar stub library bar.a that directly references this
variable (extern ...)

the following case does not work

build bar.dll that defines and exports variable
build foo.dll that loads bar.dll with dlopen() and lokos up variable
with dlsym().

Variable is found but seems to point to the wrong location.

I did define variable with __declspec(dllexport) but it did not help.

-andrej


  parent reply	other threads:[~2000-07-06 10:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-02 11:03 Peter Stephenson
2000-06-02 13:43 ` Peter Stephenson
2000-06-02 14:19   ` Andrej Borsenkow
2000-06-02 15:00     ` Peter Stephenson
2000-06-02 15:16       ` maurice s. barnum
2000-06-02 16:17         ` Peter Stephenson
2000-07-06 10:15         ` Andrej Borsenkow [this message]
2000-07-06 11:07           ` Peter Stephenson
2000-06-02 14:11 ` Use and abuse of dynamic loading " Andrej Borsenkow
2000-06-02 14:24   ` Peter Stephenson
2000-06-02 14:52     ` Use and abuse of dynamic loading RE: Getting dynamic loading towork " Andrej Borsenkow
2000-06-06 21:52       ` Fletch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000701bfe733$1bdc6440$21c9ca95@mow.siemens.ru' \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=pixi@burble.org \
    --cc=pws@cambridgesiliconradio.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).