generic: 6.1: fixup QCA807x upstream PHY
[openwrt/openwrt.git] / target / linux / generic / pending-6.1 / 203-kallsyms_uncompressed.patch
index 930d0ff0fe426d50bc796e44905b2ea42e9cbc3e..ce93b73af64e09b4eae9b2a2b57dacec7b93e2e1 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/init/Kconfig
 +++ b/init/Kconfig
-@@ -1447,6 +1447,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
+@@ -1482,6 +1482,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
          the unaligned access emulation.
          see arch/parisc/kernel/unaligned.c for reference
  
@@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
 --- a/kernel/kallsyms.c
 +++ b/kernel/kallsyms.c
-@@ -80,6 +80,11 @@ static unsigned int kallsyms_expand_symb
+@@ -69,6 +69,11 @@ static unsigned int kallsyms_expand_symb
         * For every byte on the compressed symbol data, copy the table
         * entry for that byte.
         */
@@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        while (len) {
                tptr = &kallsyms_token_table[kallsyms_token_index[*data]];
                data++;
-@@ -112,6 +117,9 @@ tail:
+@@ -101,6 +106,9 @@ tail:
   */
  static char kallsyms_get_symbol_type(unsigned int off)
  {
@@ -57,17 +57,17 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
         * and return the first char from this token.
 --- a/scripts/kallsyms.c
 +++ b/scripts/kallsyms.c
-@@ -58,6 +58,7 @@ static struct addr_range percpu_range =
+@@ -77,6 +77,7 @@ static struct addr_range percpu_range =
  static struct sym_entry **table;
  static unsigned int table_size, table_cnt;
  static int all_symbols;
 +static int uncompressed;
  static int absolute_percpu;
  static int base_relative;
-@@ -486,6 +487,9 @@ static void write_src(void)
-       free(markers);
+ static int lto_clang;
+@@ -608,6 +609,9 @@ static void write_src(void)
+                       (unsigned char)(table[i]->seq >> 0));
+       printf("\n");
  
 +      if (uncompressed)
 +              return;
@@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        output_label("kallsyms_token_table");
        off = 0;
        for (i = 0; i < 256; i++) {
-@@ -537,6 +541,9 @@ static unsigned char *find_token(unsigne
+@@ -659,6 +663,9 @@ static unsigned char *find_token(unsigne
  {
        int i;
  
@@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        for (i = 0; i < len - 1; i++) {
                if (str[i] == token[0] && str[i+1] == token[1])
                        return &str[i];
-@@ -609,6 +616,9 @@ static void optimize_result(void)
+@@ -731,6 +738,9 @@ static void optimize_result(void)
  {
        int i, best;
  
@@ -95,25 +95,24 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        /* using the '\0' symbol last allows compress_symbols to use standard
         * fast string functions */
        for (i = 255; i >= 0; i--) {
-@@ -773,6 +783,8 @@ int main(int argc, char **argv)
-                               absolute_percpu = 1;
-                       else if (strcmp(argv[i], "--base-relative") == 0)
-                               base_relative = 1;
-+                      else if (strcmp(argv[i], "--uncompressed") == 0)
-+                              uncompressed = 1;
-                       else
-                               usage();
-               }
+@@ -892,6 +902,7 @@ int main(int argc, char **argv)
+                       {"absolute-percpu", no_argument, &absolute_percpu, 1},
+                       {"base-relative",   no_argument, &base_relative,   1},
+                       {"lto-clang",       no_argument, &lto_clang,       1},
++                      {"uncompressed",   no_argument, &uncompressed,   1},
+                       {},
+               };
 --- a/scripts/link-vmlinux.sh
 +++ b/scripts/link-vmlinux.sh
-@@ -257,6 +257,10 @@ kallsyms()
-               kallsymopt="${kallsymopt} --base-relative"
+@@ -160,6 +160,10 @@ kallsyms()
+               kallsymopt="${kallsymopt} --lto-clang"
        fi
  
-+      if [ -n "${CONFIG_KALLSYMS_UNCOMPRESSED}" ]; then
++      if is_enabled CONFIG_KALLSYMS_UNCOMPRESSED; then
 +              kallsymopt="${kallsymopt} --uncompressed"
 +      fi
 +
        info KSYMS ${2}
-       ${NM} -n ${1} | scripts/kallsyms ${kallsymopt} > ${2}
+       scripts/kallsyms ${kallsymopt} ${1} > ${2}
  }