Skip to content

Commit

Permalink
Enable -pie and -z,relro,-z,now for NativeAOT binaries
Browse files Browse the repository at this point in the history
Fixes binskim warning BA3001 and BA3011

Contributes to #1738
  • Loading branch information
jkotas committed Nov 20, 2021
1 parent 7dcd615 commit 046a701
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ The .NET Foundation licenses this file to you under the MIT license.
<LinkerArg Include="-licucore" Condition="'$(TargetOS)' == 'OSX'" />
<LinkerArg Include="-dynamiclib" Condition="'$(TargetOS)' == 'OSX' and '$(NativeLib)' == 'Shared'" />
<LinkerArg Include="-shared" Condition="'$(TargetOS)' != 'OSX' and '$(NativeLib)' == 'Shared'" />
<LinkerArg Include="-pie" Condition="'$(TargetOS)' != 'OSX' and '$(NativeLib)' == ''" /> <!-- binskim warning BA3001 PIE disabled on executable -->
<LinkerArg Include="-Wl,-z,relro,-z,now" Condition="'$(TargetOS)' != 'OSX'" /> <!-- binskim warning BA3011 The BIND_NOW flag is missing -->
<LinkerArg Include="-Wl,-u,_CoreRT_StaticInitialization" Condition="'$(TargetOS)' == 'OSX' and '$(NativeLib)' == 'Shared'" />
<LinkerArg Include="-Wl,--require-defined,CoreRT_StaticInitialization" Condition="'$(TargetOS)' != 'OSX' and '$(NativeLib)' == 'Shared'" />

Expand Down

0 comments on commit 046a701

Please sign in to comment.