From: Siddhesh Poyarekar <siddhesh@redhat.com>
To: binutils@sourceware.org, gdb-patches@sourceware.org
Subject: [PATCH] bfd: Use size_t for length argument totarget_read_memory function passed into bfd_elf_bfd_from_remote_memory
Date: Mon, 28 May 2012 09:04:00 -0000 [thread overview]
Message-ID: <20120528143437.5da0e648@spoyarek> (raw)
Hi,
The target_read_memory function pointer that
bfd_elf_bfd_from_remote_memory accepts current accepts int for length.
I have attached a patch which changes this argument to size_t. This
change is needed because I'm looking to make analogous changes in gdb to
ensure consistency of storage sizes passed across functions to ensure
that larger values are not truncated.
I could write a wrapper around or cast the function pointer explicitly,
but as Jan Kratochvil suggested, it would be cleaner to just make a
change in bfd since it should be taking size_t values anyway. The
conversation thread is here for reference:
http://sourceware.org/ml/gdb-patches/2012-05/msg00909.html
Attached are two patches, the first being changes to bfd and the second
is the change I need to make in gdb to make it work with the changes in
bfd.
Regards,
Siddhesh
bfd/ChangeLog:
2012-05-28 Siddhesh Poyarekar <siddhesh@redhat.com>
* 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.
* enfcode.h (NAME): Likewise.
gdb/ChangeLog:
2012-05-28 Siddhesh Poyarekar <siddhesh@redhat.com>
* target.c (target_read_memory): Make LEN argument as size_t.
* target.h (target_read_memory): Likewise.
next reply other threads:[~2012-05-28 9:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-28 9:04 Siddhesh Poyarekar [this message]
2012-05-28 9:05 Siddhesh Poyarekar
2012-05-28 11:03 ` Alan Modra
2012-05-28 11:11 ` Siddhesh Poyarekar
2012-05-28 21:29 ` Jan Kratochvil
2012-06-01 18:24 ` Hans-Peter Nilsson
2012-06-01 19:54 ` Siddhesh Poyarekar
2012-06-01 20:31 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120528143437.5da0e648@spoyarek \
--to=siddhesh@redhat.com \
--cc=binutils@sourceware.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).