This is the mail archive of the cygwin@sources.redhat.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]

Some question about DLL names/export names


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@sourceware.cygnus.com


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