This is the mail archive of the 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]
Other format: [Raw text]

[PATCH]: Remove unnecessary data entries from .dllname_infosections


I've been looking at the contents of the cygwin1.dll image in the last
few days and I've noticed that the sections named .dllname_info contain
a lot of duplicate entries - one for each autoloaded function from a given
dll. Although it doesn't hurt to have it, this information is not really
neccassary for the autoload functionality - autoload only needs one entry
per dll in .dllname_info. Another point to consider here is that for dlls
that use an auxillary initialization routine (ws2_32 and wsock32)
currently you have one entry (the one that is used) with the address
of the right auxillary initialization routine  and many entries with the
default auxillary initialization routine . This is due to the following

LoadDLLprime (wsock32, _wsock_init)


LoadDLLfunc (WSAAsyncSelect, 16, wsock32)

Of course this could be corrected by extending the LoadDLLfunc* macros to
support passing of an auxillary routine or it could be simply ignored
since it doesn't harm :)

Since the current scheme works ok I don't have much arguments for my
patch. IMHO, first it does the right thing  and  second it saves some
memory. I cannot know the thoughts of the original implementor of but maybe it intended to fix this duplication with the
.linkonce directive of gas or maybe he was willing to pay the prize of
the duplicate entries. However from what I understand .linkonce works only
for sections defined in different object files.

I am including the output of `objdump -h new-cygwin1.dll' with original
and patched


new-cygwin1.dll:     file format pei-i386

Idx Name          Size      VMA       LMA       File off  Algn
  2 .ws2_32_info  00000144  610d1000  610d1000  000cf600  2**2

  3 .wsock32_info 00000378  610d2000  610d2000  000cf800  2**2

  4 .advapi32_info 000006c0  610d3000  610d3000  000cfc00  2**2

  6 .netapi32_info 000000b0  610d5000  610d5000  000d1000  2**2

  8 .ntdll_info   00000160  610d7000  610d7000  000d1400  2**2

 10 .psapi_info   00000070  610d9000  610d9000  000d1a00  2**2

 12 .secur32_info 00000078  610db000  610db000  000d1e00  2**2

 14 .user32_info  00000310  610dd000  610dd000  000d2200  2**2

 18 .iphlpapi_info 00000064  610e1000  610e1000  000d3400  2**2

 20 .ole32_info   00000018  610e3000  610e3000  000d3800  2**2

 22 .kernel32_info 000001f4  610e5000  610e5000  000d3c00  2**2

 24 .shell32_info 00000018  610e7000  610e7000  000d4200  2**2

 26 .winmm_info   000001d0  610e9000  610e9000  000d4600  2**2

 28 .rpcrt4_info  00000030  610eb000  610eb000  000d4c00  2**2


new-cygwin1.dll:     file format pei-i386

Idx Name          Size      VMA       LMA       File off  Algn
  2 .ws2_32_info  00000018  610d1000  610d1000  000cf600  2**2

  3 .wsock32_info 00000018  610d2000  610d2000  000cf800  2**2

  4 .advapi32_info 0000001c  610d3000  610d3000  000cfa00  2**2

  5 .netapi32_info 0000001c  610d4000  610d4000  000cfc00  2**2

  6 .ntdll_info   00000018  610d5000  610d5000  000cfe00  2**2

  7 .psapi_info   00000018  610d6000  610d6000  000d0000  2**2

  8 .secur32_info 00000018  610d7000  610d7000  000d0200  2**2

  9 .user32_info  00000018  610d8000  610d8000  000d0400  2**2

 10 .iphlpapi_info 0000001c  610d9000  610d9000  000d0600  2**2

 11 .ole32_info   00000018  610da000  610da000  000d0800  2**2

 12 .kernel32_info 0000001c  610db000  610db000  000d0a00  2**2

 13 .shell32_info 00000018  610dc000  610dc000  000d0c00  2**2

 14 .winmm_info   00000018  610dd000  610dd000  000d0e00  2**2

 15 .rpcrt4_info  00000018  610de000  610de000  000d1000  2**2

Description: Text document

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