kernel: bump 4.9 to 4.9.188
[openwrt/openwrt.git] / target / linux / generic / hack-4.9 / 220-gc_sections.patch
index 8eed08ea3d4643bd3997cb1a992e795c09a362bd..e795d666dfbf0dc678bd0e2c5ef28393f171f757 100644 (file)
@@ -21,9 +21,9 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
 
 --- a/Makefile
 +++ b/Makefile
-@@ -409,6 +409,11 @@ KBUILD_AFLAGS_MODULE  := -DMODULE
- KBUILD_CFLAGS_MODULE  := -DMODULE
- KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s)
+@@ -402,6 +402,11 @@ KBUILD_LDFLAGS_MODULE = -T $(srctree)/sc
+ GCC_PLUGINS_CFLAGS :=
+ CLANG_FLAGS :=
  
 +ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
 +KBUILD_CFLAGS_KERNEL  += $(call cc-option,-ffunction-sections,)
@@ -33,9 +33,9 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  # 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)
-@@ -633,11 +638,6 @@ KBUILD_CFLAGS     += $(call cc-disable-warni
- KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
- KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context)
+@@ -652,11 +657,6 @@ KBUILD_CFLAGS     += $(call cc-disable-warni
+ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
+ KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias)
  
 -ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
 -KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,)
@@ -171,7 +171,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
        .init.data : {
 --- a/arch/mips/Kconfig
 +++ b/arch/mips/Kconfig
-@@ -55,6 +55,7 @@ config MIPS
+@@ -56,6 +56,7 @@ config MIPS
        select CLONE_BACKWARDS
        select HAVE_DEBUG_STACKOVERFLOW
        select HAVE_CC_STACKPROTECTOR
@@ -201,7 +201,34 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  
 --- a/include/asm-generic/vmlinux.lds.h
 +++ b/include/asm-generic/vmlinux.lds.h
-@@ -114,7 +114,7 @@
+@@ -105,7 +105,7 @@
+ #ifdef CONFIG_FTRACE_MCOUNT_RECORD
+ #define MCOUNT_REC()  . = ALIGN(8);                           \
+                       VMLINUX_SYMBOL(__start_mcount_loc) = .; \
+-                      *(__mcount_loc)                         \
++                      KEEP(*(__mcount_loc))                   \
+                       VMLINUX_SYMBOL(__stop_mcount_loc) = .;
+ #else
+ #define MCOUNT_REC()
+@@ -113,7 +113,7 @@
+ #ifdef CONFIG_TRACE_BRANCH_PROFILING
+ #define LIKELY_PROFILE()      VMLINUX_SYMBOL(__start_annotated_branch_profile) = .; \
+-                              *(_ftrace_annotated_branch)                           \
++                              KEEP(*(_ftrace_annotated_branch))                     \
+                               VMLINUX_SYMBOL(__stop_annotated_branch_profile) = .;
+ #else
+ #define LIKELY_PROFILE()
+@@ -121,7 +121,7 @@
+ #ifdef CONFIG_PROFILE_ALL_BRANCHES
+ #define BRANCH_PROFILE()      VMLINUX_SYMBOL(__start_branch_profile) = .;   \
+-                              *(_ftrace_branch)                             \
++                              KEEP(*(_ftrace_branch))                       \
+                               VMLINUX_SYMBOL(__stop_branch_profile) = .;
+ #else
+ #define BRANCH_PROFILE()
+@@ -130,7 +130,7 @@
  #ifdef CONFIG_KPROBES
  #define KPROBE_BLACKLIST()    . = ALIGN(8);                                 \
                                VMLINUX_SYMBOL(__start_kprobe_blacklist) = .; \
@@ -210,7 +237,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                                VMLINUX_SYMBOL(__stop_kprobe_blacklist) = .;
  #else
  #define KPROBE_BLACKLIST()
-@@ -123,10 +123,10 @@
+@@ -139,10 +139,10 @@
  #ifdef CONFIG_EVENT_TRACING
  #define FTRACE_EVENTS()       . = ALIGN(8);                                   \
                        VMLINUX_SYMBOL(__start_ftrace_events) = .;      \
@@ -223,7 +250,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                        VMLINUX_SYMBOL(__stop_ftrace_enum_maps) = .;
  #else
  #define FTRACE_EVENTS()
-@@ -147,7 +147,7 @@
+@@ -163,7 +163,7 @@
  #ifdef CONFIG_FTRACE_SYSCALLS
  #define TRACE_SYSCALLS() . = ALIGN(8);                                        \
                         VMLINUX_SYMBOL(__start_syscalls_metadata) = .; \
@@ -232,16 +259,16 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                         VMLINUX_SYMBOL(__stop_syscalls_metadata) = .;
  #else
  #define TRACE_SYSCALLS()
-@@ -156,7 +156,7 @@
+@@ -172,7 +172,7 @@
  #ifdef CONFIG_SERIAL_EARLYCON
- #define EARLYCON_TABLE() STRUCT_ALIGN();                      \
+ #define EARLYCON_TABLE() . = ALIGN(8);                                \
                         VMLINUX_SYMBOL(__earlycon_table) = .;  \
 -                       *(__earlycon_table)                    \
 +                       KEEP(*(__earlycon_table))              \
                         VMLINUX_SYMBOL(__earlycon_table_end) = .;
  #else
  #define EARLYCON_TABLE()
-@@ -169,8 +169,8 @@
+@@ -185,8 +185,8 @@
  #define _OF_TABLE_1(name)                                             \
        . = ALIGN(8);                                                   \
        VMLINUX_SYMBOL(__##name##_of_table) = .;                        \
@@ -252,7 +279,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  
  #define CLKSRC_OF_TABLES()    OF_TABLE(CONFIG_CLKSRC_OF, clksrc)
  #define IRQCHIP_OF_MATCH_TABLE() OF_TABLE(CONFIG_IRQCHIP, irqchip)
-@@ -193,7 +193,7 @@
+@@ -209,7 +209,7 @@
  #define KERNEL_DTB()                                                  \
        STRUCT_ALIGN();                                                 \
        VMLINUX_SYMBOL(__dtb_start) = .;                                \
@@ -261,7 +288,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
        VMLINUX_SYMBOL(__dtb_end) = .;
  
  /*
-@@ -214,16 +214,17 @@
+@@ -227,16 +227,17 @@
        /* implement dynamic printk debug */                            \
        . = ALIGN(8);                                                   \
        VMLINUX_SYMBOL(__start___jump_table) = .;                       \
@@ -282,7 +309,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  
  /*
   * Data section helpers
-@@ -291,35 +292,35 @@
+@@ -304,35 +305,35 @@
        /* PCI quirks */                                                \
        .pci_fixup        : AT(ADDR(.pci_fixup) - LOAD_OFFSET) {        \
                VMLINUX_SYMBOL(__start_pci_fixups_early) = .;           \
@@ -327,7 +354,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                VMLINUX_SYMBOL(__end_builtin_fw) = .;                   \
        }                                                               \
                                                                        \
-@@ -397,7 +398,7 @@
+@@ -410,7 +411,7 @@
                                                                        \
        /* Kernel symbol table: strings */                              \
          __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) {       \
@@ -336,7 +363,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
        }                                                               \
                                                                        \
        /* __*init sections */                                          \
-@@ -410,14 +411,14 @@
+@@ -423,14 +424,14 @@
        /* Built-in module parameters. */                               \
        __param : AT(ADDR(__param) - LOAD_OFFSET) {                     \
                VMLINUX_SYMBOL(__start___param) = .;                    \
@@ -353,7 +380,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                VMLINUX_SYMBOL(__stop___modver) = .;                    \
                . = ALIGN((align));                                     \
                VMLINUX_SYMBOL(__end_rodata) = .;                       \
-@@ -482,7 +483,7 @@
+@@ -496,7 +497,7 @@
  #define ENTRY_TEXT                                                    \
                ALIGN_FUNCTION();                                       \
                VMLINUX_SYMBOL(__entry_text_start) = .;                 \
@@ -362,7 +389,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                VMLINUX_SYMBOL(__entry_text_end) = .;
  
  #if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
-@@ -520,7 +521,7 @@
+@@ -534,7 +535,7 @@
        . = ALIGN(align);                                               \
        __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {               \
                VMLINUX_SYMBOL(__start___ex_table) = .;                 \
@@ -371,7 +398,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                VMLINUX_SYMBOL(__stop___ex_table) = .;                  \
        }
  
-@@ -536,9 +537,9 @@
+@@ -550,9 +551,9 @@
  #ifdef CONFIG_CONSTRUCTORS
  #define KERNEL_CTORS()        . = ALIGN(8);                      \
                        VMLINUX_SYMBOL(__ctors_start) = .; \
@@ -383,7 +410,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                        VMLINUX_SYMBOL(__ctors_end) = .;
  #else
  #define KERNEL_CTORS()
-@@ -595,7 +596,7 @@
+@@ -609,7 +610,7 @@
  #define SBSS(sbss_align)                                              \
        . = ALIGN(sbss_align);                                          \
        .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) {                         \
@@ -392,7 +419,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                *(.scommon)                                             \
        }
  
-@@ -662,7 +663,7 @@
+@@ -676,7 +677,7 @@
        . = ALIGN(8);                                                   \
        __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) {             \
                VMLINUX_SYMBOL(__start___bug_table) = .;                \
@@ -401,7 +428,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                VMLINUX_SYMBOL(__stop___bug_table) = .;                 \
        }
  #else
-@@ -674,7 +675,7 @@
+@@ -688,7 +689,7 @@
        . = ALIGN(4);                                                   \
        .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {               \
                VMLINUX_SYMBOL(__tracedata_start) = .;                  \
@@ -410,7 +437,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                VMLINUX_SYMBOL(__tracedata_end) = .;                    \
        }
  #else
-@@ -691,7 +692,7 @@
+@@ -705,7 +706,7 @@
  #define INIT_SETUP(initsetup_align)                                   \
                . = ALIGN(initsetup_align);                             \
                VMLINUX_SYMBOL(__setup_start) = .;                      \