diff options
author | Radek Doulik <rodo@xamarin.com> | 2017-10-24 11:01:37 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-10-24 17:14:56 +0300 |
commit | 4b702c8d6a45332dad7fb4df6e37ed8ecda9b939 (patch) | |
tree | a624244f56d73eea0b6eda8863070b7aa2ca8556 /mcs | |
parent | 9502de785298afdb566bae008f9ad784355b7178 (diff) |
[corlib] Updated LinkerDescriptor
Preserve
`System.Runtime.Remoting.Activation.ActivationServices.CreateProxyForType`. It
is called from `object.c:mono_object_new_specific_checked` when
constructing remoting or com objects.
I didn't add `feature="remoting"` because it is used also for com
objects.
Added linker test. Without the LinkerDescriptor addition, it fails
like this:
Unhandled Exception:
System.NotSupportedException: Linked away.
at (wrapper managed-to-native) System.Object.__icall_wrapper_ves_icall_object_new_specific(intptr)
at C.Main () [0x00001] in /Users/rodo/git/mono/mcs/tools/linker/Tests/mscorlib/test-remoting.cs:11
[ERROR] FATAL UNHANDLED EXCEPTION: System.NotSupportedException: Linked away.
at (wrapper managed-to-native) System.Object.__icall_wrapper_ves_icall_object_new_specific(intptr)
at C.Main () [0x00001] in /Users/rodo/git/mono/mcs/tools/linker/Tests/mscorlib/test-remoting.cs:11
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/corlib/LinkerDescriptor/mscorlib.xml | 5 | ||||
-rw-r--r-- | mcs/tools/linker/Makefile | 3 | ||||
-rw-r--r-- | mcs/tools/linker/Tests/mscorlib/test-remoting.cs | 14 |
3 files changed, 21 insertions, 1 deletions
diff --git a/mcs/class/corlib/LinkerDescriptor/mscorlib.xml b/mcs/class/corlib/LinkerDescriptor/mscorlib.xml index c5028d47423..68786da22a0 100644 --- a/mcs/class/corlib/LinkerDescriptor/mscorlib.xml +++ b/mcs/class/corlib/LinkerDescriptor/mscorlib.xml @@ -745,6 +745,11 @@ <!-- domain.c: mono_defaults.transparent_proxy_class / removed with DISABLE_REMOTING --> <type fullname="System.Runtime.Remoting.Proxies.TransparentProxy" feature="remoting" /> + <!-- object.c: mono_object_new_specific_checked --> + <type fullname="System.Runtime.Remoting.Activation.ActivationServices" > + <method name="CreateProxyForType"/> + </type> + <!-- exception.c (mono_get_exception_serialization) --> <type fullname="System.Runtime.Serialization.SerializationException"> <!-- mono_exception_from_name_msg --> diff --git a/mcs/tools/linker/Makefile b/mcs/tools/linker/Makefile index 6823765ffd3..b1bfdd18565 100644 --- a/mcs/tools/linker/Makefile +++ b/mcs/tools/linker/Makefile @@ -7,7 +7,8 @@ PROGRAM = monolinker.exe LIB_REFS = System System.Core System.Xml Mono.Cecil TEST_CASES = \ - mscorlib/test-array.cs + mscorlib/test-array.cs \ + mscorlib/test-remoting.cs ifndef AOT_FRIENDLY_PROFILE TEST_CASES += \ diff --git a/mcs/tools/linker/Tests/mscorlib/test-remoting.cs b/mcs/tools/linker/Tests/mscorlib/test-remoting.cs new file mode 100644 index 00000000000..9c1079ed6ca --- /dev/null +++ b/mcs/tools/linker/Tests/mscorlib/test-remoting.cs @@ -0,0 +1,14 @@ +using System; + +public class MyObject : ContextBoundObject +{ +} + +public class C +{ + public static int Main () + { + var context = new MyObject (); + return 0; + } +} |