@@ -59,15 +59,17 @@ def test_PE(self):
59
59
cc = determine_wellknown_cmd ('CC' , 'x86_64-w64-mingw32-gcc' )
60
60
write_testcode (source )
61
61
62
- self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--no-nxcompat' ,'-Wl,--no-dynamicbase' ,'-Wl,--no-high-entropy-va' ,'-no-pie' ,'-fno-PIE' ]),
63
- (1 , executable + ': failed DYNAMIC_BASE HIGH_ENTROPY_VA NX RELOC_SECTION' ))
64
- self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--no-dynamicbase' ,'-Wl,--no-high-entropy-va' ,'-no-pie' ,'-fno-PIE' ]),
65
- (1 , executable + ': failed DYNAMIC_BASE HIGH_ENTROPY_VA RELOC_SECTION' ))
66
- self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--dynamicbase' ,'-Wl,--no-high-entropy-va' ,'-no-pie' ,'-fno-PIE' ]),
67
- (1 , executable + ': failed HIGH_ENTROPY_VA RELOC_SECTION' ))
68
- self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--dynamicbase' ,'-Wl,--high-entropy-va' ,'-no-pie' ,'-fno-PIE' ]),
69
- (1 , executable + ': failed RELOC_SECTION' ))
70
- self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--dynamicbase' ,'-Wl,--high-entropy-va' ,'-pie' ,'-fPIE' ]),
62
+ self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--no-nxcompat' ,'-Wl,--disable-reloc-section' ,'-Wl,--no-dynamicbase' ,'-Wl,--no-high-entropy-va' ,'-no-pie' ,'-fno-PIE' ]),
63
+ (1 , executable + ': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA NX RELOC_SECTION' ))
64
+ self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--disable-reloc-section' ,'-Wl,--no-dynamicbase' ,'-Wl,--no-high-entropy-va' ,'-no-pie' ,'-fno-PIE' ]),
65
+ (1 , executable + ': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA RELOC_SECTION' ))
66
+ self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--enable-reloc-section' ,'-Wl,--no-dynamicbase' ,'-Wl,--no-high-entropy-va' ,'-no-pie' ,'-fno-PIE' ]),
67
+ (1 , executable + ': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA' ))
68
+ self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--enable-reloc-section' ,'-Wl,--no-dynamicbase' ,'-Wl,--no-high-entropy-va' ,'-pie' ,'-fPIE' ]),
69
+ (1 , executable + ': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA' )) # -pie -fPIE does nothing unless --dynamicbase is also supplied
70
+ self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--enable-reloc-section' ,'-Wl,--dynamicbase' ,'-Wl,--no-high-entropy-va' ,'-pie' ,'-fPIE' ]),
71
+ (1 , executable + ': failed HIGH_ENTROPY_VA' ))
72
+ self .assertEqual (call_security_check (cc , source , executable , ['-Wl,--nxcompat' ,'-Wl,--enable-reloc-section' ,'-Wl,--dynamicbase' ,'-Wl,--high-entropy-va' ,'-pie' ,'-fPIE' ]),
71
73
(0 , '' ))
72
74
73
75
clean_files (source , executable )
0 commit comments