This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

Re: [RFA] pei386 dll: auto-import patch


Gentlemen,

          Thanks for all your work on supporting and lobbying the
patch in question. Thanks to binutils maintainers for accepting it
(heh, it was committed on a right day - I had birthday then, it was a
good present, thanks ;-) ). Sorry that I didn't participate in the
discussion - I was in the other city with little chance to access my
mail and with no access to my devel machine.

          I don't have much time to study related threads thoroughly,
but from quick skimming I would like to add some
comments/clarifications/opinions on some subjects (but please note
that I might miss some info or misunderstand the point due to surface
review):

1. I never posted auto-import patch on binutils maillist. It was
available from the mingw distro and I passed it to Ralf Habacker
(Cygwin KDE porter). While he was testing it, he found issue with
repetitive auto-importing of some symbols leading to segfaults. It
was fixed and passed back to him. He confirmed it fixed issue and
reported that some reasonable subset of kde core and sample apps were
build with and were running.

I'm currently cvs-updating my local copy of binutils to check if I
have any pending changes.

2. Presuppositions for using auto-import

To use aut-import, you must have new-fashion import library [for those
symbols which gets auto-imported], period. New-fashion implibs are
produced by the new (auto-import-patched) ld. Hence, auto-import won't
work with:

2.1. implibs made by old ld
2.2. implibs made by dlltool

Additionally, it won't work when:

2.3. linking directly against dll

The last case may need to be fixed somewhen.

When auto-import linking with unsupported implibs will be requested,
you'll get undefineds of _nm_* or something.

3. auto-import vs auto-export

Well, those are totally different and unrelated (rather, orthogonal)
features. Their names are not confusing, IMHO. Consider yourself:

3.1. auto-export about *exporting* (sic) symbols from some PE image.
The usual way of exporting is marking symbols explicitly and manually
as such (via __declspec() or .def). auto-export does the job
automatically, by exporting all symbols except ones which can be
proved to be only of internal usage or mere junk.

The switch which activates auto-export feature is --export-all-symbols
(commonly abbreviated as --export-all)

3.2. auto-import about *importing* (sic) [data] symbols into some PE
image. The usual way of importing data symbols is marking them
explicitly as such with __declspec(). auto-import allows to skip this,
by importing data automatically.

The switch which activates the feature is --enable-auto-import .


So, from my point of view, mere names imply clearly that they
are distinct, in some way symmetrical, and those names quite close
describe their operation. The only confusion is that features and
corresponding commandline options are named differently, but that's
another issue.

Also, there should be no problems with using --export-all and
--enable-auto-import during the same link, the meaning is: resolve
symbols using auto-import feature; export all suitable symbols to the
resulting image. If any problems with the combination exist, it's a
bug or issue with particular linking environment (like C++).

4. I have no idea what may cause problems with elaborated C++ stuff
(containing templates, etc.). The first thing to check is place where
segfault happens - in OS linker or in app startup. If the latter is
the case, then, as Danny Smith points out, it may be an issue with C++
dlls at all, and not just with auto-import.


     Hope this helps a bit,


--
Paul Sokolovsky, IT Specialist
http://www.brainbench.com/transcript.jsp?pid=11135



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