Replace bfd_hostptr_t with uintptr_t

bfd_hostptr_t is defined as a type large enough to hold either a long
or a pointer.  It mostly appears in the coff backend code in casts.
include/coff/internal.h struct internal_syment and union
internal_auxent have the only uses in data structures, where
comparison with include/coff/external.h and other code reveals that
the type only needs to be large enough for a 32-bit integer or a
pointer.  That should mean replacing with uintptr_t is OK.
This commit is contained in:
Alan Modra
2022-05-27 15:28:34 +09:30
parent 65d13793d9
commit 6015985895
14 changed files with 50 additions and 72 deletions

View File

@@ -4620,7 +4620,7 @@ coff_slurp_symbol_table (bfd * abfd)
BFD_ASSERT (src->is_sym);
dst->symbol.name = (char *) (src->u.syment._n._n_n._n_offset);
/* We use the native name field to point to the cached field. */
src->u.syment._n._n_n._n_zeroes = (bfd_hostptr_t) dst;
src->u.syment._n._n_n._n_zeroes = (uintptr_t) dst;
dst->symbol.section = coff_section_from_bfd_index (abfd,
src->u.syment.n_scnum);
dst->symbol.flags = 0;
@@ -4829,7 +4829,7 @@ coff_slurp_symbol_table (bfd * abfd)
to the symbol instead of the index. FIXME: This
should use a union. */
src->u.syment.n_value
= (bfd_hostptr_t) (native_symbols + src->u.syment.n_value);
= (uintptr_t) (native_symbols + src->u.syment.n_value);
dst->symbol.value = src->u.syment.n_value;
src->fix_value = 1;
break;