Subject: Relocatable dll problems when generated by ld
From: [email-masked] (Jon Thackray)

10 Jul 1997 16:56:40 -0700
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
Original-Sender: [email-masked]

It appears that relocatable dlls as produced by ld aren't quite right,
at least in some cases. Here is what dumpbin had to say about one I
produced.

dumpbin /imports threads.dll
Microsoft (R) COFF Binary File Dumper Version 4.20.6164
Copyright (C) Microsoft Corp 1992-1996. All rights reserved.

Dump of file threads.dll

File Type: DLL

         Section contains the following Imports

            dylan.dll
                407   KPresolve_symbolYdylan_hygiene_glitchesVdylanI
                416   KPtrueYinternalVdylan
                419   KPunboundYinternalVdylan
                 FE   KLbooleanGYdylanVdylan
                 FF   KLbooleanGYdylanVdylanW
                191   KLclassGYdylanVdylan
                192   KLclassGYdylanVdylanW
               1374   Kunbound_instance_slotYdylan_extensionsVdylanI
               15BA   _Init_dylan_
               1684   _dylan_init_thread_local
                27A   KLmm_wrapperGYinternalVdylan
                27B   KLmm_wrapperGYinternalVdylanW
               1A29   primitive_call_first_dylan_iep
               1A33   primitive_fixup_imported_dylan_data
               1A4F   primitive_register_traced_data
               1A50   primitive_remove_optionals
                3B6   KPfalseYinternalVdylan

            KPunboundYinternalVdylan
                50AC time date stamp Thu Jan 01 05:44:12 1970
                50E0 index of first forwarder reference
               threads.dll : fatal error LNK1106: invalid file or disk full: cannot seek to 0x4c4abcfe

Here's what it ought to say

dumpbin /imports j:/releases\pentium-kan/install\x86-win32\bin\threads.dll
Microsoft (R) COFF Binary File Dumper Version 4.20.6164
Copyright (C) Microsoft Corp 1992-1996. All rights reserved.

Dump of file j:/releases\pentium-kan/install\x86-win32\bin\threads.dll

File Type: DLL

         Section contains the following Imports

            dylan.dll
                1C0   KLbooleanGYdylanVdylanW
                4D7   KPtrueYinternalVdylan
               1A35   primitive_remove_optionals
                 59   Init_dylan_
                1BF   KLbooleanGYdylanVdylan
                252   KLclassGYdylanVdylan
                33B   KLmm_wrapperGYinternalVdylan
                33C   KLmm_wrapperGYinternalVdylanW
                253   KLclassGYdylanVdylanW
                477   KPfalseYinternalVdylan
                4C8   KPresolve_symbolYdylan_hygiene_glitchesVdylanI
                4DA   KPunboundYinternalVdylan
               1435   Kunbound_instance_slotYdylan_extensionsVdylanI
               19F8   primitive_call_first_dylan_iep
               1A2D   primitive_register_traced_data
               1A08   primitive_fixup_imported_dylan_data
               179E   dylan_init_thread_local

     Summary

        1000 .dyfix
        1000 .dyvar
        1000 .idata
        1000 .rdata
        1000 .reloc
        1000 .text

Apart from the problem of some funny names, and a pointer going
outside the file, there is a problem with the names Init_dylan_ and
dylan_init_thread_local both of which have an extra _ as produced by
ld. Given that these names do not appear anywhere in the input to link
or ld without the spare _, I can only assume that ld is doing some
mangling of the COFF symbol names when producing its import and export
tables, and that ld is not emulating this behaviour.
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".