]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: parse "dumpbin -headers" to get symbols exported from implibs
authorPeter Rosin <peda@lysator.liu.se>
Fri, 19 Oct 2012 15:19:50 +0000 (17:19 +0200)
committerPeter Rosin <peda@lysator.liu.se>
Fri, 19 Oct 2012 15:19:50 +0000 (17:19 +0200)
* m4/libtool.m4 (_LT_CMD_GLOBAL_SYMBOLS) [MSVC]: Extract symbols
imported from DLLs by import libraries in the Microsoft dumpbin
wrapper.
(LT_PATH_NM): Add -headers option if dumpbin is the located name
lister to feed the above new code.
* NEWS: Update.

Signed-off-by: Peter Rosin <peda@lysator.liu.se>
NEWS
m4/libtool.m4

diff --git a/NEWS b/NEWS
index 7f70eaf9ee534dbf98d004d8f60611f4e2c21aeb..d0107a9b36e96195f97eaddba2fa1797de67fbfe 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -56,8 +56,10 @@ NEWS - list of user-visible changes between releases of GNU Libtool
     will now correctly fallback to using only vanilla shell features
     instead of failing with a parse at startup.
   - Correctly recognize import libraries when Microsoft dumpbin is used
-    as the name lister. Also fix a bug in the dumpbin wrapper which could
-    lead to broken symbol listings in some corner cases.
+    as the name lister and extend the dumpbin wrapper to find symbols
+    in import libraries using the -headers option of dumpbin. Also fix a
+    bug in the dumpbin wrapper which could lead to broken symbol listings
+    in some corner cases.
 
 ** Important incompatible changes:
 
index e216f725cf89cc33096e1873f7c9c1187db3f0b3..c85a85f2e98b3a45e3dbf619a31ab488a9eabb0d 100644 (file)
@@ -3426,9 +3426,9 @@ else
     # Let the user override the test.
   else
     AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
+      DUMPBIN="$DUMPBIN -symbols -headers"
       ;;
     *)
       DUMPBIN=:
@@ -3682,6 +3682,9 @@ for ac_symprfx in "" "_"; do
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"D\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\