aboutsummaryrefslogtreecommitdiff
path: root/binutils/dwarf.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-11-23 07:33:29 +1030
committerAlan Modra <amodra@gmail.com>2022-11-23 07:53:13 +1030
commit26c527e62e701ae256c1af243ec9d73e5560bd48 (patch)
treea44df4341fb9c64b305f0fa86ef4df653c3d8f48 /binutils/dwarf.h
parent63cf857e24be8e657dd2d3197da5c01a0f590d27 (diff)
downloadbinutils-26c527e62e701ae256c1af243ec9d73e5560bd48.zip
binutils-26c527e62e701ae256c1af243ec9d73e5560bd48.tar.gz
binutils-26c527e62e701ae256c1af243ec9d73e5560bd48.tar.bz2
Don't use "long" in readelf for file offsets
The aim here is to improve readelf handling of large 64-bit object files on LLP64 hosts (Windows) where long is only 32 bits. The patch changes more than just file offsets. Addresses and sizes are also changed to avoid "long". Most places get to use uint64_t even where size_t may be more appropriate, because that allows some overflow checks to be implemented easily (*alloc changes). * dwarf.c (cmalloc, xcmalloc, xcrealloc, xcalloc2): Make nmemb parameter uint64_t. * dwarf.h: Update prototypes. (struct dwarf_section): Make num_relocs uint64_t. * elfcomm.c (setup_archive): Update error format. * elfcomm.h (struct archive_info): Make sym_size, longnames_size, nested_member_origin, next_arhdr_offset uint64_t. * readelf.c (struct filedata): Make archive_file_offset, archive_file_size, string_table_length, dynamic_addr, dynamic_nent, dynamic_strings_length, num_dynamic_syms, dynamic_syminfo_offset uint64_t. (many functions): Replace uses of "unsigned long" with "uint64_t" or "size_t".
Diffstat (limited to 'binutils/dwarf.h')
-rw-r--r--binutils/dwarf.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/binutils/dwarf.h b/binutils/dwarf.h
index bb6128e..9c00313 100644
--- a/binutils/dwarf.h
+++ b/binutils/dwarf.h
@@ -144,7 +144,7 @@ struct dwarf_section
enum dwarf_section_display_enum abbrev_sec;
/* Used by clients to help them implement the reloc_at callback. */
void * reloc_info;
- unsigned long num_relocs;
+ uint64_t num_relocs;
};
/* A structure containing the name of a debug section
@@ -256,10 +256,10 @@ extern void dwarf_select_sections_all (void);
extern unsigned int * find_cu_tu_set (void *, unsigned int);
-extern void * cmalloc (size_t, size_t);
-extern void * xcalloc2 (size_t, size_t);
-extern void * xcmalloc (size_t, size_t);
-extern void * xcrealloc (void *, size_t, size_t);
+extern void * cmalloc (uint64_t, size_t);
+extern void * xcalloc2 (uint64_t, size_t);
+extern void * xcmalloc (uint64_t, size_t);
+extern void * xcrealloc (void *, uint64_t, size_t);
/* A callback into the client. Returns TRUE if there is a
relocation against the given debug section at the given