Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/bfd/rs6000-core.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* IBM RS/6000 "XCOFF" back-end for BFD.
    22   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
    3    2001
     3   2001
    44   Free Software Foundation, Inc.
    55   FIXME: Can someone provide a transliteration of this name into ASCII?
     
    1212   Contributed by IBM Corporation and Cygnus Support.
    1313
    14 This file is part of BFD, the Binary File Descriptor library.
    15 
    16 This program is free software; you can redistribute it and/or modify
    17 it under the terms of the GNU General Public License as published by
    18 the Free Software Foundation; either version 2 of the License, or
    19 (at your option) any later version.
    20 
    21 This program is distributed in the hope that it will be useful,
    22 but WITHOUT ANY WARRANTY; without even the implied warranty of
    23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    24 GNU General Public License for more details.
    25 
    26 You should have received a copy of the GNU General Public License
    27 along with this program; if not, write to the Free Software
    28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     14This file is part of BFD, the Binary File Descriptor library.
     15
     16This program is free software; you can redistribute it and/or modify
     17it under the terms of the GNU General Public License as published by
     18the Free Software Foundation; either version 2 of the License, or
     19(at your option) any later version.
     20
     21This program is distributed in the hope that it will be useful,
     22but WITHOUT ANY WARRANTY; without even the implied warranty of
     23MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     24GNU General Public License for more details.
     25
     26You should have received a copy of the GNU General Public License
     27along with this program; if not, write to the Free Software
     28Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    2929
    3030/* This port currently only handles reading object files, except when
     
    183183/* Return the c_impl field from struct core_dumpx C.  */
    184184
    185 #ifdef AIX_CORE_DUMPX_CORE
     185#if
    186186# define CNEW_IMPL(c)   (c).c_impl
    187187#else
     
    254254   Return success.  */
    255255
    256 static boolean
     256static boolean
    257257read_hdr (bfd *abfd, CoreHdr *core)
    258258{
    259259  bfd_size_type size;
    260260
    261   if (bfd_seek (abfd, 0, SEEK_SET) != 0)
    262     return false;
     261  if (bfd_seek (abfd, 0, SEEK_SET) != 0)
     262    return ;
    263263
    264264  /* Read the leading portion that old and new core dump structures have in
    265265     common.  */
    266   if (bfd_read (core, CORE_COMMONSZ, 1, abfd) != CORE_COMMONSZ)
    267     return false;
     266  size = CORE_COMMONSZ;
     267  if (bfd_bread (core, size, abfd) != size)
     268    return FALSE;
    268269
    269270  /* Read the trailing portion of the structure.  */
    270   size = CORE_NEW (*core) ? sizeof (core->new) : sizeof (core->old)
    271     - CORE_COMMONSZ;
    272   return bfd_read ((char *) core + CORE_COMMONSZ, size, 1, abfd) == size;
     271  if (CORE_NEW (*core))
     272    size = sizeof (core->new);
     273  else
     274    size = sizeof (core->old);
     275  size -= CORE_COMMONSZ;
     276  return bfd_bread ((char *) core + CORE_COMMONSZ, size, abfd) == size;
    273277}
    274278
     
    276280make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
    277281     bfd *abfd;
    278      CONST char *name;
     282      char *name;
    279283     flagword flags;
    280284     bfd_size_type _raw_size;
     
    425429  /* Allocate core file header.  */
    426430  size = CORE_NEW (core) ? sizeof (core.new) : sizeof (core.old);
    427   tmpptr = (char *) bfd_zalloc (abfd, size);
     431  tmpptr = (char *) bfd_zalloc (abfd, size);
    428432  if (!tmpptr)
    429433    return NULL;
     
    459463                          SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS,
    460464                          c_size, c_stackend - c_size, c_stack))
    461     return NULL;
     465    ;
    462466
    463467  /* .reg section for all registers.  */
     
    465469                          SEC_HAS_CONTENTS,
    466470                          c_regsize, (bfd_vma) 0, c_regoff))
    467     return NULL;
     471    ;
    468472
    469473  /* .ldinfo section.
     
    474478                          SEC_HAS_CONTENTS,
    475479                          c_lsize, (bfd_vma) 0, c_loader))
    476     return NULL;
     480    ;
    477481
    478482#ifndef CORE_VERSION_1
     
    491495                                CDATA_ADDR (core.old.c_u.u_dsize),
    492496                              c_stack + c_size))
    493         return NULL;
     497        ;
    494498    }
    495499#endif
     
    533537                                (bfd_vma) CDATA_ADDR (c_datasize),
    534538                                c_data))
    535           return NULL;
     539          ;
    536540      }
    537541
     
    545549      {
    546550        if (bfd_seek (abfd, c_loader, SEEK_SET) != 0)
    547           return NULL;
    548         if (bfd_read (&ldinfo, size, 1, abfd) != size)
    549           return NULL;
     551          ;
     552        if (bfd_, abfd) != size)
     553          ;
    550554
    551555        if (proc64)
     
    568572                                  SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS,
    569573                                  ldi_datasize, ldi_dataorg, ldi_core))
    570             return NULL;
     574            ;
    571575
    572576        if (ldi_next == 0)
     
    581585
    582586        if (bfd_seek (abfd, c_vmm, SEEK_SET) != 0)
    583           return NULL;
     587          ;
    584588
    585589        for (i = 0; i < c_vmregions; i++)
     
    591595
    592596            size = CORE_NEW (core) ? sizeof (vminfo.new) : sizeof (vminfo.old);
    593             if (bfd_read (&vminfo, size, 1, abfd) != size)
    594               return NULL;
     597            if (bfd_, abfd) != size)
     598              ;
    595599
    596600            if (CORE_NEW (core))
     
    612616                                      vminfo_size, vminfo_addr,
    613617                                      vminfo_offset))
    614                 return NULL;
     618                ;
    615619          }
    616620      }
     
    619623
    620624  return abfd->xvec;            /* This is garbage for now.  */
     625
     626
     627
     628
     629
     630
    621631}
    622632
    623 /* Return `true' if given core is from the given executable.  */
    624 
    625 boolean
     633/* Return `' if given core is from the given executable.  */
     634
     635boolean
    626636rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd)
    627637     bfd *core_bfd;
     
    633643  size_t alloc;
    634644  const char *str1, *str2;
    635   boolean ret;
     645  boolean ret;
    636646  file_ptr c_loader;
    637647
    638648  if (!read_hdr (core_bfd, &core))
    639     return false;
     649    return ;
    640650
    641651  if (CORE_NEW (core))
     
    650660
    651661  if (bfd_seek (core_bfd, c_loader + size, SEEK_SET) != 0)
    652     return false;
     662    return ;
    653663
    654664  alloc = 100;
    655   path = bfd_malloc (alloc);
     665  path = bfd_malloc (alloc);
    656666  if (path == NULL)
    657     return false;
     667    return ;
    658668  s = path;
    659669
    660670  while (1)
    661671    {
    662       if (bfd_read (s, 1, 1, core_bfd) != 1)
     672      if (bfd_ 1, core_bfd) != 1)
    663673        {
    664674          free (path);
    665           return false;
     675          return ;
    666676        }
    667677      if (*s == '\0')
     
    673683
    674684          alloc *= 2;
    675           n = bfd_realloc (path, alloc);
     685          n = bfd_realloc (path, alloc);
    676686          if (n == NULL)
    677687            {
    678688              free (path);
    679               return false;
     689              return ;
    680690            }
    681691          s = n + (path - s);
     
    692702
    693703  if (strcmp (str1, str2) == 0)
    694     ret = true;
     704    ret = ;
    695705  else
    696     ret = false;
     706    ret = ;
    697707
    698708  free (path);
Note: See TracChangeset for help on using the changeset viewer.