This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] bfd: Use size_t for length argument totarget_read_memory function passed into bfd_elf_bfd_from_remote_memory
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Cc: binutils at sourceware dot org, gdb-patches at sourceware dot org
- Date: Sat, 2 Jun 2012 01:24:10 +0530
- Subject: Re: [PATCH] bfd: Use size_t for length argument totarget_read_memory function passed into bfd_elf_bfd_from_remote_memory
- References: <20120528143520.29254d79@spoyarek> <201206011824.q51IOEA8029007@ignucius.se.axis.com>
On Fri, 1 Jun 2012 20:24:14 +0200, Hans-Peter wrote:
> There's always bfd_size_type, though I haven't checked if it
> fits your needs.
Should be OK as long as it always matches the size_t definition in the
stddef.h that gcc ships. They're both typically unsigned long, but if
that is so, then bfd_size_type should have been typedef'd to size_t
anyway.
> This caused failure to build for simulators for (at least) the
> following targets:
>
> cris-elf, frv-elf, h8300-elf, iq2000-elf, m32r-elf, mips-elf, and
> mn10300-elf.
>
> They fail building either of sim/common/cgen-utils.c,
> sim/common/sim-command.c, sim/mips/interp.c, or
> sim/common/nrun.c all due to lack of size_t definition; a
> missing include of stddef.h before its use.
>
> Should bfd.h include sysdep.h or what is missing?
An stddef.h include in bfd.h should fix this. That or I can fix my
patch to use bfd_size_type provided its size is always equal to
size_t, so that the include is not needed. Which way would be
preferable?
Regards,
Siddhesh