Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: tools/checkbins/checkbins.py

Issue 8687005: checkbins.py: skip /SAFESEH check on 64-bit Windows binaries (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/checkbins/checkbins.py
===================================================================
--- tools/checkbins/checkbins.py (revision 111015)
+++ tools/checkbins/checkbins.py (working copy)
@@ -23,6 +23,7 @@
DYNAMICBASE_FLAG = 0x0040
NXCOMPAT_FLAG = 0x0100
NO_SEH_FLAG = 0x0400
+MACHINE_TYPE_AMD64 = 0x8664
# Please do not add your file here without confirming that it indeed doesn't
# require /NXCOMPAT and /DYNAMICBASE. Contact cpu@chromium.org or your local
@@ -67,14 +68,19 @@
success = False
print "Checking %s for /NXCOMPAT... FAIL" % path
- # Check for /SAFESEH. Binaries should either have no SEH table
- # (in which case a bit is set in the DLL characteristics section)
- # or there should be a LOAD_CONFIG section present containing
- # a valid SEH table.
+ # Check for /SAFESEH. Binaries should meet one of the following
+ # criteria:
+ # 1) Have no SEH table as indicated by the DLL characteristics
+ # 2) Have a LOAD_CONFIG section containing a valid SEH table
+ # 3) Be a 64-bit binary, in which case /SAFESEH isn't required
+ #
+ # Refer to the following MSDN article for more information:
+ # http://msdn.microsoft.com/en-us/library/9a89h429.aspx
if (pe.OPTIONAL_HEADER.DllCharacteristics & NO_SEH_FLAG or
(hasattr(pe, "DIRECTORY_ENTRY_LOAD_CONFIG") and
pe.DIRECTORY_ENTRY_LOAD_CONFIG.struct.SEHandlerCount > 0 and
- pe.DIRECTORY_ENTRY_LOAD_CONFIG.struct.SEHandlerTable != 0)):
+ pe.DIRECTORY_ENTRY_LOAD_CONFIG.struct.SEHandlerTable != 0) or
+ pe.FILE_HEADER.Machine == MACHINE_TYPE_AMD64):
if options.verbose:
print "Checking %s for /SAFESEH... PASS" % path
else:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698