kernel: add missing symbol for 4.4
[openwrt.git] / target / linux / generic / patches-3.18 / 220-gc_sections.patch
index 86727f1..775e11c 100644 (file)
@@ -1,6 +1,6 @@
 From: Felix Fietkau <nbd@openwrt.org>
 
 From: Felix Fietkau <nbd@openwrt.org>
 
-use -ffunction-sections, -fdata-sections and --gc-sections --sort-section=name
+use -ffunction-sections, -fdata-sections and --gc-sections
 
 In combination with kernel symbol export stripping this significantly reduces
 the kernel image size. Used on both ARM and MIPS architectures.
 
 In combination with kernel symbol export stripping this significantly reduces
 the kernel image size. Used on both ARM and MIPS architectures.
@@ -17,7 +17,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  cflags-y                      += -G 0 -mno-abicalls -fno-pic -pipe
  cflags-y                      += -msoft-float
 -LDFLAGS_vmlinux                       += -G 0 -static -n -nostdlib
  cflags-y                      += -G 0 -mno-abicalls -fno-pic -pipe
  cflags-y                      += -msoft-float
 -LDFLAGS_vmlinux                       += -G 0 -static -n -nostdlib
-+LDFLAGS_vmlinux                       += -G 0 -static -n -nostdlib --gc-sections --sort-section=name
++LDFLAGS_vmlinux                       += -G 0 -static -n -nostdlib --gc-sections
  KBUILD_AFLAGS_MODULE          += -mlong-calls
  KBUILD_CFLAGS_MODULE          += -mlong-calls
  
  KBUILD_AFLAGS_MODULE          += -mlong-calls
  KBUILD_CFLAGS_MODULE          += -mlong-calls
  
@@ -25,9 +25,9 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
 +KBUILD_CFLAGS_KERNEL          += -ffunction-sections -fdata-sections
 +endif
 +
 +KBUILD_CFLAGS_KERNEL          += -ffunction-sections -fdata-sections
 +endif
 +
- cflags-y += -ffreestanding
  #
  #
+ # pass -msoft-float to GAS if it supports it.  However on newer binutils
+ # (specifically newer than 2.24.51.20140728) we then also need to explicitly
 --- a/arch/mips/kernel/vmlinux.lds.S
 +++ b/arch/mips/kernel/vmlinux.lds.S
 @@ -67,7 +67,7 @@ SECTIONS
 --- a/arch/mips/kernel/vmlinux.lds.S
 +++ b/arch/mips/kernel/vmlinux.lds.S
 @@ -67,7 +67,7 @@ SECTIONS
@@ -77,6 +77,15 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                                VMLINUX_SYMBOL(__stop_branch_profile) = .;
  #else
  #define BRANCH_PROFILE()
                                VMLINUX_SYMBOL(__stop_branch_profile) = .;
  #else
  #define BRANCH_PROFILE()
+@@ -114,7 +114,7 @@
+ #ifdef CONFIG_KPROBES
+ #define KPROBE_BLACKLIST()    . = ALIGN(8);                                 \
+                               VMLINUX_SYMBOL(__start_kprobe_blacklist) = .; \
+-                              *(_kprobe_blacklist)                          \
++                              KEEP(*(_kprobe_blacklist))                    \
+                               VMLINUX_SYMBOL(__stop_kprobe_blacklist) = .;
+ #else
+ #define KPROBE_BLACKLIST()
 @@ -123,7 +123,7 @@
  #ifdef CONFIG_EVENT_TRACING
  #define FTRACE_EVENTS()       . = ALIGN(8);                                   \
 @@ -123,7 +123,7 @@
  #ifdef CONFIG_EVENT_TRACING
  #define FTRACE_EVENTS()       . = ALIGN(8);                                   \
@@ -328,6 +337,15 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
                *(COMMON)                                               \
        }
  
                *(COMMON)                                               \
        }
  
+@@ -592,7 +593,7 @@
+       . = ALIGN(8);                                                   \
+       __bug_table : AT(ADDR(__bug_table) - LOAD_OFFSET) {             \
+               VMLINUX_SYMBOL(__start___bug_table) = .;                \
+-              *(__bug_table)                                          \
++              KEEP(*(__bug_table))                                    \
+               VMLINUX_SYMBOL(__stop___bug_table) = .;                 \
+       }
+ #else
 @@ -604,7 +605,7 @@
        . = ALIGN(4);                                                   \
        .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {               \
 @@ -604,7 +605,7 @@
        . = ALIGN(4);                                                   \
        .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {               \
@@ -391,7 +409,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  LDFLAGS_vmlinux       += --be8
  LDFLAGS_MODULE        += --be8
  endif
  LDFLAGS_vmlinux       += --be8
  LDFLAGS_MODULE        += --be8
  endif
-+LDFLAGS_vmlinux += --gc-sections --sort-section=name
++LDFLAGS_vmlinux += --gc-sections
  
  OBJCOPYFLAGS  :=-O binary -R .comment -S
  GZFLAGS               :=-9
  
  OBJCOPYFLAGS  :=-O binary -R .comment -S
  GZFLAGS               :=-9