X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Thu, 10 Jul 2008 16:49:57 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: binutils: ld --export-dynamic Message-ID: <20080710204957.GC29418@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <486CE4BF DOT 9040409 AT users DOT sourceforge DOT net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <486CE4BF.9040409@users.sourceforge.net> User-Agent: Mutt/1.5.16 (2007-06-09) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Thu, Jul 03, 2008 at 09:39:59AM -0500, Yaakov (Cygwin Ports) wrote: > While you're waiting for the binutils list to get back to you, here's > another binutils issue. This is not a regression in 2.18, but rather a > longstanding difference in Cygwin behaviour versus Linux. > > When linking a program with -Wl,--export-dynamic, no symbols are > exported. The problem arises when the executable needs to either dlopen > itself, or when it has plugins which are "linked" against it. Both > scenarios are not uncommon, particularly with GNOME software. > > While this does work on Linux, it does not work on Cygwin with > - --export-dynamic; only --export-all-symbols, an i386PE-specific flag, > will accomplish this. > > I've attached a test case; it's a simplified version of the test used in > LT_SYS_DLOPEN_SELF (prev. AC_LIBTOOL_DLOPEN_SELF): > > $ gcc -o test.exe dlopen-self.c && ./test.exe > status = 0 > > $ gcc -Wl,--export-dynamic -o test.exe dlopen-self.c && ./test.exe > status = 0 > > $ gcc -Wl,--export-all-symbols -o test.exe dlopen-self.c && ./test.exe > status = 1 > > Running 'objdump -p test.exe' will also show that the export table is > only generated in the last case. > > I would appreciate your input on this issue. It's probably best to report general binutils problems like this to the binutils mailing list. Someone like Danny Smith may know how to fix this quickly. You could also create a bugzilla entry for this since it seems like a bug. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/