History

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.

Sami Tolvanen committed 12 months ago

Commit ddc54f91 parent d7afd652 files · +6 −3Browse files

Showing the changes to scripts (2 of 2 files). Show all

Unified · Split

2 files
  1. scripts/gendwarfksyms/dwarf.c +3 −1
  2. scripts/gendwarfksyms/symbols.c +3 −2
scripts/gendwarfksyms/dwarf.c+3−1
@@ -750,6 +750,7 @@ static void process_enumerator_type(struct state *state, struct die *cache, · 749 unmodified lines
750 Dwarf_Die *die)750 Dwarf_Die *die)
751{751{
752 bool overridden = false;752 bool overridden = false;
753 unsigned long override;
753 Dwarf_Word value;754 Dwarf_Word value;
754 755
755 if (stable) {756 if (stable) {
@@ -761,7 +762,8 @@ static void process_enumerator_type(struct state *state, struct die *cache, · 5 unmodified lines
761 return;762 return;
762 763
763 overridden = kabi_get_enumerator_value(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 process_list_comma(state, cache);769 process_list_comma(state, cache);
scripts/gendwarfksyms/symbols.c+3−2
@@ -3,6 +3,7 @@ · 2 unmodified lines
3 * Copyright (C) 2024 Google LLC3 * Copyright (C) 2024 Google LLC
4 */4 */
5 5
6#include <inttypes.h>
6#include "gendwarfksyms.h"7#include "gendwarfksyms.h"
7 8
8#define SYMBOL_HASH_BITS 129#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 error("elf_getdata failed: %s", elf_errmsg(-1));243 error("elf_getdata failed: %s", elf_errmsg(-1));
243 244
244 if (shdr->sh_entsize != sym_size)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 shdr->sh_entsize, sym_size);247 shdr->sh_entsize, sym_size);
247 248
248 nsyms = shdr->sh_size / shdr->sh_entsize;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 hash_add(symbol_addrs, &sym->addr_hash,293 hash_add(symbol_addrs, &sym->addr_hash,
293 symbol_addr_hash(&sym->addr));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 sym->addr.address);297 sym->addr.address);
297 } else if (sym->addr.section != addr->section ||298 } else if (sym->addr.section != addr->section ||
298 sym->addr.address != addr->address) {299 sym->addr.address != addr->address) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t