[Top][All Lists]

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

[Bug ld/4844] New: auto-import and const data import problem

From: ralf dot habacker at freenet dot de
Subject: [Bug ld/4844] New: auto-import and const data import problem
Date: 26 Jul 2007 06:27:41 -0000


mingw and cygwin ld has a feature called auto-import, which allows to import
data symbols without any dllexport/dlimport decoration. While this feature works
for many cases importing const data with gcc >= 4 fails. 

A description of the problem could be found here 

In http://cygwin.com/ml/cygwin/2007-07/msg00470.html there are two solutions

As you can see from Chuck's message it's kind of a hairy situation in
that there is no "real" fix for it other than undoing the optimization
of placing these in a readonly section.  That can be accomplished by
either using a modified linker script or by removing the 'const' from
the declaration.  The former is a sort of brute force/last ditch
approach which is useful if you have a very large code base with lots of
modules and you can't or don't want to hunt down the offending structs. 
I think the qt project had to take this approach:

Because this problem seems to hit many people the question is if this linker
script could be integrated in ld and automatically used for linking in case
auto-import is enabled.

           Summary: auto-import and const data import problem
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: ralf dot habacker at freenet dot de
                CC: bug-binutils at gnu dot org,ralf dot habacker at freenet
                    dot de


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

reply via email to

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