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 88a08e1
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<LinkerArg Include="-Wl,-rpath,'$ORIGIN'" Condition="'$(TargetOS)' != 'OSX'" />
<LinkerArg Include="-Wl,-rpath,'@executable_path'" Condition="'$(TargetOS)' == 'OSX'" />
<LinkerArg Include="-Wl,--as-needed" Condition="'$(TargetOS)' != 'OSX'" />
<LinkerArg Include="-Wl,-z,relro,-z,now" Condition="'$(TargetOS)' != 'OSX'" />
<LinkerArg Include="-pthread" Condition="'$(TargetOS)' != 'OSX'" />
<LinkerArg Include="-lstdc++" />
<LinkerArg Include="-ldl" />
Expand All @@ -89,6 +90,7 @@ 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)' == ''" />
<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 88a08e1

Please sign in to comment.