This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [5/17] introduce the BFD cache


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]