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>
This commit is contained in:
parent
d7afd65b4a
commit
ddc54f912a
|
|
@ -750,6 +750,7 @@ static void process_enumerator_type(struct state *state, struct die *cache,
|
||||||
Dwarf_Die *die)
|
Dwarf_Die *die)
|
||||||
{
|
{
|
||||||
bool overridden = false;
|
bool overridden = false;
|
||||||
|
unsigned long override;
|
||||||
Dwarf_Word value;
|
Dwarf_Word value;
|
||||||
|
|
||||||
if (stable) {
|
if (stable) {
|
||||||
|
|
@ -761,7 +762,8 @@ static void process_enumerator_type(struct state *state, struct die *cache,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
overridden = kabi_get_enumerator_value(
|
overridden = kabi_get_enumerator_value(
|
||||||
state->expand.current_fqn, cache->fqn, &value);
|
state->expand.current_fqn, cache->fqn, &override);
|
||||||
|
value = override;
|
||||||
}
|
}
|
||||||
|
|
||||||
process_list_comma(state, cache);
|
process_list_comma(state, cache);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
* Copyright (C) 2024 Google LLC
|
* Copyright (C) 2024 Google LLC
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
#include "gendwarfksyms.h"
|
#include "gendwarfksyms.h"
|
||||||
|
|
||||||
#define SYMBOL_HASH_BITS 12
|
#define SYMBOL_HASH_BITS 12
|
||||||
|
|
@ -242,7 +243,7 @@ static void elf_for_each_global(int fd, elf_symbol_callback_t func, void *arg)
|
||||||
error("elf_getdata failed: %s", elf_errmsg(-1));
|
error("elf_getdata failed: %s", elf_errmsg(-1));
|
||||||
|
|
||||||
if (shdr->sh_entsize != sym_size)
|
if (shdr->sh_entsize != sym_size)
|
||||||
error("expected sh_entsize (%lu) to be %zu",
|
error("expected sh_entsize (%" PRIu64 ") to be %zu",
|
||||||
shdr->sh_entsize, sym_size);
|
shdr->sh_entsize, sym_size);
|
||||||
|
|
||||||
nsyms = shdr->sh_size / shdr->sh_entsize;
|
nsyms = shdr->sh_size / shdr->sh_entsize;
|
||||||
|
|
@ -292,7 +293,7 @@ static void set_symbol_addr(struct symbol *sym, void *arg)
|
||||||
hash_add(symbol_addrs, &sym->addr_hash,
|
hash_add(symbol_addrs, &sym->addr_hash,
|
||||||
symbol_addr_hash(&sym->addr));
|
symbol_addr_hash(&sym->addr));
|
||||||
|
|
||||||
debug("%s -> { %u, %lx }", sym->name, sym->addr.section,
|
debug("%s -> { %u, %" PRIx64 " }", sym->name, sym->addr.section,
|
||||||
sym->addr.address);
|
sym->addr.address);
|
||||||
} else if (sym->addr.section != addr->section ||
|
} else if (sym->addr.section != addr->section ||
|
||||||
sym->addr.address != addr->address) {
|
sym->addr.address != addr->address) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue