Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
To: siddhesh@redhat.com
Cc: binutils@sourceware.org, gdb-patches@sourceware.org
Subject: Re: [PATCH] bfd: Use size_t for length argument totarget_read_memory function passed into bfd_elf_bfd_from_remote_memory
Date: Fri, 01 Jun 2012 18:24:00 -0000	[thread overview]
Message-ID: <201206011824.q51IOEA8029007@ignucius.se.axis.com> (raw)
In-Reply-To: <20120528143520.29254d79@spoyarek> (message from Siddhesh	Poyarekar on Mon, 28 May 2012 11:05:20 +0200)

> From: Siddhesh Poyarekar <siddhesh@redhat.com>

> 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.

There's always bfd_size_type, though I haven't checked if it
fits your needs.

> 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.

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?

For reference, the m32r-elf fail:

gcc -DHAVE_CONFIG_H   -DWITH_DEFAULT_MODEL='"m32r/d"'  -DPROFILE=1 -DWITH_PROFILE=-1   -DWITH_ALIGNMENT=STRICT_ALIGNMENT  -DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN -DWITH_ENVIRONMENT=ALL_ENVIRONMENT   -DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN     -DWITH_SCACHE=16384       -DM32R_ELF   -I. -I/tmp/hpautotest-sim/src/sim/m32r -I../common -I/tmp/hpautotest-sim/src/sim/m32r/../common -I../../include -I/tmp/hpautotest-sim/src/sim/m32r/../../include -I../../bfd -I/tmp/hpautotest-sim/src/sim/m32r/../../bfd -I../../opcodes -I/tmp/hpautotest-sim/src/sim/m32r/../../opcodes  -g -O2 -c -o cgen-utils.o -MT cgen-utils.o -MMD -MP -MF .deps/cgen-utils.Tpo /tmp/hpautotest-sim/src/sim/m32r/../common/cgen-utils.c
In file included from /tmp/hpautotest-sim/src/sim/m32r/../common/cgen-utils.c:21:
../../bfd/bfd.h:708: error: expected declaration specifiers or '...' before 'size_t'

brgds, H-P


  parent reply	other threads:[~2012-06-01 18:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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:06   ` [commit bfd+gdb] " Jan Kratochvil
2012-06-01 18:24 ` Hans-Peter Nilsson [this message]
2012-06-01 19:54   ` Siddhesh Poyarekar
2012-06-01 20:31   ` Jan Kratochvil
2012-06-01 21:05     ` [patch#2] " Jan Kratochvil
2012-06-01 21:21       ` Hans-Peter Nilsson
2012-06-04  5:10       ` Hans-Peter Nilsson
2012-06-04  5:25         ` Jan Kratochvil
2012-06-04  6:23           ` Hans-Peter Nilsson
2012-06-04 12:11             ` Alan Modra
2012-06-04 14:37               ` [commit] " Jan Kratochvil
  -- strict thread matches above, loose matches on Subject: below --
2012-05-28  9:04 [PATCH] " Siddhesh Poyarekar

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=201206011824.q51IOEA8029007@ignucius.se.axis.com \
    --to=hans-peter.nilsson@axis.com \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=siddhesh@redhat.com \
    /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