diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachNative.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachNative.cs index 9c4f07c866cfc..14db96a935474 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachNative.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachNative.cs @@ -96,6 +96,7 @@ internal static class MachNative public const byte N_INDR = 0xA; public const byte N_SECT = 0xE; public const byte N_PBUD = 0xC; + public const byte N_PEXT = 0x10; // Symbol descriptor flags public const ushort REFERENCE_FLAG_UNDEFINED_NON_LAZY = 0; diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachObjectWriter.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachObjectWriter.cs index c6d97312deb2d..2424ec434126c 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachObjectWriter.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachObjectWriter.cs @@ -484,7 +484,7 @@ private protected override void EmitSymbolTable( Section = section, Value = section.VirtualAddress + (ulong)definition.Value, Descriptor = N_NO_DEAD_STRIP, - Type = N_SECT | N_EXT, + Type = (byte)(N_SECT | N_EXT | (definition.Global ? 0 : N_PEXT)), }); } sortedDefinedSymbols.Sort((symA, symB) => string.CompareOrdinal(symA.Name, symB.Name));