Pull Kbuild fixes from Masahiro Yamada: - Fix section mismatch warning messages for riscv and loongarch - Remove CONFIG_IA64 left-over from linux/export-internal.h - Fix the location of the quotes for UIMAGE_NAME - Fix a memory leak bug in Kconfig * tag 'kbuild-fixes-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: fix memory leak from range properties kbuild: Move the single quotes for image name linux/export: clean up the IA-64 KSYM_FUNC macro modpost: fix section mismatch message for RELA
Unified · Split
| @@ -50,9 +50,7 @@ · 49 unmodified lines | |||
| 50 | " .previous" "\n" \ | 50 | " .previous" "\n" \ |
| 51 | ) | 51 | ) |
| 52 | 52 | ||
| 53 | #ifdef CONFIG_IA64 | 53 | #if defined(CONFIG_PARISC) && defined(CONFIG_64BIT) |
| 54 | #define KSYM_FUNC(name) @fptr(name) | ||
| 55 | #elif defined(CONFIG_PARISC) && defined(CONFIG_64BIT) | ||
| 56 | #define KSYM_FUNC(name) P%name | 54 | #define KSYM_FUNC(name) P%name |
| 57 | #else | 55 | #else |
| 58 | #define KSYM_FUNC(name) name | 56 | #define KSYM_FUNC(name) name |
| @@ -487,14 +487,14 @@ UIMAGE_OPTS-y ?= · 486 unmodified lines | |||
| 487 | UIMAGE_TYPE ?= kernel | 487 | UIMAGE_TYPE ?= kernel |
| 488 | UIMAGE_LOADADDR ?= arch_must_set_this | 488 | UIMAGE_LOADADDR ?= arch_must_set_this |
| 489 | UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) | 489 | UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) |
| 490 | UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' | 490 | UIMAGE_NAME ?= Linux-$(KERNELRELEASE) |
| 491 | 491 | ||
| 492 | quiet_cmd_uimage = UIMAGE $@ | 492 | quiet_cmd_uimage = UIMAGE $@ |
| 493 | cmd_uimage = $(BASH) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \ | 493 | cmd_uimage = $(BASH) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \ |
| 494 | -C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \ | 494 | -C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \ |
| 495 | -T $(UIMAGE_TYPE) \ | 495 | -T $(UIMAGE_TYPE) \ |
| 496 | -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \ | 496 | -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \ |
| 497 | -n $(UIMAGE_NAME) -d $< $@ | 497 | -n '$(UIMAGE_NAME)' -d $< $@ |
| 498 | 498 | ||
| 499 | # XZ | 499 | # XZ |
| 500 | # --------------------------------------------------------------------------- | 500 | # --------------------------------------------------------------------------- |
| @@ -122,9 +122,9 @@ static long long sym_get_range_val(struct symbol *sym, int base) · 121 unmodified lines | |||
| 122 | static void sym_validate_range(struct symbol *sym) | 122 | static void sym_validate_range(struct symbol *sym) |
| 123 | { | 123 | { |
| 124 | struct property *prop; | 124 | struct property *prop; |
| 125 | struct symbol *range_sym; | ||
| 125 | int base; | 126 | int base; |
| 126 | long long val, val2; | 127 | long long val, val2; |
| 127 | char str[64]; | ||
| 128 | 128 | ||
| 129 | switch (sym->type) { | 129 | switch (sym->type) { |
| 130 | case S_INT: | 130 | case S_INT: |
| @@ -140,17 +140,15 @@ static void sym_validate_range(struct symbol *sym) · 9 unmodified lines | |||
| 140 | if (!prop) | 140 | if (!prop) |
| 141 | return; | 141 | return; |
| 142 | val = strtoll(sym->curr.val, NULL, base); | 142 | val = strtoll(sym->curr.val, NULL, base); |
| 143 | val2 = sym_get_range_val(prop->expr->left.sym, base); | 143 | range_sym = prop->expr->left.sym; |
| 144 | val2 = sym_get_range_val(range_sym, base); | ||
| 144 | if (val >= val2) { | 145 | if (val >= val2) { |
| 145 | val2 = sym_get_range_val(prop->expr->right.sym, base); | 146 | range_sym = prop->expr->right.sym; |
| 147 | val2 = sym_get_range_val(range_sym, base); | ||
| 146 | if (val <= val2) | 148 | if (val <= val2) |
| 147 | return; | 149 | return; |
| 148 | } | 150 | } |
| 149 | if (sym->type == S_INT) | 151 | sym->curr.val = range_sym->curr.val; |
| 150 | sprintf(str, "%lld", val2); | ||
| 151 | else | ||
| 152 | sprintf(str, "0x%llx", val2); | ||
| 153 | sym->curr.val = xstrdup(str); | ||
| 154 | } | 152 | } |
| 155 | 153 | ||
| 156 | static void sym_set_changed(struct symbol *sym) | 154 | static void sym_set_changed(struct symbol *sym) |
| @@ -1383,13 +1383,15 @@ static void section_rela(struct module *mod, struct elf_info *elf, · 1382 unmodified lines | |||
| 1383 | const Elf_Rela *rela; | 1383 | const Elf_Rela *rela; |
| 1384 | 1384 | ||
| 1385 | for (rela = start; rela < stop; rela++) { | 1385 | for (rela = start; rela < stop; rela++) { |
| 1386 | Elf_Sym *tsym; | ||
| 1386 | Elf_Addr taddr, r_offset; | 1387 | Elf_Addr taddr, r_offset; |
| 1387 | unsigned int r_type, r_sym; | 1388 | unsigned int r_type, r_sym; |
| 1388 | 1389 | ||
| 1389 | r_offset = TO_NATIVE(rela->r_offset); | 1390 | r_offset = TO_NATIVE(rela->r_offset); |
| 1390 | get_rel_type_and_sym(elf, rela->r_info, &r_type, &r_sym); | 1391 | get_rel_type_and_sym(elf, rela->r_info, &r_type, &r_sym); |
| 1391 | 1392 | ||
| 1392 | taddr = TO_NATIVE(rela->r_addend); | 1393 | tsym = elf->symtab_start + r_sym; |
| 1394 | taddr = tsym->st_value + TO_NATIVE(rela->r_addend); | ||
| 1393 | 1395 | ||
| 1394 | switch (elf->hdr->e_machine) { | 1396 | switch (elf->hdr->e_machine) { |
| 1395 | case EM_RISCV: | 1397 | case EM_RISCV: |
| @@ -1404,7 +1406,7 @@ static void section_rela(struct module *mod, struct elf_info *elf, · 8 unmodified lines | |||
| 1404 | break; | 1406 | break; |
| 1405 | } | 1407 | } |
| 1406 | 1408 | ||
| 1407 | check_section_mismatch(mod, elf, elf->symtab_start + r_sym, | 1409 | check_section_mismatch(mod, elf, tsym, |
| 1408 | fsecndx, fromsec, r_offset, taddr); | 1410 | fsecndx, fromsec, r_offset, taddr); |
| 1409 | } | 1411 | } |
| 1410 | } | 1412 | } |