Upstream: Use core's facilities for disabling TOC

This is step 1, using it for most code paths
the rest are mentioned in todo

Change-Id: I9ff919b6b7c139da93398bfea7f9d0c1b6f44e4b
Merge "Upstream: Use core's facilities for disabling TOC"