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.
Showing the changes to scripts (2 of 2 files). Show all
Unified · Split
| @@ -750,6 +750,7 @@ static void process_enumerator_type(struct state *state, struct die *cache, · 749 unmodified lines | ||
| 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) { |
| @@ -761,7 +762,8 @@ static void process_enumerator_type(struct state *state, struct die *cache, · 5 unmodified lines | ||
| 761 | 762 | return; |
| 762 | 763 | |
| 763 | 764 | overridden = kabi_get_enumerator_value( |
| 764 | − state->expand.current_fqn, cache->fqn, &value); | |
| 765 | + state->expand.current_fqn, cache->fqn, &override); | |
| 766 | + value = override; | |
| 765 | 767 | } |
| 766 | 768 | |
| 767 | 769 | process_list_comma(state, cache); |
| @@ -3,6 +3,7 @@ · 2 unmodified lines | ||
| 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 |
| @@ -242,7 +243,7 @@ static void elf_for_each_global(int fd, elf_symbol_callback_t func, void *arg) · 233 unmodified lines | ||
| 242 | 243 | error("elf_getdata failed: %s", elf_errmsg(-1)); |
| 243 | 244 | |
| 244 | 245 | if (shdr->sh_entsize != sym_size) |
| 245 | − error("expected sh_entsize (%lu) to be %zu", | |
| 246 | + error("expected sh_entsize (%" PRIu64 ") to be %zu", | |
| 246 | 247 | shdr->sh_entsize, sym_size); |
| 247 | 248 | |
| 248 | 249 | nsyms = shdr->sh_size / shdr->sh_entsize; |
| @@ -292,7 +293,7 @@ static void set_symbol_addr(struct symbol *sym, void *arg) · 43 unmodified lines | ||
| 292 | 293 | hash_add(symbol_addrs, &sym->addr_hash, |
| 293 | 294 | symbol_addr_hash(&sym->addr)); |
| 294 | 295 | |
| 295 | − debug("%s -> { %u, %lx }", sym->name, sym->addr.section, | |
| 296 | + debug("%s -> { %u, %" PRIx64 " }", sym->name, sym->addr.section, | |
| 296 | 297 | sym->addr.address); |
| 297 | 298 | } else if (sym->addr.section != addr->section || |
| 298 | 299 | sym->addr.address != addr->address) { |