xamarin-macios/tools/linker
Rolf Bjarne Kvinge b2bcad7a94
Add a BindingImpl attribute and use to to teach the linker look for it to search for optimizable code. (#3299)
* [ObjCRuntime] Add a BindingImplAttribute.

* [linker] Make ProviderToString an extension method on ICustomAttributeProvider to make it more discoverable.

* [generator] Use [BindingImpl] instead of [CompilerGenerated].

The entire diff is big (89MB), so it can't be gisted. However, most of it is
either removal of `using System.Runtime.CompilerServices;` or the change from
`[CompilerGenerated]` to `[BindingImpl (...)]` like this:
https://gist.github.com/rolfbjarne/8bfda3ed37b956d0342a1c1e9b079244

If I remove those parts of the diff, there's nothing significant left:
https://gist.github.com/rolfbjarne/4156164d6bdb1376366200394eb8a091

* [linker] Teach the linker about the new [BindingImpl] attribute.

In addition to the existing logic where the linker would optimize some
[CompilerGenerated] code (sometimes with additional requirements), it will now
also optimize all [BindingImpl (Optimizable)] code (without any additional
requirements).

* [tests] Add tests to make sure [BindingImpl (Optimizable)] works as expected.

* [linker] Check for [BindingImpl] before [CompilerGenerated] and stop checking for [CompilerGenerated] in XAMCORE_4_0.

Check for [BindingImpl] before checking for [CompilerGenerated], since the
former is more common.

Also stop checking for [CompilerGenerated] (at least to mean that code is
optimizable) in our next non-compatible evolutionary leap (XAMCORE_4_0):

* [introspection] Impl a better typo check.
2018-01-26 18:38:23 +01:00
..
Descriptors [linker] Update mscorlib.xml to preserve generic collection interfaces. Fixes #50290 (#1384) (#1427) 2017-01-03 13:03:29 -05:00
MonoTouch.Tuner Add a BindingImpl attribute and use to to teach the linker look for it to search for optimizable code. (#3299) 2018-01-26 18:38:23 +01:00
ApplyPreserveAttribute.cs [linker] Remove static state, and put the state inside DerivedLinkContext instead. (#1657) 2017-02-10 07:45:42 +01:00
BaseProfile.cs Build mmp. 2016-04-24 14:47:26 -04:00
ChangeLog Build mmp. 2016-04-24 14:47:26 -04:00
CoreHttpMessageHandler.cs [linker] Update BaseSubStep subclasses to use ExceptionalSubStep (#1507) 2017-01-16 11:42:41 -05:00
CoreMarkStep.cs Add a BindingImpl attribute and use to to teach the linker look for it to search for optimizable code. (#3299) 2018-01-26 18:38:23 +01:00
CoreOptimizeGeneratedCode.cs Add a BindingImpl attribute and use to to teach the linker look for it to search for optimizable code. (#3299) 2018-01-26 18:38:23 +01:00
CorePreserveCode.cs Build mmp. 2016-04-24 14:47:26 -04:00
CoreRemoveAttributes.cs Add a BindingImpl attribute and use to to teach the linker look for it to search for optimizable code. (#3299) 2018-01-26 18:38:23 +01:00
CoreRemoveSecurity.cs Build mmp. 2016-04-24 14:47:26 -04:00
ExceptionalSubStep.cs [linker] Remove static state, and put the state inside DerivedLinkContext instead. (#1657) 2017-02-10 07:45:42 +01:00
MarkNSObjects.cs [linker] Remove static state, and put the state inside DerivedLinkContext instead. (#1657) 2017-02-10 07:45:42 +01:00
MobileExtensions.cs Add a BindingImpl attribute and use to to teach the linker look for it to search for optimizable code. (#3299) 2018-01-26 18:38:23 +01:00
MobileMarkStep.cs [linker] Use correct namespace for async debugging helpers. Fixes #59015 (#2782) (#2788) 2017-09-27 11:15:22 -04:00
MobileProfile.cs [Do not merge yet] Update to mono 2017-04 branch (#1960) 2017-05-29 18:39:29 +02:00
MobileRemoveAttributes.cs Build mmp. 2016-04-24 14:47:26 -04:00
MobileResolveMainAssemblyStep.cs [linker] Don't mark public types from product assemblies when in embeddinator mode. 2017-04-19 11:39:06 +02:00
MobileSweepStep.cs [linker] Remove method the base class now has. (#2439) 2017-08-08 08:46:03 -04:00
ObjCExtensions.cs [linker] Improve inlining of IsDirectBinding check to inline both true and false values. (#3214) 2018-01-15 12:28:34 +01:00
README.linker Build mmp. 2016-04-24 14:47:26 -04:00
RemoveSelectors.cs [macos][mmp] Fix RemoveSelectors when generics are used, Fix #55693 (#2104) 2017-05-18 08:45:23 -04:00
RemoveUserResourcesSubStep.cs [mtouch][mmp] Unify user resources removal as a link step (#1026) 2016-11-01 13:11:25 -04:00

README.linker

README.linker

Q: Why some stuff is not linked out ?

A: In most case this is because:
	a) the BCL uses it internally
	b) the mono runtime depends on the type, methods, class layout


= mscorlib.dll =

System.Security.PermissionSet
	* Assembly has (3) fields of that type
	* mscorlib.xml preserve all fields from Assembly (object-internals.h)
	* code is "stubified" by the linker
System.Security.Policy.ApplicationTrust: 
	* Used as a field in AppDomainSetup;
	* Field also exists in unmanaged code (domain-internals.h);
	* mscorlib.xml preserve all fields from AppDomainSetup
	* only the default .ctor remains and is stubified by the linker
System.Security.Policy.Evidence
	* Used by AppDomain.Load[Assembly]
	* Used by Assembly.LoadWithPartialName overloads
	* code is "stubified" by the linker


= System.dll =

System.Text.RegularExpressions.*
	* Included because there is 2 regex in UriParser