Skip to content

Commit

Permalink
Merge tag 'kbuild-fixes-v6.7' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/masahiroy/linux-kbuild

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
  • Loading branch information
torvalds committed Nov 19, 2023
2 parents 46a29dd + ae1eff0 commit eb3479b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
4 changes: 1 addition & 3 deletions include/linux/export-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@
" .previous" "\n" \
)

#ifdef CONFIG_IA64
#define KSYM_FUNC(name) @fptr(name)
#elif defined(CONFIG_PARISC) && defined(CONFIG_64BIT)
#if defined(CONFIG_PARISC) && defined(CONFIG_64BIT)
#define KSYM_FUNC(name) P%name
#else
#define KSYM_FUNC(name) name
Expand Down
4 changes: 2 additions & 2 deletions scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -487,14 +487,14 @@ UIMAGE_OPTS-y ?=
UIMAGE_TYPE ?= kernel
UIMAGE_LOADADDR ?= arch_must_set_this
UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR)
UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)'
UIMAGE_NAME ?= Linux-$(KERNELRELEASE)

quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(BASH) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \
-C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \
-T $(UIMAGE_TYPE) \
-a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \
-n $(UIMAGE_NAME) -d $< $@
-n '$(UIMAGE_NAME)' -d $< $@

# XZ
# ---------------------------------------------------------------------------
Expand Down
14 changes: 6 additions & 8 deletions scripts/kconfig/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ static long long sym_get_range_val(struct symbol *sym, int base)
static void sym_validate_range(struct symbol *sym)
{
struct property *prop;
struct symbol *range_sym;
int base;
long long val, val2;
char str[64];

switch (sym->type) {
case S_INT:
Expand All @@ -140,17 +140,15 @@ static void sym_validate_range(struct symbol *sym)
if (!prop)
return;
val = strtoll(sym->curr.val, NULL, base);
val2 = sym_get_range_val(prop->expr->left.sym, base);
range_sym = prop->expr->left.sym;
val2 = sym_get_range_val(range_sym, base);
if (val >= val2) {
val2 = sym_get_range_val(prop->expr->right.sym, base);
range_sym = prop->expr->right.sym;
val2 = sym_get_range_val(range_sym, base);
if (val <= val2)
return;
}
if (sym->type == S_INT)
sprintf(str, "%lld", val2);
else
sprintf(str, "0x%llx", val2);
sym->curr.val = xstrdup(str);
sym->curr.val = range_sym->curr.val;
}

static void sym_set_changed(struct symbol *sym)
Expand Down
6 changes: 4 additions & 2 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -1383,13 +1383,15 @@ static void section_rela(struct module *mod, struct elf_info *elf,
const Elf_Rela *rela;

for (rela = start; rela < stop; rela++) {
Elf_Sym *tsym;
Elf_Addr taddr, r_offset;
unsigned int r_type, r_sym;

r_offset = TO_NATIVE(rela->r_offset);
get_rel_type_and_sym(elf, rela->r_info, &r_type, &r_sym);

taddr = TO_NATIVE(rela->r_addend);
tsym = elf->symtab_start + r_sym;
taddr = tsym->st_value + TO_NATIVE(rela->r_addend);

switch (elf->hdr->e_machine) {
case EM_RISCV:
Expand All @@ -1404,7 +1406,7 @@ static void section_rela(struct module *mod, struct elf_info *elf,
break;
}

check_section_mismatch(mod, elf, elf->symtab_start + r_sym,
check_section_mismatch(mod, elf, tsym,
fsecndx, fromsec, r_offset, taddr);
}
}
Expand Down

0 comments on commit eb3479b

Please sign in to comment.