aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/hack-5.4/220-gc_sections.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/generic/hack-5.4/220-gc_sections.patch')
-rw-r--r--target/linux/generic/hack-5.4/220-gc_sections.patch62
1 files changed, 3 insertions, 59 deletions
diff --git a/target/linux/generic/hack-5.4/220-gc_sections.patch b/target/linux/generic/hack-5.4/220-gc_sections.patch
index 77422e821b..fbac74c111 100644
--- a/target/linux/generic/hack-5.4/220-gc_sections.patch
+++ b/target/linux/generic/hack-5.4/220-gc_sections.patch
@@ -19,45 +19,19 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
include/asm-generic/vmlinux.lds.h | 63 ++++++++++++++++++++-------------------
7 files changed, 55 insertions(+), 51 deletions(-)
---- a/Makefile
-+++ b/Makefile
-@@ -294,6 +294,11 @@ else
- scripts/Kbuild.include: ;
- include scripts/Kbuild.include
-
-+ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
-+KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
-+LDFLAGS_vmlinux += --gc-sections
-+endif
-+
- # Read KERNELRELEASE from include/config/kernel.release (if it exists)
- KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
- KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
-@@ -782,11 +787,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH
- KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
- endif
-
--ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
--KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
--LDFLAGS_vmlinux += --gc-sections
--endif
--
- # arch Makefile may override CC so keep this after arch Makefile is included
- NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
-
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
-@@ -98,6 +98,7 @@ config ARM
+@@ -111,6 +111,7 @@ config ARM
select HAVE_UID16
select HAVE_VIRT_CPU_ACCOUNTING_GEN
select IRQ_FORCED_THREADING
+ select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
select MODULES_USE_ELF_REL
select NEED_DMA_MAP_STATE
- select NO_BOOTMEM
+ select OF_EARLY_FLATTREE if OF
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
-@@ -106,6 +106,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y)
+@@ -107,6 +107,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y)
ORIG_CFLAGS := $(KBUILD_CFLAGS)
KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
endif
@@ -160,33 +134,3 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
} \
. = __stubs_start + SIZEOF(.stubs); \
__stubs_end = .; \
---- a/arch/mips/Kconfig
-+++ b/arch/mips/Kconfig
-@@ -43,6 +43,7 @@ config MIPS
- select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
- select HAVE_CBPF_JIT if (!64BIT && !CPU_MICROMIPS)
- select HAVE_EBPF_JIT if (64BIT && !CPU_MICROMIPS)
-+ select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
- select HAVE_CONTEXT_TRACKING
- select HAVE_COPY_THREAD_TLS
- select HAVE_C_RECORDMCOUNT
---- a/arch/mips/kernel/vmlinux.lds.S
-+++ b/arch/mips/kernel/vmlinux.lds.S
-@@ -72,7 +72,7 @@ SECTIONS
- /* Exception table for data bus errors */
- __dbe_table : {
- __start___dbe_table = .;
-- *(__dbe_table)
-+ KEEP(*(__dbe_table))
- __stop___dbe_table = .;
- }
-
-@@ -123,7 +123,7 @@ SECTIONS
- . = ALIGN(4);
- .mips.machines.init : AT(ADDR(.mips.machines.init) - LOAD_OFFSET) {
- __mips_machines_start = .;
-- *(.mips.machines.init)
-+ KEEP(*(.mips.machines.init))
- __mips_machines_end = .;
- }
-