diff options
author | Alan Modra <amodra@gmail.com> | 2022-11-23 07:33:29 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-11-23 07:53:13 +1030 |
commit | 26c527e62e701ae256c1af243ec9d73e5560bd48 (patch) | |
tree | a44df4341fb9c64b305f0fa86ef4df653c3d8f48 /ld | |
parent | 63cf857e24be8e657dd2d3197da5c01a0f590d27 (diff) | |
download | gdb-26c527e62e701ae256c1af243ec9d73e5560bd48.zip gdb-26c527e62e701ae256c1af243ec9d73e5560bd48.tar.gz gdb-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 'ld')
0 files changed, 0 insertions, 0 deletions