scummvm random work
[patches.git] / bfin-gc-sections.patch
CommitLineData
5e993f12 1--- arch/blackfin/Kconfig
2+++ arch/blackfin/Kconfig
3@@ -398,6 +398,14 @@ config I_ENTRY_L1
4 If enabled interrupt entry code (STORE/RESTORE CONTEXT) is linked
5 into L1 instruction memory.(less latency)
6
7+config GC_SECTIONS
8+ bool "Garbage collect unused functions and data"
9+ default n
10+ help
11+ Tell the compiler to place all functions and variables in their own
12+ sections and then tell the linker to discard any section that aren't
13+ referred to.
14+
15 endmenu
16
17
18--- arch/blackfin/Makefile
19+++ arch/blackfin/Makefile
20@@ -18,6 +18,12 @@ CFLAGS_MODULE += -mlong-calls
21 KALLSYMS += --symbol-prefix=_
22
23
24+ifdef CONFIG_GC_SECTIONS
25+CFLAGS += -ffunction-sections -fdata-sections
26+LINKFLAGS += --gc-sections
27+endif
28+
29+
30 # setup the machine name and the machine dependent settings
31 machine-$(CONFIG_BF531) := bf533
32 machine-$(CONFIG_BF532) := bf533