Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gendwarfksyms: Fix build on 32-bit hosts

We have interchangeably used unsigned long for some of the types
defined in elfutils, assuming they're always 64-bit. This obviously
fails when building gendwarfksyms on 32-bit hosts. Fix the types.

Reported-by: Michal Suchánek <msuchanek@suse.de>
Closes: https://lore.kernel.org/linux-modules/aRcxzPxtJblVSh1y@kitsune.suse.cz/
Tested-by: Michal Suchánek <msuchanek@suse.de>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>

+6 -3
+3 -1
scripts/gendwarfksyms/dwarf.c
··· 750 750 Dwarf_Die *die) 751 751 { 752 752 bool overridden = false; 753 + unsigned long override; 753 754 Dwarf_Word value; 754 755 755 756 if (stable) { ··· 762 761 return; 763 762 764 763 overridden = kabi_get_enumerator_value( 765 - state->expand.current_fqn, cache->fqn, &value); 764 + state->expand.current_fqn, cache->fqn, &override); 765 + value = override; 766 766 } 767 767 768 768 process_list_comma(state, cache);
+3 -2
scripts/gendwarfksyms/symbols.c
··· 3 3 * Copyright (C) 2024 Google LLC 4 4 */ 5 5 6 + #include <inttypes.h> 6 7 #include "gendwarfksyms.h" 7 8 8 9 #define SYMBOL_HASH_BITS 12 ··· 243 242 error("elf_getdata failed: %s", elf_errmsg(-1)); 244 243 245 244 if (shdr->sh_entsize != sym_size) 246 - error("expected sh_entsize (%lu) to be %zu", 245 + error("expected sh_entsize (%" PRIu64 ") to be %zu", 247 246 shdr->sh_entsize, sym_size); 248 247 249 248 nsyms = shdr->sh_size / shdr->sh_entsize; ··· 293 292 hash_add(symbol_addrs, &sym->addr_hash, 294 293 symbol_addr_hash(&sym->addr)); 295 294 296 - debug("%s -> { %u, %lx }", sym->name, sym->addr.section, 295 + debug("%s -> { %u, %" PRIx64 " }", sym->name, sym->addr.section, 297 296 sym->addr.address); 298 297 } else if (sym->addr.section != addr->section || 299 298 sym->addr.address != addr->address) {