kernel: bump 5.15 to 5.15.155
[openwrt/staging/pepe2k.git] / target / linux / generic / hack-5.15 / 221-module_exports.patch
index 95aef8edf871d5d17024a1a67fab0c9b754a5e4d..8db0f7dac78c341ebfdb5b9c143a2bf7100d520b 100644 (file)
@@ -27,10 +27,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +#define SYMTAB_DISCARD_GPL
 +#endif
 +
- /* Align . to a 8 byte boundary equals to maximum function alignment. */
- #define ALIGN_FUNCTION()  . = ALIGN(8)
+ /* Align . function alignment. */
+ #define ALIGN_FUNCTION()  . = ALIGN(CONFIG_FUNCTION_ALIGNMENT)
  
-@@ -484,14 +494,14 @@
+@@ -485,14 +495,14 @@
        /* Kernel symbol table: Normal symbols */                       \
        __ksymtab         : AT(ADDR(__ksymtab) - LOAD_OFFSET) {         \
                __start___ksymtab = .;                                  \
@@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                __stop___ksymtab_gpl = .;                               \
        }                                                               \
                                                                        \
-@@ -511,7 +521,7 @@
+@@ -512,7 +522,7 @@
                                                                        \
        /* Kernel symbol table: strings */                              \
          __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) {       \
@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        }                                                               \
                                                                        \
        /* __*init sections */                                          \
-@@ -1018,6 +1028,8 @@
+@@ -1022,6 +1032,8 @@
  
  #define COMMON_DISCARDS                                                       \
        SANITIZER_DISCARDS                                              \
@@ -89,9 +89,33 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
            "__kstrtab_" #sym ":                                        \n"     \
            "   .asciz  \"" #sym "\"                                    \n"     \
            "__kstrtabns_" #sym ":                                      \n"     \
+--- a/include/asm-generic/export.h
++++ b/include/asm-generic/export.h
+@@ -26,6 +26,12 @@
+ #endif
+ .endm
++#ifdef MODULE
++#define __EXPORT_SUFFIX(name)
++#else
++#define __EXPORT_SUFFIX(name) + #name
++#endif
++
+ /*
+  * note on .section use: we specify progbits since usage of the "M" (SHF_MERGE)
+  * section flag requires it. Use '%progbits' instead of '@progbits' since the
+@@ -39,7 +45,7 @@
+ __ksymtab_\name:
+       __put \val, __kstrtab_\name
+       .previous
+-      .section __ksymtab_strings,"aMS",%progbits,1
++      .section __ksymtab_strings __EXPORT_SUFFIX(name),"aMS",%progbits,1
+ __kstrtab_\name:
+       .asciz "\name"
+       .previous
 --- a/scripts/Makefile.build
 +++ b/scripts/Makefile.build
-@@ -396,7 +396,7 @@ targets += $(real-dtb-y) $(lib-y) $(alwa
+@@ -397,7 +397,7 @@ targets += $(real-dtb-y) $(lib-y) $(alwa
  # Linker scripts preprocessor (.lds.S -> .lds)
  # ---------------------------------------------------------------------------
  quiet_cmd_cpp_lds_S = LDS     $@