[SERVER-3992] Windows executables should not export symbols Created: 01/Oct/11 Updated: 11/Jul/16 Resolved: 01/Oct/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | 2.0.0 |
| Fix Version/s: | 2.1.0 |
| Type: | Bug | Priority: | Trivial - P5 |
| Reporter: | Tad Marshall | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | Windows | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows |
||
| Operating System: | Windows |
| Participants: |
| Description |
|
In Windows, Dynamic Link Libraries can contain an Export Address Table that enables the program loader component of Windows to find the addresses of routines that are "published" by the DLL. This enables a program (EXE) or one of its DLLs to call those routines. These "exports" are only useful in DLLs and should not be present in EXE files. Routines to be "exported" (listed in the Export Address Table) can be specified to the linker directly, or can be flagged in the source files by attaching the Microsoft-specific __declspec(dllexport) to a declaration. |
| Comments |
| Comment by Tad Marshall [ 01/Oct/11 ] |
|
Eliot's fix looks perfect on my machine. Zero exports from MongoDB's Windows EXE files. Built with 'scons all', tested with the same copy of Dependency Walker, I checked every EXE. Fixed. |
| Comment by auto [ 01/Oct/11 ] |
|
Author: {u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}Message: use PCRECPP_STATIC |
| Comment by Tad Marshall [ 01/Oct/11 ] |
|
Ugh. I misspelled PCRECPP_STATIC the first time I typed it in the bug report, reversing the second and third letters. |
| Comment by Tad Marshall [ 01/Oct/11 ] |
|
The last sentence in my bug report is a little off. The two listboxes in the upper right should be empty when the selection in the treeview on the left is on the EXE itself, but the pair of listboxes are not imports and exports. The top box lists symbols exported from the selected module that are being imported by the module above it in the tree. This box will always be empty when the treeview selection is the topmost element, regardless of whether it is an EXE or a DLL and regardless of what it is exporting. The lower box shows the list of symbols that are being exported, regardless of whether there is a module above it in the tree that is using them. So, an EXE should show both boxes empty when it is selected in the treeview and a DLL should (usually) show entries in the lower box when it is selected. I found this issue by running Dependency Walker to see what DLLs and functions MongoDB was using. |