Skip to content

Commit

Permalink
Revert "Write linker script for lld to enable gc-sections (#84493)"
Browse files Browse the repository at this point in the history
This reverts commit 3ab663e.
  • Loading branch information
sbomer committed Apr 10, 2023
1 parent ee57442 commit d80a584
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,7 @@ The .NET Foundation licenses this file to you under the MIT license.
</ItemGroup>
<ItemGroup Condition="'$(_targetOS)' != 'win' and '$(_IsApplePlatform)' != 'true'">
<CustomLinkerArg Include="-Wl,--discard-all" />
<CustomLinkerArg Include="-Wl,--gc-sections" Condition="'$(LinkerFlavor)' == '' or '$(LinkerFlavor)' == 'bfd' or '$(LinkerFlavor)' == 'lld'" />
<CustomLinkerArg Include="-Wl,-T,&quot;$(NativeIntermediateOutputPath)sections.ld&quot;" Condition="'$(LinkerFlavor)' == 'lld'" />
<CustomLinkerArg Include="-Wl,--gc-sections" Condition="'$(LinkerFlavor)' == '' or '$(LinkerFlavor)' == 'bfd'" />
</ItemGroup>
<ItemGroup>
<CustomLibArg Include="-crs &quot;$(NativeBinary)&quot;" Condition="'$(_targetOS)' != 'win'" />
Expand All @@ -336,9 +335,6 @@ The .NET Foundation licenses this file to you under the MIT license.
<StripFlag Condition="'$(_IsApplePlatform)' == 'true' and '$(NativeLib)' == 'Shared'">-x</StripFlag> <!-- keep global symbols in dylib -->
</PropertyGroup>

<!-- write linker script for lld to retain the __modules section -->
<WriteLinesToFile File="$(NativeIntermediateOutputPath)sections.ld" Lines="OVERWRITE_SECTIONS { __modules : { KEEP(*(__modules)) } }" Overwrite="true" Condition="'$(LinkerFlavor)' == 'lld'" />

<Exec Command="&quot;$(CppLinker)&quot; @(CustomLinkerArg, ' ')" Condition="'$(_targetOS)' != 'win' and '$(NativeLib)' != 'Static'" IgnoreStandardErrorWarningFormat="$(_IgnoreLinkerWarnings)" />
<Exec Command="&quot;$(CppLibCreator)&quot; @(CustomLibArg, ' ')" Condition="'$(_targetOS)' != 'win' and '$(NativeLib)' == 'Static'" />

Expand Down

0 comments on commit d80a584

Please sign in to comment.