[Cmake-commits] CMake branch, master, updated. v3.10.1-649-g7bf2141

Kitware Robot kwrobot at kitware.com
Tue Dec 19 12:45:04 EST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  7bf21414301cde129d7d76f4f9980128deb6849e (commit)
       via  1f3933d3825e6e99cc60065a8666c5e22bb1e7c2 (commit)
       via  14ebad533dd278137e5a4768768217ca95c4ca24 (commit)
       via  8950183b3834dc2179dc4965138b1091e291ae9f (commit)
      from  1eac7c6ee58e73302d2049376ff3f114a8e6826e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7bf21414301cde129d7d76f4f9980128deb6849e
commit 7bf21414301cde129d7d76f4f9980128deb6849e
Merge: 1eac7c6 1f3933d
Author:     Christian Pfeiffer <cpfeiffer at live.de>
AuthorDate: Tue Dec 19 17:43:08 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Dec 19 12:43:22 2017 -0500

    Merge topic 'winarm64'
    
    1f3933d3 Address code review feedback
    14ebad53 Use IMAGE_FILE_HEADER and add missing Arm 32bit images support
    8950183b Add Arm64 support to COFF symbol export feature
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1603


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f3933d3825e6e99cc60065a8666c5e22bb1e7c2
commit 1f3933d3825e6e99cc60065a8666c5e22bb1e7c2
Author:     Jacek Blaszczynski <biosciencenow at outlook.com>
AuthorDate: Mon Dec 18 18:22:50 2017 +0100
Commit:     Jacek Blaszczynski <biosciencenow at outlook.com>
CommitDate: Mon Dec 18 18:26:55 2017 +0100

    Address code review feedback

diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 21f27d6..9ec9624 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -331,38 +331,42 @@ bool DumpFile(const char* filename, std::set<std::string>& symbols,
     return false;
   }
 
-  const PIMAGE_FILE_HEADER imageHeader = (PIMAGE_FILE_HEADER)lpFileBase;
-  if (imageHeader->Machine == IMAGE_DOS_SIGNATURE) {
+  const PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)lpFileBase;
+  if (dosHeader->e_magic == IMAGE_DOS_SIGNATURE) {
     fprintf(stderr, "File is an executable.  I don't dump those.\n");
     return false;
-  }
-  /* Does it look like a COFF OBJ file??? */
-  else if (((imageHeader->Machine == IMAGE_FILE_MACHINE_I386) ||
-            (imageHeader->Machine == IMAGE_FILE_MACHINE_AMD64) ||
-            (imageHeader->Machine == IMAGE_FILE_MACHINE_ARM) ||
-            (imageHeader->Machine == IMAGE_FILE_MACHINE_ARMNT) ||
-            (imageHeader->Machine == IMAGE_FILE_MACHINE_ARM64)) &&
-           (imageHeader->Characteristics == 0)) {
-    /*
-    * The two tests above aren't what they look like.  They're
-    * really checking for IMAGE_FILE_HEADER.Machine == i386 (0x14C)
-    * and IMAGE_FILE_HEADER.SizeOfOptionalHeader == 0;
-    */
-    DumpSymbols<IMAGE_FILE_HEADER, IMAGE_SYMBOL> symbolDumper(
-      (PIMAGE_FILE_HEADER)lpFileBase, symbols, dataSymbols,
-      (imageHeader->Machine == IMAGE_FILE_MACHINE_I386));
-    symbolDumper.DumpObjFile();
   } else {
-    // check for /bigobj format
-    cmANON_OBJECT_HEADER_BIGOBJ* h = (cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase;
-    if (h->Sig1 == 0x0 && h->Sig2 == 0xffff) {
-      DumpSymbols<cmANON_OBJECT_HEADER_BIGOBJ, cmIMAGE_SYMBOL_EX> symbolDumper(
-        (cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase, symbols, dataSymbols,
-        (h->Machine == IMAGE_FILE_MACHINE_I386));
+    const PIMAGE_FILE_HEADER imageHeader = (PIMAGE_FILE_HEADER)lpFileBase;
+    /* Does it look like a COFF OBJ file??? */
+    if (((imageHeader->Machine == IMAGE_FILE_MACHINE_I386) ||
+         (imageHeader->Machine == IMAGE_FILE_MACHINE_AMD64) ||
+         (imageHeader->Machine == IMAGE_FILE_MACHINE_ARM) ||
+         (imageHeader->Machine == IMAGE_FILE_MACHINE_ARMNT) ||
+         (imageHeader->Machine == IMAGE_FILE_MACHINE_ARM64)) &&
+        (imageHeader->Characteristics == 0)) {
+      /*
+      * The tests above are checking for IMAGE_FILE_HEADER.Machine
+      * if it contains supported machine formats (currently ARM and x86)
+      * and IMAGE_FILE_HEADER.Characteristics == 0 indicating that
+      * this is not linked COFF OBJ file;
+      */
+      DumpSymbols<IMAGE_FILE_HEADER, IMAGE_SYMBOL> symbolDumper(
+        (PIMAGE_FILE_HEADER)lpFileBase, symbols, dataSymbols,
+        (imageHeader->Machine == IMAGE_FILE_MACHINE_I386));
       symbolDumper.DumpObjFile();
     } else {
-      printf("unrecognized file format in '%s'\n", filename);
-      return false;
+      // check for /bigobj format
+      cmANON_OBJECT_HEADER_BIGOBJ* h =
+        (cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase;
+      if (h->Sig1 == 0x0 && h->Sig2 == 0xffff) {
+        DumpSymbols<cmANON_OBJECT_HEADER_BIGOBJ, cmIMAGE_SYMBOL_EX>
+        symbolDumper((cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase, symbols,
+                     dataSymbols, (h->Machine == IMAGE_FILE_MACHINE_I386));
+        symbolDumper.DumpObjFile();
+      } else {
+        printf("unrecognized file format in '%s'\n", filename);
+        return false;
+      }
     }
   }
   UnmapViewOfFile(lpFileBase);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=14ebad533dd278137e5a4768768217ca95c4ca24
commit 14ebad533dd278137e5a4768768217ca95c4ca24
Author:     Jacek Blaszczynski <biosciencenow at outlook.com>
AuthorDate: Mon Dec 18 16:15:58 2017 +0100
Commit:     Jacek Blaszczynski <biosciencenow at outlook.com>
CommitDate: Mon Dec 18 16:15:58 2017 +0100

    Use IMAGE_FILE_HEADER and add missing Arm 32bit images support

diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 698ab78..21f27d6 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -31,7 +31,7 @@
  * Extension (Axel 2006-03-15)
  *    As soon as an object file contains an /EXPORT directive (which
  *    is generated by the compiler when a symbol is declared as
- *    declspec(dllexport)) no to-be-exported symbols are printed,
+ *    __declspec(dllexport) no to-be-exported symbols are printed,
  *    as the linker will see these directives, and if those directives
  *    are present we only export selectively (i.e. we trust the
  *    programmer).
@@ -50,12 +50,12 @@
 *
 *    It created a wrong EXPORTS for the global pointers and constants.
 *    The Section Header has been involved to discover the missing information
-*    Now the pointers are correctly supplied  supplied with "DATA" descriptor
+*    Now the pointers are correctly supplied with "DATA" descriptor
 *        the constants  with no extra descriptor.
 *
 * Corrections (Valery Fine 16/09/96):
 *
-*     It didn't work for C++ code with global variables and class definitons
+*     It didn't work for C++ code with global variables and class definitions
 *     The DumpExternalObject function has been introduced to generate .DEF file
 *
 * Author:   Valery Fine 16/09/96  (E-mail: fine at vxcern.cern.ch)
@@ -68,8 +68,20 @@
 #include <iostream>
 #include <windows.h>
 
+#ifndef IMAGE_FILE_MACHINE_ARM
+#define IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM Little-Endian
+#endif
+
+#ifndef IMAGE_FILE_MACHINE_THUMB
+#define IMAGE_FILE_MACHINE_THUMB 0x01c2 // ARM Thumb/Thumb-2 Little-Endian
+#endif
+
 #ifndef IMAGE_FILE_MACHINE_ARMNT
-#define IMAGE_FILE_MACHINE_ARMNT 0x01c4
+#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian
+#endif
+
+#ifndef IMAGE_FILE_MACHINE_ARM64
+#define IMAGE_FILE_MACHINE_ARM64 0xaa64 // ARM64 Little-Endian
 #endif
 
 typedef struct cmANON_OBJECT_HEADER_BIGOBJ
@@ -294,7 +306,6 @@ bool DumpFile(const char* filename, std::set<std::string>& symbols,
   HANDLE hFile;
   HANDLE hFileMapping;
   LPVOID lpFileBase;
-  PIMAGE_DOS_HEADER dosHeader;
 
   hFile = CreateFileW(cmsys::Encoding::ToWide(filename).c_str(), GENERIC_READ,
                       FILE_SHARE_READ, NULL, OPEN_EXISTING,
@@ -320,17 +331,18 @@ bool DumpFile(const char* filename, std::set<std::string>& symbols,
     return false;
   }
 
-  dosHeader = (PIMAGE_DOS_HEADER)lpFileBase;
-  if (dosHeader->e_magic == IMAGE_DOS_SIGNATURE) {
+  const PIMAGE_FILE_HEADER imageHeader = (PIMAGE_FILE_HEADER)lpFileBase;
+  if (imageHeader->Machine == IMAGE_DOS_SIGNATURE) {
     fprintf(stderr, "File is an executable.  I don't dump those.\n");
     return false;
   }
   /* Does it look like a COFF OBJ file??? */
-  else if (((dosHeader->e_magic == IMAGE_FILE_MACHINE_I386) ||
-            (dosHeader->e_magic == IMAGE_FILE_MACHINE_AMD64) ||
-            (dosHeader->e_magic == IMAGE_FILE_MACHINE_ARMNT)) ||
-           (dosHeader->e_magic == IMAGE_FILE_MACHINE_ARM64) &&
-             (dosHeader->e_sp == 0)) {
+  else if (((imageHeader->Machine == IMAGE_FILE_MACHINE_I386) ||
+            (imageHeader->Machine == IMAGE_FILE_MACHINE_AMD64) ||
+            (imageHeader->Machine == IMAGE_FILE_MACHINE_ARM) ||
+            (imageHeader->Machine == IMAGE_FILE_MACHINE_ARMNT) ||
+            (imageHeader->Machine == IMAGE_FILE_MACHINE_ARM64)) &&
+           (imageHeader->Characteristics == 0)) {
     /*
     * The two tests above aren't what they look like.  They're
     * really checking for IMAGE_FILE_HEADER.Machine == i386 (0x14C)
@@ -338,7 +350,7 @@ bool DumpFile(const char* filename, std::set<std::string>& symbols,
     */
     DumpSymbols<IMAGE_FILE_HEADER, IMAGE_SYMBOL> symbolDumper(
       (PIMAGE_FILE_HEADER)lpFileBase, symbols, dataSymbols,
-      (dosHeader->e_magic == IMAGE_FILE_MACHINE_I386));
+      (imageHeader->Machine == IMAGE_FILE_MACHINE_I386));
     symbolDumper.DumpObjFile();
   } else {
     // check for /bigobj format

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8950183b3834dc2179dc4965138b1091e291ae9f
commit 8950183b3834dc2179dc4965138b1091e291ae9f
Author:     Jacek Blaszczynski <biosciencenow at outlook.com>
AuthorDate: Sun Dec 17 01:41:21 2017 +0100
Commit:     Jacek Blaszczynski <biosciencenow at outlook.com>
CommitDate: Sun Dec 17 01:41:21 2017 +0100

    Add Arm64 support to COFF symbol export feature

diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 2eb47f3..698ab78 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -328,8 +328,9 @@ bool DumpFile(const char* filename, std::set<std::string>& symbols,
   /* Does it look like a COFF OBJ file??? */
   else if (((dosHeader->e_magic == IMAGE_FILE_MACHINE_I386) ||
             (dosHeader->e_magic == IMAGE_FILE_MACHINE_AMD64) ||
-            (dosHeader->e_magic == IMAGE_FILE_MACHINE_ARMNT)) &&
-           (dosHeader->e_sp == 0)) {
+            (dosHeader->e_magic == IMAGE_FILE_MACHINE_ARMNT)) ||
+           (dosHeader->e_magic == IMAGE_FILE_MACHINE_ARM64) &&
+             (dosHeader->e_sp == 0)) {
     /*
     * The two tests above aren't what they look like.  They're
     * really checking for IMAGE_FILE_HEADER.Machine == i386 (0x14C)

-----------------------------------------------------------------------

Summary of changes:
 Source/bindexplib.cxx |   75 ++++++++++++++++++++++++++++++-------------------
 1 file changed, 46 insertions(+), 29 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list