This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [5/17] introduce the BFD cache
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 15 Dec 2011 00:33:05 -0500
- Subject: Re: [5/17] introduce the BFD cache
- References: <m3ehw697sa.fsf@fleche.redhat.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Tom Tromey <tromey@redhat.com>
> Date: Wed, 14 Dec 2011 14:12:53 -0700
>
> +struct bfd *
> +gdb_bfd_open (const char *name, const char *target, int fd)
> +{
> + hashval_t hash;
> + void **slot;
> + bfd *abfd;
> + struct gdb_bfd_cache_search search;
> + struct stat st;
> +
> + if (gdb_bfd_cache == NULL)
> + gdb_bfd_cache = htab_create_alloc (1, hash_bfd, eq_bfd, NULL,
> + xcalloc, xfree);
> +
> + if (fd == -1)
> + {
> + fd = open (name, O_RDONLY);
You need to use O_BINARY here.