1.5.0 - showstopper?

Charles Wilson cygwin@cwilson.fastmail.fm
Mon Jul 7 00:34:00 GMT 2003

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 

   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 

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.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: export-fix.changelog
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20030707/130d33fe/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: export-fix.patch
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20030707/130d33fe/attachment-0001.ksh>

More information about the Cygwin-developers mailing list