diff options
author | Paolo Molaro <lupus@oddwiz.org> | 2002-11-18 18:39:31 +0300 |
---|---|---|
committer | Paolo Molaro <lupus@oddwiz.org> | 2002-11-18 18:39:31 +0300 |
commit | ef768d3054999430cadb322b91e17f73c4ccd0ab (patch) | |
tree | 37fb814b36fc27916e0b27008e147923f007a58f | |
parent | 149bb43784322800a5694ef16cea71f395f92091 (diff) |
Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
* reflection.c: set a public key token on the core assemblies.
svn path=/trunk/mono/; revision=9058
-rw-r--r-- | mono/metadata/ChangeLog | 5 | ||||
-rw-r--r-- | mono/metadata/reflection.c | 23 |
2 files changed, 27 insertions, 1 deletions
diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog index 6a017c7e14a..808e0aaa4d9 100644 --- a/mono/metadata/ChangeLog +++ b/mono/metadata/ChangeLog @@ -1,3 +1,8 @@ + +Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com> + + * reflection.c: set a public key token on the core assemblies. + 2002-11-18 Dick Porter <dick@ximian.com> * threads.c: Split out some thread initialisation so that other diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c index e3502232ff9..764da7c22d9 100644 --- a/mono/metadata/reflection.c +++ b/mono/metadata/reflection.c @@ -1214,7 +1214,28 @@ resolution_scope_from_image (MonoDynamicAssembly *assembly, MonoImage *image) mono_digest_get_public_token (pubtoken + 1, pubkey, publen); values [MONO_ASSEMBLYREF_PUBLIC_KEY] = mono_image_add_stream_data (&assembly->blob, pubtoken, 9); } else { - values [MONO_ASSEMBLYREF_PUBLIC_KEY] = 0; + /* + * We add the pubtoken from ms, so that the ms runtime can handle our binaries. + * This is currently only a problem with references to System.Xml (see bug#27706), + * but there may be other cases that makes this necessary. Note, we need to set + * the version as well. When/if we sign our assemblies, we'd need to get our pubtoken + * recognized by ms, yuck! + * FIXME: need to add more assembly names, as needed. + */ + if (strcmp (image->assembly_name, "corlib") == 0 || + strcmp (image->assembly_name, "mscorlib") == 0 || + strcmp (image->assembly_name, "System") == 0 || + strcmp (image->assembly_name, "System.Xml") == 0 || + strcmp (image->assembly_name, "System.Data") == 0 || + strcmp (image->assembly_name, "System.Drawing") == 0 || + strcmp (image->assembly_name, "System.Web") == 0) { + static const guchar ptoken [9] = {8, '\xB7', '\x7A', '\x5C', '\x56', '\x19', '\x34', '\xE0', '\x89'}; + values [MONO_ASSEMBLYREF_PUBLIC_KEY] = mono_image_add_stream_data (&assembly->blob, ptoken, 9); + values [MONO_ASSEMBLYREF_MAJOR_VERSION] = 1; + values [MONO_ASSEMBLYREF_BUILD_NUMBER] = 3300; + } else { + values [MONO_ASSEMBLYREF_PUBLIC_KEY] = 0; + } } token <<= RESOLTION_SCOPE_BITS; token |= RESOLTION_SCOPE_ASSEMBLYREF; |