OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [bfd/] [bfdio.c] - Diff between revs 161 and 166

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 161 Rev 166
Line 85... Line 85...
 
 
FILE *
FILE *
real_fopen (const char *filename, const char *modes)
real_fopen (const char *filename, const char *modes)
{
{
#ifdef VMS
#ifdef VMS
  char vms_modes[4];
 
  char *vms_attr;
  char *vms_attr;
 
 
  /* On VMS, fopen allows file attributes as optionnal arguments.
  /* On VMS, fopen allows file attributes as optionnal arguments.
     We need to use them but we'd better to use the common prototype.
     We need to use them but we'd better to use the common prototype.
     In fopen-vms.h, they are separated from the mode with a comma.
     In fopen-vms.h, they are separated from the mode with a comma.
Line 183... Line 182...
 
 
  /* If this is an archive element, don't read past the end of
  /* If this is an archive element, don't read past the end of
     this element.  */
     this element.  */
  if (abfd->arelt_data != NULL)
  if (abfd->arelt_data != NULL)
    {
    {
      size_t maxbytes = ((struct areltdata *) abfd->arelt_data)->parsed_size;
      bfd_size_type maxbytes = arelt_size (abfd);
 
 
      if (abfd->where + size > maxbytes)
      if (abfd->where + size > maxbytes)
        {
        {
          if (abfd->where >= maxbytes)
          if (abfd->where >= maxbytes)
            return 0;
            return 0;
          size = maxbytes - abfd->where;
          size = maxbytes - abfd->where;
Line 231... Line 231...
{
{
  file_ptr ptr;
  file_ptr ptr;
 
 
  if (abfd->iovec)
  if (abfd->iovec)
    {
    {
 
      bfd *parent_bfd = abfd;
      ptr = abfd->iovec->btell (abfd);
      ptr = abfd->iovec->btell (abfd);
 
 
      if (abfd->my_archive)
      while (parent_bfd->my_archive != NULL)
        ptr -= abfd->origin;
        {
 
          ptr -= parent_bfd->origin;
 
          parent_bfd = parent_bfd->my_archive;
 
        }
    }
    }
  else
  else
    ptr = 0;
    ptr = 0;
 
 
  abfd->where = ptr;
  abfd->where = ptr;
Line 306... Line 310...
 
 
         In the meantime, no optimization for archives.  */
         In the meantime, no optimization for archives.  */
    }
    }
 
 
  file_position = position;
  file_position = position;
  if (direction == SEEK_SET && abfd->my_archive != NULL)
  if (direction == SEEK_SET)
    file_position += abfd->origin;
    {
 
      bfd *parent_bfd = abfd;
 
 
 
      while (parent_bfd->my_archive != NULL)
 
        {
 
          file_position += parent_bfd->origin;
 
          parent_bfd = parent_bfd->my_archive;
 
        }
 
    }
 
 
  if (abfd->iovec)
  if (abfd->iovec)
    result = abfd->iovec->bseek (abfd, file_position, direction);
    result = abfd->iovec->bseek (abfd, file_position, direction);
  else
  else
    result = -1;
    result = -1;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.