libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Libtool stresstest.at segfault on Cygwin/MinGW


From: Peter Ekberg
Subject: RE: Libtool stresstest.at segfault on Cygwin/MinGW
Date: Mon, 19 Sep 2005 12:11:23 +0200

* Peter Ekberg wrote on Friday, September 16, 2005 11:11 CEST:
> * Peter Ekberg wrote on Thursday, September 15, 2005 15:15 CEST:

It's me again...

> > * Peter Ekberg wrote on Tuesday, September 13, 2005 10:55 CEST:

*snip*

> > It didn't go away with gcc 3.4.4 so it looks like something
> > different. I posted this bugreport on the cygwin list:
> > 
> > http://sourceware.org/ml/cygwin/2005-09/msg00471.html
> 
> It is indeed something different, it's a libtool bug. Here's a
> patch for stresstest.at that makes the test pass on Cygwin (and
> probably MinGW). I don't think it should be applied, but it shows
> where the problem is...
> 
> In short, when you specify the symbols to export with
> "-export-symbols foo.sym", the file foo.sym is simply prepended
> with an EXPORTS line (if missing) and used as a .def input file
> for the linker. But when a .def file is specified, the auto-export
> magic is shorted out of the loop and the .def file is trusted
> blindly. So, the correct fix is that when the symfile given to
> libtool does not start with an EXPORTS line, the symbols in it has
> to be filtered and " DATA" should be appended to those symbols
> that are data symbols, probably similar to what is done when the
> -export-symbols-regex option is used.

And here's a patch to fix it. It doesn't work 100% on MinGW as
MinGW seems to put most const symbols in the .text segment, so
the nm output has T for some symbols where the nm output on
Cygwin has R. But it seems to work OK on Cygwin so I think the
patch should still be considered. I have no clue as to how to
detect all symbols that are data symbols on MinGW. The symbols
in stresstest.at that are placed in the .text segment are v5,
v6, v8 and v12 (apart from the obvious function, v9). These
symbols are all const, The last const symbol (v7) isn't in the
.text segment on MinGW, that's probably for relocation issues.

        * libltdl/config/ltmain.m4sh (func_mode_link): Filter
        user supplied symfile to tag relevant symbols as data
        symbols. Fixes segfault in stresstest.at on Cygwin and
        makes the test pass.

The patch should perhaps be backported to 1.5 as the bug is
most likely present there as well, but I don't use 1.5...

Cheers,
Peter

Attachment: head-filter-data-symbols.patch
Description: head-filter-data-symbols.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]