aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-06-11 17:22:55 +0930
committerAlan Modra <amodra@gmail.com>2016-06-11 17:24:56 +0930
commitef53be89160126f2fa5dec8f1ec3bd6d99fb0681 (patch)
tree7fa2f5a6331b3bb50d3cca67af00b835d7ddfde6 /bfd/elf-bfd.h
parentde5b02b698cb34f1a7f7f0be87d140f88297da0e (diff)
downloadgdb-ef53be89160126f2fa5dec8f1ec3bd6d99fb0681.zip
gdb-ef53be89160126f2fa5dec8f1ec3bd6d99fb0681.tar.gz
gdb-ef53be89160126f2fa5dec8f1ec3bd6d99fb0681.tar.bz2
Use size_t rather than bfd_size_type
I noticed when writing _bfd_elf_strtab_save/restore that size_t would be better than bfd_size_type for a number of things in elf-strtab.c. Using a 64-bit bfd_size_type on a 32-bit host doesn't make much sense for array sizes and indices. * elf-strtab.c (struct strtab_save): Use size_t for "size". (struct elf_strtab_hash): Likewise for "size" and "alloced". (_bfd_elf_strtab_init): Formatting. (_bfd_elf_strtab_add): Return size_t rather than bfd_size_type. (_bfd_elf_strtab_addref): Take size_t idx param. (_bfd_elf_strtab_delref, _bfd_elf_strtab_refcount): Likewise. (_bfd_elf_strtab_offset): Likewise. (_bfd_elf_strtab_clear_all_refs): Use size_t idx. (_bfd_elf_strtab_save): Use size_t "idx" and "size" vars. (_bfd_elf_strtab_restore, _bfd_elf_strtab_emit): Similarly. (_bfd_elf_strtab_finalize): Similarly. * elf-bfd.h (_bfd_elf_strtab_add): Update prototypes. (_bfd_elf_strtab_addref, _bfd_elf_strtab_delref): Likewise. (_bfd_elf_strtab_refcount, _bfd_elf_strtab_offset): Likewise. * elf.c (bfd_elf_get_elf_syms): Calculate symbol buffer size using bfd_size_type. (bfd_section_from_shdr): Delete amt. (_bfd_elf_init_reloc_shdr): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. (assign_section_numbers): Use size_t reloc_count. * elflink.c (struct elf_symbuf_head): Use size_t "count". (bfd_elf_link_record_dynamic_symbol): Use size_t for some vars. (elf_link_is_defined_archive_symbol): Likewise. (elf_add_dt_needed_tag): Likewise. (elf_finalize_dynstr): Likewise. (elf_link_add_object_symbols): Likewise. (bfd_elf_size_dynamic_sections): Likewise. (elf_create_symbuf): Similarly. (bfd_elf_match_symbols_in_sections): Likewise. (elf_link_swap_symbols_out): Likewise. (elf_link_check_versioned_symbol): Likewise. (bfd_elf_gc_record_vtinherit): Likewise. (bfd_elf_gc_common_finalize_got_offsets): Likewise.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index d37c208..6825530 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2049,14 +2049,14 @@ extern struct elf_strtab_hash * _bfd_elf_strtab_init
(void);
extern void _bfd_elf_strtab_free
(struct elf_strtab_hash *);
-extern bfd_size_type _bfd_elf_strtab_add
+extern size_t _bfd_elf_strtab_add
(struct elf_strtab_hash *, const char *, bfd_boolean);
extern void _bfd_elf_strtab_addref
- (struct elf_strtab_hash *, bfd_size_type);
+ (struct elf_strtab_hash *, size_t);
extern void _bfd_elf_strtab_delref
- (struct elf_strtab_hash *, bfd_size_type);
+ (struct elf_strtab_hash *, size_t);
extern unsigned int _bfd_elf_strtab_refcount
- (struct elf_strtab_hash *, bfd_size_type);
+ (struct elf_strtab_hash *, size_t);
extern void _bfd_elf_strtab_clear_all_refs
(struct elf_strtab_hash *);
extern void *_bfd_elf_strtab_save
@@ -2066,7 +2066,7 @@ extern void _bfd_elf_strtab_restore
extern bfd_size_type _bfd_elf_strtab_size
(struct elf_strtab_hash *);
extern bfd_size_type _bfd_elf_strtab_offset
- (struct elf_strtab_hash *, bfd_size_type);
+ (struct elf_strtab_hash *, size_t);
extern bfd_boolean _bfd_elf_strtab_emit
(bfd *, struct elf_strtab_hash *);
extern void _bfd_elf_strtab_finalize