This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: binutils: ld --export-dynamic


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]