This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

[PATCH] New option for DLL and import library generation on PE systems.


    Hi gang,

  The attached patch adds a new feature to systems based on the PE and PEP
(PE+) emulations, a new command-line option to use when linking a DLL and
generating its related import library.

  The new --exclude-modules-for-implib command-line option
allows the user to specify a list of modules (object files or archive
members) that should not have their symbols auto-exported from the DLL, but
that should instead be inserted wholesale as members of the new import
library instead.  (The named modules are still available for the DLL's final
link, and will be pulled into the DLL unexported if there are unresolved
references to their symbols.)

  This option is needed for building libstdc++ as a DLL on Cygwin (at the
least, presumably MinGW as well but I haven't tested that); building
cygdstdc++-6.dll with "--exclude-modules-for-implib=tinfo.o:tinfo2.o" fixes
the 20_util/shared_ptr/thread/default_weaktoshared.cc execution test.

  Although it could be implemented by hacking around libtool and adding
multiple steps to extract all the symbols from the modules in question, then
finding the objects (or extracting the archive members) and adding them back
into the import lib after the link, but adding it as a feature to ld means
projects can build their libraries and DLLs this way using a simple
modification to LDFLAGS.

  Built on i686-pc-cygwin and cross to x86_64-pc-mingw32, no testsuite
regressions.  Ok?

    cheers,
      DaveK

Attachment: ld-exclude-modules-for-implib-patch.diff
Description: Binary data


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