Commit Message
On Wed, Apr 02, 2014 at 04:04:24AM -0400, Hans-Peter Nilsson wrote:
> The new size parameter uses size_t in bfd headers, breaking some
> simulators like cris-elf, frv-elf, h8300-elf, iq2000-elf,
> m32r-elf, mips-elf, mn10300-elf.
>
> The obvious change is to instead use bfd_size_type, like
> everything else in BFD headers. Any reason not to do that here?
I originally had bfd_size_type and wondered if we could use size_t,
which is the natural type to use here. (bfd_size_type might be 64-bit
and it doesn't really make sense to use that when describing a memory
area on a 32-bit host.) gdb and binutils built without trouble on a
few targets, so I went with size_t. Sorry about the sim breakage.
* elf-bfd.h (struct elf_backend_data
<elf_backend_bfd_from_remote_memory>): Replace "size_t size"
with "bfd_size_type size".
(_bfd_elf32_bfd_from_remote_memory): Likewise.
(_bfd_elf64_bfd_from_remote_memory): Likewise.
* elf.c (bfd_elf_bfd_from_remote_memory): Likewise.
* elfcode.h (bfd_from_remote_memory): Likewise.
Comments
On Thu, Apr 03, 2014 at 11:36:44AM +1030, Alan Modra wrote:
> * elf-bfd.h (struct elf_backend_data
> <elf_backend_bfd_from_remote_memory>): Replace "size_t size"
> with "bfd_size_type size".
> (_bfd_elf32_bfd_from_remote_memory): Likewise.
> (_bfd_elf64_bfd_from_remote_memory): Likewise.
> * elf.c (bfd_elf_bfd_from_remote_memory): Likewise.
> * elfcode.h (bfd_from_remote_memory): Likewise.
Sigh. Here too.
* bfd-in.h (bfd_elf_bfd_from_remote_memory): Likewise.
* bfd-in2.h: Regenerate.
@@ -1191,7 +1191,7 @@ struct elf_backend_data
/* This function implements `bfd_elf_bfd_from_remote_memory';
see elf.c, elfcode.h. */
bfd *(*elf_backend_bfd_from_remote_memory)
- (bfd *templ, bfd_vma ehdr_vma, size_t size, bfd_vma *loadbasep,
+ (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
bfd_size_type len));
@@ -2334,10 +2334,10 @@ extern char *elfcore_write_ppc_linux_prpsinfo32
(bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *);
extern bfd *_bfd_elf32_bfd_from_remote_memory
- (bfd *templ, bfd_vma ehdr_vma, size_t size, bfd_vma *loadbasep,
+ (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type));
extern bfd *_bfd_elf64_bfd_from_remote_memory
- (bfd *templ, bfd_vma ehdr_vma, size_t size, bfd_vma *loadbasep,
+ (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type));
extern bfd_vma bfd_elf_obj_attr_size (bfd *);
@@ -9908,7 +9908,7 @@ bfd *
bfd_elf_bfd_from_remote_memory
(bfd *templ,
bfd_vma ehdr_vma,
- size_t size,
+ bfd_size_type size,
bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type))
{
@@ -1605,7 +1605,7 @@ bfd *
NAME(_bfd_elf,bfd_from_remote_memory)
(bfd *templ,
bfd_vma ehdr_vma,
- size_t size,
+ bfd_size_type size,
bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type))
{