This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: 1.5.0 - showstopper?
Okay, after a little bit of study, I'm starting to understand.
Currently, binutils pe-dll.c does NOT exclude symbols imported from
libcygwin. Presumably this decision was made because "it's just an
import library with a FEW static things, and (1) 'import' symbols
__imp__* are automatically excluded, and (2) we explicitly exclude those
few static symbols."
Except that (2) isn't really true. Perhaps it was at one time, but each
time we obsolete a symbol and replace it with a new symbols using the
OBSOLETE_FUNCTIONS / NEW_FUNCTIONS mechanisms, we add another static
symbol to libcygwin.a that does NOT have a corresponding import symbol
(__imp__). And these new "static"-ish symbols are NOT listed
individually in pe-dll's autofilter_symbollist[].
Until recently, this was not a big deal; there were only four such
symbols and the ONLY external DLLs these could've impacted were the pcre
libraries.
regcomp posix_regcomp
regerror posix_regerror
regexec posix_regexec
- regfree posix_regfree
Plus, these particular symbols are much less frequently used than, say,
fopen. :-)
So, we never really noticed before. But now we do -- what with fopen,
seek, geteuid, etc...
The following patch to binutils fixes the problem -- we add libcygwin to
the list-of-libs from which to NOT export symbols, when we otherwise
would export them (e.g. under --export-all-symbols). Note that this
does not interfere with exporting symbols when you're using a def file,
so building cygwin itself should not be impacted by this change.
If this patch is OK with cgf, I'll submit it separately to the binutils
list.
I've built binutils from latest CVS with this patch, and used it to
build (working) versions of both cygz and cygpopt0 -- and the DLLs do
not export any symbols they shouldn't. And test executables linked
against these DLLs work properly, according to make check.
--
Chuck
2003-07-06 Charles Wilson <cwilson@ece.gatech.edu>
* ld/pe-dll.c: Add libcygwin to autofilter_liblist[]
Index: ld/pe-dll.c
===================================================================
RCS file: /cvs/src/src/ld/pe-dll.c,v
retrieving revision 1.59
diff -u -r1.59 pe-dll.c
--- ld/pe-dll.c 28 Jun 2003 05:28:54 -0000 1.59
+++ ld/pe-dll.c 7 Jul 2003 00:11:23 -0000
@@ -231,6 +231,7 @@
/* Do not specify library suffix explicitly, to allow for dllized versions. */
static autofilter_entry_type autofilter_liblist[] =
{
+ { "libcygwin", 9 },
{ "libgcc", 6 },
{ "libstdc++", 9 },
{ "libmingw32", 10 },