diff options
author | Alan Modra <amodra@gmail.com> | 2022-08-12 17:47:51 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-08-13 14:11:27 +0930 |
commit | 31e5a3a3807e7d5b43845d0d17ddfd1a8692752c (patch) | |
tree | 3fc68ca03ec7226ba6af6e92b60d79e0bb747d41 /binutils/readelf.c | |
parent | 625d49fce79d6154de07edc00b36335e7e7a0479 (diff) | |
download | binutils-31e5a3a3807e7d5b43845d0d17ddfd1a8692752c.zip binutils-31e5a3a3807e7d5b43845d0d17ddfd1a8692752c.tar.gz binutils-31e5a3a3807e7d5b43845d0d17ddfd1a8692752c.tar.bz2 |
Make dwarf_vma uint64_t
This replaces dwarf_vma, dwarf_size_type and dwarf_signed_vma with
uint64_t and int64_t everywhere. The patch also gets rid of
DWARF_VMA_FMT since we can't use that with uint64_t, and all of the
configure support for deciding the flavour of HOST_WIDEST_INT.
dwarf_vmatoa also disappears, replacing most uses with one of
PRIx64, PRId64 or PRIu64. Printing of size_t and ptrdiff_t values
now use %z and %t rather than by casting to unsigned long. Also,
most warning messages that used 0x%lx or similar now use %#lx and a
few that didn't print the 0x hex prefix now also use %#. The patch
doesn't change normal readelf output, except in odd cases where values
previously might have been truncated.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r-- | binutils/readelf.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c index dc571f9..1ec2523 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -13372,14 +13372,14 @@ display_lto_symtab (Filedata * filedata, unsigned int sym_type = * ext_data ++; unsigned int sec_kind = * ext_data ++; - printf (" %10s %10s %11s %08lx %08lx %9s %08lx _", + printf (" %10s %10s %11s %08" PRIx64 " %08" PRIx64 " %9s %08x _", * comdat_key == 0 ? "-" : (char *) comdat_key, get_lto_kind (kind), get_lto_visibility (visibility), - (long) size, - (long) slot, + size, + slot, get_lto_sym_type (sym_type), - (long) sec_kind); + sec_kind); print_symbol (6, (const char *) sym_name); } else @@ -13391,12 +13391,12 @@ display_lto_symtab (Filedata * filedata, } else { - printf (" %10s %10s %11s %08lx %08lx _", + printf (" %10s %10s %11s %08" PRIx64 " %08" PRIx64 " _", * comdat_key == 0 ? "-" : (char *) comdat_key, get_lto_kind (kind), get_lto_visibility (visibility), - (long) size, - (long) slot); + size, + slot); print_symbol (21, (const char *) sym_name); } putchar ('\n'); @@ -14808,7 +14808,7 @@ is_none_reloc (Filedata * filedata, unsigned int reloc_type) section NAME at OFFSET bytes. */ bool -reloc_at (struct dwarf_section * dsec, dwarf_vma offset) +reloc_at (struct dwarf_section * dsec, uint64_t offset) { Elf_Internal_Rela * relocs; Elf_Internal_Rela * rp; @@ -15119,13 +15119,13 @@ get_section_contents (Elf_Internal_Shdr * section, Filedata * filedata) /* Uncompresses a section that was compressed using zlib, in place. */ static bool -uncompress_section_contents (unsigned char ** buffer, - dwarf_size_type uncompressed_size, - dwarf_size_type * size) +uncompress_section_contents (unsigned char **buffer, + uint64_t uncompressed_size, + uint64_t *size) { - dwarf_size_type compressed_size = *size; - unsigned char * compressed_buffer = *buffer; - unsigned char * uncompressed_buffer; + uint64_t compressed_size = *size; + unsigned char *compressed_buffer = *buffer; + unsigned char *uncompressed_buffer; z_stream strm; int rc; @@ -15198,8 +15198,8 @@ dump_section_as_strings (Elf_Internal_Shdr * section, Filedata * filedata) if (decompress_dumps) { - dwarf_size_type new_size = num_bytes; - dwarf_size_type uncompressed_size = 0; + uint64_t new_size = num_bytes; + uint64_t uncompressed_size = 0; if ((section->sh_flags & SHF_COMPRESSED) != 0) { @@ -15414,8 +15414,8 @@ dump_section_as_bytes (Elf_Internal_Shdr *section, if (decompress_dumps) { - dwarf_size_type new_size = section_size; - dwarf_size_type uncompressed_size = 0; + uint64_t new_size = section_size; + uint64_t uncompressed_size = 0; if ((section->sh_flags & SHF_COMPRESSED) != 0) { @@ -15792,8 +15792,8 @@ load_specific_debug_section (enum dwarf_section_display_enum debug, else { unsigned char *start = section->start; - dwarf_size_type size = sec->sh_size; - dwarf_size_type uncompressed_size = 0; + uint64_t size = sec->sh_size; + uint64_t uncompressed_size = 0; if ((sec->sh_flags & SHF_COMPRESSED) != 0) { |