summaryrefslogtreecommitdiff
path: root/gdb/spu-linux-nat.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2006-12-15 04:13:37 +0000
committerAlan Modra <amodra@bigpond.net.au>2006-12-15 04:13:37 +0000
commit0bad4b201b83160fcc2bf9c6b256f2e2d318928a (patch)
tree191c674fd152f7e8527fed380d47a8fe67d2d2e5 /gdb/spu-linux-nat.c
parentd20700efcf2743449ee44f94d58ce8bc70802278 (diff)
downloadgdb-0bad4b201b83160fcc2bf9c6b256f2e2d318928a.tar.gz
bfd/
* opncls.c (bfd_openr_iovec): Add "stat" parameter. (struct opncls): Add "stat" field. (opncls_bstat): Call vec->stat. * bfd-in2.h: Regenerate. * elf32-spu.c (spu_elf_open_builtin_lib): Adjust. gdb/ * spu-linux-nat.c (spu_bfd_iovec_stat): New function. (spu_bfd_open): Adjust bfd_openr_iovec call.
Diffstat (limited to 'gdb/spu-linux-nat.c')
-rw-r--r--gdb/spu-linux-nat.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index fd3673c6a23..99144b75dad 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -281,6 +281,18 @@ spu_bfd_iovec_pread (struct bfd *abfd, void *stream, void *buf,
return nbytes;
}
+static int
+spu_bfd_iovec_stat (struct bfd *abfd, void *stream, struct stat *sb)
+{
+ /* We don't have an easy way of finding the size of embedded spu
+ images. We could parse the in-memory ELF header and section
+ table to find the extent of the last section but that seems
+ pointless when the size is needed only for checks of other
+ parsed values in dbxread.c. */
+ sb->st_size = INT_MAX;
+ return 0;
+}
+
static bfd *
spu_bfd_open (CORE_ADDR addr)
{
@@ -291,7 +303,8 @@ spu_bfd_open (CORE_ADDR addr)
nbfd = bfd_openr_iovec (xstrdup ("<in-memory>"), "elf32-spu",
spu_bfd_iovec_open, open_closure,
- spu_bfd_iovec_pread, spu_bfd_iovec_close);
+ spu_bfd_iovec_pread, spu_bfd_iovec_close,
+ spu_bfd_iovec_stat);
if (!nbfd)
return NULL;