From 5299c1c488017d034cd4f36821d35f8d04300c7c Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 1 Jun 2012 16:37:59 +0000 Subject: [PATCH] bfd/ * bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument of target_read_memory as size_t. * bfd-in2.h: Regenerate. * elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN argument of target_read_memory as size_t. (_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 (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise. gdb/ * target.c (target_read_memory): Make LEN argument as size_t. * target.h (target_read_memory): Likewise. --- bfd/ChangeLog | 12 ++++++++++++ bfd/bfd-in.h | 2 +- bfd/bfd-in2.h | 2 +- bfd/elf-bfd.h | 6 +++--- bfd/elf.c | 2 +- bfd/elfcode.h | 2 +- gdb/ChangeLog | 7 ++++++- gdb/target.c | 2 +- gdb/target.h | 3 ++- 9 files changed, 28 insertions(+), 10 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2cda278260e..f4536e0d822 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,15 @@ +2012-06-01 Siddhesh Poyarekar + + * bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument + of target_read_memory as size_t. + * bfd-in2.h: Regenerate. + * elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN + argument of target_read_memory as size_t. + (_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 (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise. + 2012-06-01 Alan Modra PR binutils/13897 diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index a61e7215654..9617428caf5 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -698,7 +698,7 @@ extern int bfd_get_elf_phdrs the remote memory. */ extern bfd *bfd_elf_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len)); + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, size_t len)); extern struct bfd_section *_bfd_elf_tls_setup (bfd *, struct bfd_link_info *); diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index efd542fd390..585a54a0d2e 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -705,7 +705,7 @@ extern int bfd_get_elf_phdrs the remote memory. */ extern bfd *bfd_elf_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len)); + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, size_t len)); extern struct bfd_section *_bfd_elf_tls_setup (bfd *, struct bfd_link_info *); diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 5426c93a3a4..fcfb42aec6b 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1186,7 +1186,7 @@ struct elf_backend_data see elf.c, elfcode.h. */ bfd *(*elf_backend_bfd_from_remote_memory) (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len)); + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, size_t len)); /* This function is used by `_bfd_elf_get_synthetic_symtab'; see elf.c. */ @@ -2260,10 +2260,10 @@ extern char *elfcore_write_register_note extern bfd *_bfd_elf32_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma, bfd_byte *, int)); + int (*target_read_memory) (bfd_vma, bfd_byte *, size_t)); extern bfd *_bfd_elf64_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma, bfd_byte *, int)); + int (*target_read_memory) (bfd_vma, bfd_byte *, size_t)); extern bfd_vma bfd_elf_obj_attr_size (bfd *); extern void bfd_elf_set_obj_attr_contents (bfd *, bfd_byte *, bfd_vma); diff --git a/bfd/elf.c b/bfd/elf.c index c5b04ac2b84..7a06fb4a746 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -9556,7 +9556,7 @@ bfd_elf_bfd_from_remote_memory (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma, bfd_byte *, int)) + int (*target_read_memory) (bfd_vma, bfd_byte *, size_t)) { return (*get_elf_backend_data (templ)->elf_backend_bfd_from_remote_memory) (templ, ehdr_vma, loadbasep, target_read_memory); diff --git a/bfd/elfcode.h b/bfd/elfcode.h index c985c63ee61..2c8fe2b4f54 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -1615,7 +1615,7 @@ NAME(_bfd_elf,bfd_from_remote_memory) (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma, bfd_byte *, int)) + int (*target_read_memory) (bfd_vma, bfd_byte *, size_t)) { Elf_External_Ehdr x_ehdr; /* Elf file header, external form */ Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */ diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fa04e476622..68600fb0287 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,4 +1,9 @@ -2012-05-31 Jan Kratochvil +2012-06-01 Siddhesh Poyarekar + + * target.c (target_read_memory): Make LEN argument as size_t. + * target.h (target_read_memory): Likewise. + +2012-06-01 Jan Kratochvil * tilegx-linux-tdep.c (tilegx_l): Use ULL for 64-bit values. diff --git a/gdb/target.c b/gdb/target.c index 151209e246e..91b4b471b6b 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1756,7 +1756,7 @@ target_xfer_partial (struct target_ops *ops, it makes no progress, and then return how much was transferred). */ int -target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len) +target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, size_t len) { /* Dispatch to the topmost target, not the flattened current_target. Memory accesses check target->to_has_(all_)memory, and the diff --git a/gdb/target.h b/gdb/target.h index f80fba0cdaf..f3ef33a775c 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -996,7 +996,8 @@ extern void target_dcache_invalidate (void); extern int target_read_string (CORE_ADDR, char **, int, int *); -extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len); +extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, + size_t len); extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len); -- 2.30.2