1 hour ago · 8 min read1579 words · Tech · hide · 0 comments

In this post, I describe how I customized the linker for a NativeAOT application to remove a whole web of dependencies that I know will never be needed, but which the linker was unable to determine directly that it could remove. By using method substitutions, you can significantly reduce the size of the final NativeAOT binary, by enabling additional dead-code elimination. Background: The dd-dotnet command line tool The Datadog .NET SDK includes a small .NET command line application, dd-dotnet that is installed with the auto-instrumentation libraries and is used for various purposes. It's intentionally lightweight, and we compile it using NativeAOT to create a small binary that can run without any specific .NET version needing to be installed on a target machine. The app takes a dependency on the Microsoft.Diagnostics.Runtime library, also known as "ClrMD". This is a process and crash dump introspection tool that we use in dd-dotnet to analyse failures. With our recent work on…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.