vdso handling

Message ID 20140403010644.GB18201@bubble.grove.modra.org
State Committed
Headers

Commit Message

Alan Modra April 3, 2014, 1:06 a.m. UTC
  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

Alan Modra April 3, 2014, 1:46 a.m. UTC | #1
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.
  

Patch

diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 6d07303..f58a3b7 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -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 *);
diff --git a/bfd/elf.c b/bfd/elf.c
index d67b917..9e46f7c 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -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))
 {
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index f840065..a49a708 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -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))
 {