Many methods in the BCL are marked with the [MethodImpl(MethodImplOptions.InternalCall)] attribute.
This indicates that the \"method is implemented within the
It's a C# attribute (which indicates to the mono runtime that it is a call to a native method), which invokes native C/C++ code in a .dll linked with the executable embedding the mono runtime (and the .dll exports the function) or in the executable embedding the runtime (using "__Internal" in DLLImport).
It is one of two ways to call native code in mono, one being P/invoke (which uses DLLImport), and the other being internal calls (MethodImplOptions.InternalCall). P/invoke provides marshalling whereas internal calls only marshal blittable types. See here: https://www.mono-project.com/docs/advanced/embedding/.
When the virtual machine detects a C# attribute that indicates an internal call, it will look up the name of the function in its database of pairings (built by the c++ code e.g. mono_add_internal_call ("MonoEmbed::gimme", (const void *)gimme)) and it will then call the address of the function. For Dllimport, it will make API calls LoadLibrary and GetProcAddress for the .dll or if __Internal, passes hModule = GetModuleHandle(NULL) for its own module to GetProcAddress