Merge "Don't re-export libgcc symbols from every object."
diff --git a/core/config.mk b/core/config.mk
index e7a1d20..3477ec8 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -586,6 +586,11 @@
 TARGET_GLOBAL_CFLAGS += $(TARGET_RELEASE_CFLAGS)
 TARGET_GLOBAL_CPPFLAGS += $(TARGET_RELEASE_CPPFLAGS)
 
+# Target modules shouldn't re-export libgcc.a because we don't want other
+# binaries importing them when they should be getting their own copy of the
+# builtins.
+TARGET_GLOBAL_LDFLAGS += -Wl,--exclude-libs,libgcc.a
+
 ifdef TARGET_2ND_ARCH
 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS)
 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS)