delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/07/10/16:50:23

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 <cgf-use-the-mailinglist-please AT cygwin DOT com>
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
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
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019