[PATCH 3/3] arm: do section garbage collection also with modules enabled

Lucas Stach l.stach at pengutronix.de
Wed Dec 17 02:58:21 PST 2014


A lot of the arm build (especially PBL stuff) depends on section
garbage collection to be enabled. If it is disabled a lot of targets fail
to link properly. If module support is enabled garbage collection was
disabled on the premise that we throw away too many function which may be
needed in later modules.

The proper way to keep the functions around for use in modules, which
already works, is to annotate them with EXPORT_SYMBOL.

As module support is still marked as experimental I think it's reasonable
to expect users to make sure all symbols that are used by their modules
are properly annotated.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
 arch/arm/Makefile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index cf81c9c08332..193f731e9039 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -105,11 +105,9 @@ TEXT_BASE = $(CONFIG_TEXT_BASE)
 
 CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
 
-ifndef CONFIG_MODULES
 # Add cleanup flags
 CPPFLAGS += -fdata-sections -ffunction-sections
 LDFLAGS_barebox += -static --gc-sections
-endif
 
 ifdef CONFIG_RELOCATABLE
 LDFLAGS_barebox += -pie
-- 
2.1.3




More information about the barebox mailing list