Add LOCAL_OVERRIDES_MODULES

LOCAL_OVERRIDES_MODULES is similar to LOCAL_OVERRIDES_PACKAGES, but is
for executables.

Bug: 36491275
Test: LOCAL_OVERRIDES_MODULES := foo should prevent a target executable
foo from being installed. If foo is not a target executable, error
should be reported.

Change-Id: I558f3d94105f9e319f8413c1290799f1c70ee131
diff --git a/core/main.mk b/core/main.mk
index 7433f90..68a6daf 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -759,6 +759,9 @@
   # Filter out the overridden packages before doing expansion
   product_MODULES := $(filter-out $(foreach p, $(product_MODULES), \
       $(PACKAGES.$(p).OVERRIDES)), $(product_MODULES))
+  # Filter out executables as well
+  product_MODULES := $(filter-out $(foreach m, $(product_MODULES), \
+      $(EXECUTABLES.$(m).OVERRIDES)), $(product_MODULES))
 
   # Resolve the :32 :64 module name
   modules_32 := $(patsubst %:32,%,$(filter %:32, $(product_MODULES)))