@@ -43,18 +43,28 @@ def test_ELF(self):
43
43
self .assertEqual (call_security_check (cc , source , executable , ['-Wl,-znoexecstack' ,'-fstack-protector-all' ,'-Wl,-zrelro' ,'-Wl,-z,now' ,'-pie' ,'-fPIE' ]),
44
44
(0 , '' ))
45
45
46
- def test_PE (self ):
46
+ def test_32bit_PE (self ):
47
47
source = 'test1.c'
48
48
executable = 'test1.exe'
49
49
cc = 'i686-w64-mingw32-gcc'
50
50
write_testcode (source )
51
51
52
52
self .assertEqual (call_security_check (cc , source , executable , []),
53
- (1 , executable + ': failed PIE NX' ))
53
+ (1 , executable + ': failed DYNAMIC_BASE NX' ))
54
54
self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ]),
55
- (1 , executable + ': failed PIE ' ))
55
+ (1 , executable + ': failed DYNAMIC_BASE ' ))
56
56
self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--dynamicbase' ]),
57
57
(0 , '' ))
58
+ def test_64bit_PE (self ):
59
+ source = 'test1.c'
60
+ executable = 'test1.exe'
61
+ cc = 'x86_64-w64-mingw32-gcc'
62
+ write_testcode (source )
63
+
64
+ self .assertEqual (call_security_check (cc , source , executable , []), (1 , executable + ': failed DYNAMIC_BASE NX\n ' + executable + ': warning HIGH_ENTROPY_VA' ))
65
+ self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ]), (1 , executable + ': failed DYNAMIC_BASE\n ' + executable + ': warning HIGH_ENTROPY_VA' ))
66
+ self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--dynamicbase' ]), (0 , executable + ': warning HIGH_ENTROPY_VA' ))
67
+ self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--dynamicbase' ,'-Wl,--high-entropy-va' ]), (0 , '' ))
58
68
59
69
if __name__ == '__main__' :
60
70
unittest .main ()
0 commit comments