Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com X-Envelope-Sender-Is: Andrej DOT Borsenkow AT mow DOT siemens DOT ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: Subject: Some question about DLL names/export names Date: Mon, 14 Aug 2000 17:44:17 +0400 Message-ID: <000b01c005f5$bdff5e90$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 When DLL is created, there is a parameter --dllname thet is recorded into DLL. I first thought was, that this name is used for import lists as well, but it looks, like in this case compiler is still using DLL _file_ name with all leading directories stripped. My problem is as following: assuming I have dir1/foo.dll, dir1/bar.dll and dir2/foo.dll. I also have a a.exe that loads DLLs using dlopen()/dlsym(). dir1/bar.dll depends on dir1/foo.dll (that is, it is directly using functions and/or variables from dir1/foo.dll) and is built with it. More precisely: dllwrap --dllname dir1_foo -o $dest/dir1/foo.dll $src/dir1/foo.o dllwrap --dllname dir1_bar -o $dest/dir1/bar.dll $src/dir1/bar.o $dest/dir1/foo.dll dllwrap --dllname dir2_foo -o $dest/dir2/foo.dll $src/dir2/foo.o My problem is, can it happen that - a.exe first loads dir2/foo.dll - then it loads dir1/bar.dll - bar.dll tries to resolve reference to objects from foo.dll (note, that in import list there is no reference to --dllname or full path), finds already loaded instance of WRONG foo.dll and either gives an error or resolves wrong symbol. May be, I have to use different compiler options? To clarify what I mean: objdump dir/foo1.dll: ... There is an export table in .edata at 0x6a4c4000 The Export Tables (interpreted .edata section contents) Export Flags 0 Time/Date stamp 3997eee8 Major/Minor 0/0 Name 00004028 dir/foo1.dll ... This is the name I specified with --dllname option objdump dir/foo2.dll ... DLL Name: foo1.dll vma: Hint/Ord Member-Name 5158 0 foo1 5160 1 foo1_print_foo1 The Import Address Table is identical ... note, that name used in import table is just foo1.dll; the same if I give `--dllname foobar' option. -andrej Have a nice DOS! B >> -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com