diff --git a/src/mono/mono/metadata/class-abi-details.h b/src/mono/mono/metadata/class-abi-details.h index 495f00f6e04e0..fa822e19c9b11 100644 --- a/src/mono/mono/metadata/class-abi-details.h +++ b/src/mono/mono/metadata/class-abi-details.h @@ -10,8 +10,13 @@ #include #define MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname) /*nothing*/ +/* + * In-tree profilers are allowed to use the offset functions. So if we're + * compiling with --enable-checked-build=private_types, mark the symbols with + * MONO_PROFILER_API + */ #ifdef MONO_CLASS_DEF_PRIVATE -#define MONO_CLASS_OFFSET(funcname, argtype, fieldname) intptr_t funcname (void); +#define MONO_CLASS_OFFSET(funcname, argtype, fieldname) MONO_PROFILER_API intptr_t funcname (void); #else #define MONO_CLASS_OFFSET(funcname, argtype, fieldname) static inline intptr_t funcname (void) { return MONO_STRUCT_OFFSET (argtype, fieldname); } #endif diff --git a/src/mono/mono/metadata/class-internals.h b/src/mono/mono/metadata/class-internals.h index 0ba3ea1d3ce21..e56ae5ea556dd 100644 --- a/src/mono/mono/metadata/class-internals.h +++ b/src/mono/mono/metadata/class-internals.h @@ -294,9 +294,13 @@ union _MonoClassSizes { /* If MonoClass definition is hidden, just declare the getters. * Otherwise, define them as static inline functions. + * + * In-tree profilers are allowed to use the getters. So if we're compiling + * with --enable-checked-build=private_types, mark the symbols with + * MONO_PROFILER_API */ #ifdef MONO_CLASS_DEF_PRIVATE -#define MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname) rettype funcname (argtype *klass); +#define MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname) MONO_PROFILER_API rettype funcname (argtype *klass); #else #define MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname) static inline rettype funcname (argtype *klass) { return optref klass-> fieldname ; } #endif