diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index eb93c4f97c5e5e..5b236e939af49f 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -102,7 +102,7 @@ The .NET Foundation licenses this file to you under the MIT license. - + diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NodeFactory.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NodeFactory.cs index aa73c735ae70a0..84e0418e3f9e43 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NodeFactory.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/NodeFactory.cs @@ -1423,12 +1423,16 @@ public StructMarshallingDataNode StructMarshallingData(DefType type) /// Returns alternative symbol name that object writer should produce for given symbols /// in addition to the regular one. /// - public string GetSymbolAlternateName(ISymbolNode node) + public string GetSymbolAlternateName(ISymbolNode node, out bool isHidden) { - string value; - if (!NodeAliases.TryGetValue(node, out value)) + if (!NodeAliases.TryGetValue(node, out var value)) + { + isHidden = false; return null; - return value; + } + + isHidden = value.Hidden; + return value.Name; } public ArrayOfEmbeddedPointersNode GCStaticsRegion = new ArrayOfEmbeddedPointersNode( @@ -1451,7 +1455,7 @@ public string GetSymbolAlternateName(ISymbolNode node) public ReadyToRunHeaderNode ReadyToRunHeader; - public Dictionary NodeAliases = new Dictionary(); + public Dictionary NodeAliases = new Dictionary(); protected internal TypeManagerIndirectionNode TypeManagerIndirection = new TypeManagerIndirectionNode(); diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExpectedIsaFeaturesRootProvider.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExpectedIsaFeaturesRootProvider.cs index 90f7b77a4f76fb..9d172414a06aa2 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExpectedIsaFeaturesRootProvider.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExpectedIsaFeaturesRootProvider.cs @@ -24,7 +24,7 @@ void ICompilationRootProvider.AddCompilationRoots(IRootingServiceProvider rootPr { int isaFlags = HardwareIntrinsicHelpers.GetRuntimeRequiredIsaFlags(_isaSupport); byte[] bytes = BitConverter.GetBytes(isaFlags); - rootProvider.RootReadOnlyDataBlob(bytes, 4, "ISA support flags", "g_requiredCpuFeatures"); + rootProvider.RootReadOnlyDataBlob(bytes, 4, "ISA support flags", "g_requiredCpuFeatures", exportHidden: true); } } } diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExportsFileWriter.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExportsFileWriter.cs index 80e094f5b3117b..49fc928c06eb93 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExportsFileWriter.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExportsFileWriter.cs @@ -26,7 +26,7 @@ public ExportsFileWriter(TypeSystemContext context, string exportsFile, string[] } public void AddExportedMethods(IEnumerable methods) - => _methods.AddRange(methods.Where(m => m.Module != _context.SystemModule)); + => _methods.AddRange(methods); public void EmitExportedMethods() { diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/IRootingServiceProvider.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/IRootingServiceProvider.cs index 40f1680db57ae9..74bdcbdac01c8e 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/IRootingServiceProvider.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/IRootingServiceProvider.cs @@ -10,7 +10,7 @@ namespace ILCompiler /// public interface IRootingServiceProvider { - void AddCompilationRoot(MethodDesc method, string reason, string exportName = null); + void AddCompilationRoot(MethodDesc method, string reason, string exportName = null, bool exportHidden = false); void AddCompilationRoot(TypeDesc type, string reason); void AddReflectionRoot(TypeDesc type, string reason); void AddReflectionRoot(MethodDesc method, string reason); @@ -19,7 +19,7 @@ public interface IRootingServiceProvider void RootGCStaticBaseForType(TypeDesc type, string reason); void RootNonGCStaticBaseForType(TypeDesc type, string reason); void RootModuleMetadata(ModuleDesc module, string reason); - void RootReadOnlyDataBlob(byte[] data, int alignment, string reason, string exportName); + void RootReadOnlyDataBlob(byte[] data, int alignment, string reason, string exportName, bool exportHidden); void RootDelegateMarshallingData(DefType type, string reason); void RootStructMarshallingData(DefType type, string reason); void AddCompilationRoot(object o, string reason); diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDataInterner.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDataInterner.cs index 496e775ed03208..01693282748e70 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDataInterner.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectDataInterner.cs @@ -36,7 +36,7 @@ private void EnsureMap(NodeFactory factory) // Bodies that are visible from outside should not be folded because we don't know // if they're address taken. - if (factory.GetSymbolAlternateName(body) != null) + if (factory.GetSymbolAlternateName(body, out _) != null) continue; var key = new MethodInternKey(body, factory); diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ObjectWriter.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ObjectWriter.cs index b3203d08b0d6fd..c0335bd1474705 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ObjectWriter.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ObjectWriter.cs @@ -422,14 +422,14 @@ private void EmitObject(string objectFilePath, IReadOnlyCollection