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/ecofflink.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* Routines to link ECOFF debugging information.
    2    Copyright 1993, 1994, 1995, 1996, 1997, 2000
     2   Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002
    33   Free Software Foundation, Inc.
    44   Written by Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>.
    55
    6 This file is part of BFD, the Binary File Descriptor library.
    7 
    8 This program is free software; you can redistribute it and/or modify
    9 it under the terms of the GNU General Public License as published by
    10 the Free Software Foundation; either version 2 of the License, or
    11 (at your option) any later version.
    12 
    13 This program is distributed in the hope that it will be useful,
    14 but WITHOUT ANY WARRANTY; without even the implied warranty of
    15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16 GNU General Public License for more details.
    17 
    18 You should have received a copy of the GNU General Public License
    19 along with this program; if not, write to the Free Software
    20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     6   This file is part of BFD, the Binary File Descriptor library.
     7
     8   This program is free software; you can redistribute it and/or modify
     9   it under the terms of the GNU General Public License as published by
     10   the Free Software Foundation; either version 2 of the License, or
     11   (at your option) any later version.
     12
     13   This program is distributed in the hope that it will be useful,
     14   but WITHOUT ANY WARRANTY; without even the implied warranty of
     15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16   GNU General Public License for more details.
     17
     18   You should have received a copy of the GNU General Public License
     19   along with this program; if not, write to the Free Software
     20   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    2121
    2222#include "bfd.h"
     
    3434
    3535
    36 static boolean ecoff_add_bytes PARAMS ((char **buf, char **bufend,
    37                                         size_t need));
     36static bfd_boolean ecoff_add_bytes
     37  PARAMS ((char **buf, char **bufend, size_t need));
    3838static struct bfd_hash_entry *string_hash_newfunc
    3939  PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
    4040           const char *));
    41 static void ecoff_align_debug PARAMS ((bfd *abfd,
    42                                        struct ecoff_debug_info *debug,
    43                                        const struct ecoff_debug_swap *swap));
    44 static boolean ecoff_write_symhdr PARAMS ((bfd *, struct ecoff_debug_info *,
    45                                            const struct ecoff_debug_swap *,
    46                                            file_ptr where));
    47 static int cmp_fdrtab_entry PARAMS ((const PTR, const PTR));
    48 static boolean mk_fdrtab PARAMS ((bfd *,
    49                                   struct ecoff_debug_info * const,
    50                                   const struct ecoff_debug_swap * const,
    51                                   struct ecoff_find_line *));
    52 static long fdrtab_lookup PARAMS ((struct ecoff_find_line *, bfd_vma));
    53 static boolean lookup_line
     41static void ecoff_align_debug
     42  PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
     43           const struct ecoff_debug_swap *swap));
     44static bfd_boolean ecoff_write_symhdr
     45  PARAMS ((bfd *, struct ecoff_debug_info *, const struct ecoff_debug_swap *,
     46           file_ptr where));
     47static int cmp_fdrtab_entry
     48  PARAMS ((const PTR, const PTR));
     49static bfd_boolean mk_fdrtab
     50  PARAMS ((bfd *, struct ecoff_debug_info * const,
     51           const struct ecoff_debug_swap * const, struct ecoff_find_line *));
     52static long fdrtab_lookup
     53  PARAMS ((struct ecoff_find_line *, bfd_vma));
     54static bfd_boolean lookup_line
    5455  PARAMS ((bfd *, struct ecoff_debug_info * const,
    5556           const struct ecoff_debug_swap * const, struct ecoff_find_line *));
     
    257258/* Add bytes to a buffer.  Return success.  */
    258259
    259 static boolean
     260static bfd_boolean
    260261ecoff_add_bytes (buf, bufend, need)
    261262     char **buf;
     
    276277        want = ALLOC_SIZE;
    277278    }
    278   newbuf = (char *) bfd_realloc (*buf, have + want);
     279  newbuf = (char *) bfd_realloc (*buf, (bfd_size_type) have + want);
    279280  if (newbuf == NULL)
    280     return false;
     281    return FALSE;
    281282  *buf = newbuf;
    282283  *bufend = *buf + have + want;
    283   return true;
     284  return TRUE;
    284285}
    285286
     
    351352  unsigned long size;
    352353  /* Whether this information comes from a file or not.  */
    353   boolean filep;
     354  bfd_boolean filep;
    354355  union
    355356    {
     
    404405/* Add a file entry to a shuffle list.  */
    405406
    406 static boolean add_file_shuffle PARAMS ((struct accumulate *,
    407                                       struct shuffle **,
    408                                       struct shuffle **, bfd *, file_ptr,
    409                                       unsigned long));
    410 
    411 static boolean
     407static bfd_boolean add_file_shuffle
     408  PARAMS ((struct accumulate *, struct shuffle **, struct shuffle **,
     409           bfd *, file_ptr, unsigned long));
     410
     411static bfd_boolean
    412412add_file_shuffle (ainfo, head, tail, input_bfd, offset, size)
    413413     struct accumulate *ainfo;
     
    429429      if ((*tail)->size > ainfo->largest_file_shuffle)
    430430        ainfo->largest_file_shuffle = (*tail)->size;
    431       return true;
     431      return TRUE;
    432432    }
    433433
     
    437437    {
    438438      bfd_set_error (bfd_error_no_memory);
    439       return false;
     439      return FALSE;
    440440    }
    441441  n->next = NULL;
    442442  n->size = size;
    443   n->filep = true;
     443  n->filep = TRUE;
    444444  n->u.file.input_bfd = input_bfd;
    445445  n->u.file.offset = offset;
     
    451451  if (size > ainfo->largest_file_shuffle)
    452452    ainfo->largest_file_shuffle = size;
    453   return true;
     453  return TRUE;
    454454}
    455455
    456456/* Add a memory entry to a shuffle list.  */
    457457
    458 static boolean add_memory_shuffle PARAMS ((struct accumulate *,
    459                                            struct shuffle **head,
    460                                            struct shuffle **tail,
    461                                            bfd_byte *data, unsigned long size));
    462 
    463 static boolean
     458static bfd_boolean add_memory_shuffle
     459  PARAMS ((struct accumulate *, struct shuffle **head, struct shuffle **tail,
     460           bfd_byte *data, unsigned long size));
     461
     462static bfd_boolean
    464463add_memory_shuffle (ainfo, head, tail, data, size)
    465464     struct accumulate *ainfo;
     
    476475    {
    477476      bfd_set_error (bfd_error_no_memory);
    478       return false;
     477      return FALSE;
    479478    }
    480479  n->next = NULL;
    481480  n->size = size;
    482   n->filep = false;
     481  n->filep = FALSE;
    483482  n->u.memory = (PTR) data;
    484483  if (*head == (struct shuffle *) NULL)
     
    487486    (*tail)->next = n;
    488487  *tail = n;
    489   return true;
     488  return TRUE;
    490489}
    491490
     
    501500{
    502501  struct accumulate *ainfo;
    503 
    504   ainfo = (struct accumulate *) bfd_malloc (sizeof (struct accumulate));
     502  bfd_size_type amt = sizeof (struct accumulate);
     503
     504  ainfo = (struct accumulate *) bfd_malloc (amt);
    505505  if (!ainfo)
    506506    return NULL;
     
    579579   bfd_ecoff_debug_init.  */
    580580
    581 boolean
     581bfd_boolean
    582582bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap,
    583583                            input_bfd, input_debug, input_swap,
     
    625625  long oldrfdbase = 0;
    626626  bfd_byte *fdr_out;
     627  bfd_size_type amt;
    627628
    628629  /* Use section_adjust to hold the value to add to a symbol in a
     
    665666  fdr_end = fdr_start + input_symhdr->ifdMax * fdr_add;
    666667
    667   input_debug->ifdmap = (RFDT *) bfd_alloc (input_bfd,
    668                                             (input_symhdr->ifdMax
    669                                              * sizeof (RFDT)));
     668  amt = input_symhdr->ifdMax;
     669  amt *= sizeof (RFDT);
     670  input_debug->ifdmap = (RFDT *) bfd_alloc (input_bfd, amt);
    670671
    671672  sz = (input_symhdr->crfd + input_symhdr->ifdMax) * external_rfd_size;
     
    674675    {
    675676      bfd_set_error (bfd_error_no_memory);
    676       return false;
     677      return FALSE;
    677678    }
    678679  if (!add_memory_shuffle (ainfo, &ainfo->rfd, &ainfo->rfd_end, rfd_out, sz))
    679     return false;
     680    return FALSE;
    680681
    681682  copied = 0;
     
    716717          name = input_debug->ss + fdr.issBase + fdr.rss;
    717718
    718           lookup = (char *) bfd_malloc (strlen (name) + 20);
     719          lookup = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 20);
    719720          if (lookup == NULL)
    720             return false;
     721            return FALSE;
    721722          sprintf (lookup, "%s %lx %lx", name, fdr.csym, fdr.caux);
    722723
    723           fh = string_hash_lookup (&ainfo->fdr_hash, lookup, true, true);
     724          fh = string_hash_lookup (&ainfo->fdr_hash, lookup, TRUE, TRUE);
    724725          free (lookup);
    725726          if (fh == (struct string_hash_entry *) NULL)
    726             return false;
     727            return FALSE;
    727728
    728729          if (fh->val != -1)
     
    775776    {
    776777      bfd_set_error (bfd_error_no_memory);
    777       return false;
     778      return FALSE;
    778779    }
    779780  if (!add_memory_shuffle (ainfo, &ainfo->fdr, &ainfo->fdr_end, fdr_out, sz))
    780     return false;
     781    return FALSE;
    781782  for (fdr_ptr = fdr_start, i = 0;
    782783       fdr_ptr < fdr_end;
     
    788789      bfd_byte *lraw_src;
    789790      bfd_byte *lraw_end;
    790       boolean fgotfilename;
     791      bfd_boolean fgotfilename;
    791792
    792793      if (input_debug->ifdmap[i] < output_symhdr->ifdMax)
     
    824825      /* Swap in the local symbols, adjust their values, and swap them
    825826         out again.  */
    826       fgotfilename = false;
     827      fgotfilename = FALSE;
    827828      sz = fdr.csym * external_sym_size;
    828829      sym_out = (bfd_byte *) objalloc_alloc (ainfo->memory, sz);
     
    830831        {
    831832          bfd_set_error (bfd_error_no_memory);
    832           return false;
     833          return FALSE;
    833834        }
    834835      if (!add_memory_shuffle (ainfo, &ainfo->sym, &ainfo->sym_end, sym_out,
    835836                               sz))
    836         return false;
     837        return FALSE;
    837838      lraw_src = ((bfd_byte *) input_debug->external_sym
    838839                  + fdr.isymBase * input_swap->external_sym_size);
     
    886887          if (! info->relocateable)
    887888            {
    888               boolean ffilename;
     889              bfd_boolean ffilename;
    889890              const char *name;
    890891
    891892              if (! fgotfilename && internal_sym.iss == fdr.rss)
    892                 ffilename = true;
     893                ffilename = TRUE;
    893894              else
    894                 ffilename = false;
     895                ffilename = FALSE;
    895896
    896897              /* Hash the name into the string table.  */
     
    902903                  struct string_hash_entry *sh;
    903904
    904                   sh = string_hash_lookup (&ainfo->str_hash, name, true, true);
     905                  sh = string_hash_lookup (&ainfo->str_hash, name, TRUE, TRUE);
    905906                  if (sh == (struct string_hash_entry *) NULL)
    906                     return false;
     907                    return FALSE;
    907908                  if (sh->val == -1)
    908909                    {
     
    922923                {
    923924                  fdr.rss = internal_sym.iss;
    924                   fgotfilename = true;
     925                  fgotfilename = TRUE;
    925926                }
    926927            }
     
    941942      if (fdr.cbLine > 0)
    942943        {
     944          file_ptr pos = input_symhdr->cbLineOffset + fdr.cbLineOffset;
    943945          if (!add_file_shuffle (ainfo, &ainfo->line, &ainfo->line_end,
    944                                  input_bfd,
    945                                  input_symhdr->cbLineOffset + fdr.cbLineOffset,
    946                                  fdr.cbLine))
    947             return false;
     946                                 input_bfd, pos, (unsigned long) fdr.cbLine))
     947            return FALSE;
    948948          fdr.ilineBase = output_symhdr->ilineMax;
    949949          fdr.cbLineOffset = output_symhdr->cbLine;
     
    953953      if (fdr.caux > 0)
    954954        {
     955          file_ptr pos = (input_symhdr->cbAuxOffset
     956                          + fdr.iauxBase * sizeof (union aux_ext));
    955957          if (!add_file_shuffle (ainfo, &ainfo->aux, &ainfo->aux_end,
    956                                  input_bfd,
    957                                  (input_symhdr->cbAuxOffset
    958                                   + fdr.iauxBase * sizeof (union aux_ext)),
     958                                 input_bfd, pos,
    959959                                 fdr.caux * sizeof (union aux_ext)))
    960             return false;
     960            return FALSE;
    961961          fdr.iauxBase = output_symhdr->iauxMax;
    962962          output_symhdr->iauxMax += fdr.caux;
     
    974974      else if (fdr.cbSs > 0)
    975975        {
     976          file_ptr pos = input_symhdr->cbSsOffset + fdr.issBase;
    976977          if (!add_file_shuffle (ainfo, &ainfo->ss, &ainfo->ss_end,
    977                                  input_bfd,
    978                                  input_symhdr->cbSsOffset + fdr.issBase,
    979                                  fdr.cbSs))
    980             return false;
     978                                 input_bfd, pos, (unsigned long) fdr.cbSs))
     979            return FALSE;
    981980          fdr.issBase = output_symhdr->issMax;
    982981          output_symhdr->issMax += fdr.cbSs;
     
    993992          if (fdr.cpd > 0)
    994993            {
     994              file_ptr pos = (input_symhdr->cbPdOffset
     995                              + fdr.ipdFirst * external_pdr_size);
     996              unsigned long size = fdr.cpd * external_pdr_size;
    995997              if (!add_file_shuffle (ainfo, &ainfo->pdr, &ainfo->pdr_end,
    996                                      input_bfd,
    997                                      (input_symhdr->cbPdOffset
    998                                       + fdr.ipdFirst * external_pdr_size),
    999                                      fdr.cpd * external_pdr_size))
    1000                 return false;
     998                                     input_bfd, pos, size))
     999                return FALSE;
    10011000            }
    10021001          BFD_ASSERT (external_opt_size == input_swap->external_opt_size);
    10031002          if (fdr.copt > 0)
    10041003            {
     1004              file_ptr pos = (input_symhdr->cbOptOffset
     1005                              + fdr.ioptBase * external_opt_size);
     1006              unsigned long size = fdr.copt * external_opt_size;
    10051007              if (!add_file_shuffle (ainfo, &ainfo->opt, &ainfo->opt_end,
    1006                                      input_bfd,
    1007                                      (input_symhdr->cbOptOffset
    1008                                       + fdr.ioptBase * external_opt_size),
    1009                                      fdr.copt * external_opt_size))
    1010                 return false;
     1008                                     input_bfd, pos, size))
     1009                return FALSE;
    10111010            }
    10121011        }
     
    10311030            {
    10321031              bfd_set_error (bfd_error_no_memory);
    1033               return false;
     1032              return FALSE;
    10341033            }
    10351034          if (!add_memory_shuffle (ainfo, &ainfo->pdr, &ainfo->pdr_end, out,
    10361035                                   sz))
    1037             return false;
     1036            return FALSE;
    10381037          for (; in < end; in += insz, out += outsz)
    10391038            {
     
    10721071            {
    10731072              bfd_set_error (bfd_error_no_memory);
    1074               return false;
     1073              return FALSE;
    10751074            }
    10761075          if (!add_memory_shuffle (ainfo, &ainfo->opt, &ainfo->opt_end, out,
    10771076                                   sz))
    1078             return false;
     1077            return FALSE;
    10791078          for (; in < end; in += insz, out += outsz)
    10801079            {
     
    11081107    }
    11091108
    1110   return true;
     1109  return TRUE;
    11111110}
    11121111
     
    11141113   Return the offset from the fdr string base.  */
    11151114
    1116 static long ecoff_add_string PARAMS ((struct accumulate *,
    1117                                       struct bfd_link_info *,
    1118                                       struct ecoff_debug_info *,
    1119                                       FDR *fdr, const char *string));
     1115static long ecoff_add_string
     1116  PARAMS ((struct accumulate *, struct bfd_link_info *,
     1117           struct ecoff_debug_info *, FDR *fdr, const char *string));
    11201118
    11211119static long
     
    11461144      struct string_hash_entry *sh;
    11471145
    1148       sh = string_hash_lookup (&ainfo->str_hash, string, true, true);
     1146      sh = string_hash_lookup (&ainfo->str_hash, string, TRUE, TRUE);
    11491147      if (sh == (struct string_hash_entry *) NULL)
    11501148        return -1;
     
    11681166/* Add debugging information from a non-ECOFF file.  */
    11691167
    1170 boolean
     1168bfd_boolean
    11711169bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug,
    11721170                                  output_swap, input_bfd, info)
     
    12051203  fdr.cbSs = 0;
    12061204  fdr.rss = ecoff_add_string (ainfo, info, output_debug, &fdr,
    1207                               bfd_get_filename (input_bfd));
     1205                              bfd_archive_filename (input_bfd));
    12081206  if (fdr.rss == -1)
    1209     return false;
     1207    return FALSE;
    12101208  fdr.isymBase = output_symhdr->isymMax;
    12111209
     
    12131211  symsize = bfd_get_symtab_upper_bound (input_bfd);
    12141212  if (symsize < 0)
    1215     return false;
    1216   symbols = (asymbol **) bfd_alloc (output_bfd, symsize);
     1213    return FALSE;
     1214  symbols = (asymbol **) bfd_alloc (output_bfd, (bfd_size_type) symsize);
    12171215  if (symbols == (asymbol **) NULL)
    1218     return false;
     1216    return FALSE;
    12191217  symcount = bfd_canonicalize_symtab (input_bfd, symbols);
    12201218  if (symcount < 0)
    1221     return false;
     1219    return FALSE;
    12221220  sym_end = symbols + symcount;
    12231221
     
    12371235
    12381236      if (internal_sym.iss == -1)
    1239         return false;
     1237        return FALSE;
    12401238      if (bfd_is_com_section ((*sym_ptr)->section)
    12411239          || bfd_is_und_section ((*sym_ptr)->section))
     
    12541252        {
    12551253          bfd_set_error (bfd_error_no_memory);
    1256           return false;
     1254          return FALSE;
    12571255        }
    12581256      (*swap_sym_out) (output_bfd, &internal_sym, external_sym);
    12591257      add_memory_shuffle (ainfo, &ainfo->sym, &ainfo->sym_end,
    1260                           external_sym, output_swap->external_sym_size);
     1258                          external_sym,
     1259                          (unsigned long) output_swap->external_sym_size);
    12611260      ++fdr.csym;
    12621261      ++output_symhdr->isymMax;
     
    12741273    {
    12751274      bfd_set_error (bfd_error_no_memory);
    1276       return false;
     1275      return FALSE;
    12771276    }
    12781277  (*output_swap->swap_fdr_out) (output_bfd, &fdr, external_fdr);
    12791278  add_memory_shuffle (ainfo, &ainfo->fdr, &ainfo->fdr_end,
    1280                       external_fdr, output_swap->external_fdr_size);
     1279                      external_fdr,
     1280                      (unsigned long) output_swap->external_fdr_size);
    12811281
    12821282  ++output_symhdr->ifdMax;
    12831283
    1284   return true;
     1284  return TRUE;
    12851285}
    12861286
     
    12901290   this interface, so that must be changed to do something else.  */
    12911291
    1292 boolean
     1292bfd_boolean
    12931293bfd_ecoff_debug_externals (abfd, debug, swap, relocateable, get_extr,
    12941294                           set_index)
     
    12961296     struct ecoff_debug_info *debug;
    12971297     const struct ecoff_debug_swap *swap;
    1298      boolean relocateable;
    1299      boolean (*get_extr) PARAMS ((asymbol *, EXTR *));
     1298     bfd_boolean relocateable;
     1299     bfd_boolean (*get_extr) PARAMS ((asymbol *, EXTR *));
    13001300     void (*set_index) PARAMS ((asymbol *, bfd_size_type));
    13011301{
     
    13061306  sym_ptr_ptr = bfd_get_outsymbols (abfd);
    13071307  if (sym_ptr_ptr == NULL)
    1308     return true;
     1308    return TRUE;
    13091309
    13101310  for (c = bfd_get_symcount (abfd); c > 0; c--, sym_ptr_ptr++)
     
    13161316
    13171317      /* Get the external symbol information.  */
    1318       if ((*get_extr) (sym_ptr, &esym) == false)
     1318      if (! (*get_extr) (sym_ptr, &esym))
    13191319        continue;
    13201320
    13211321      /* If we're producing an executable, move common symbols into
    13221322         bss.  */
    1323       if (relocateable == false)
     1323      if (! relocateable)
    13241324        {
    13251325          if (esym.asym.sc == scCommon)
     
    13511351      if (! bfd_ecoff_debug_one_external (abfd, debug, swap,
    13521352                                          sym_ptr->name, &esym))
    1353         return false;
    1354     }
    1355 
    1356   return true;
     1353        return FALSE;
     1354    }
     1355
     1356  return TRUE;
    13571357}
    13581358
    13591359/* Add a single external symbol to the debugging information.  */
    13601360
    1361 boolean
     1361bfd_boolean
    13621362bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym)
    13631363     bfd *abfd;
     
    13781378      < symhdr->issExtMax + namelen + 1)
    13791379    {
    1380       if (ecoff_add_bytes ((char **) &debug->ssext,
    1381                            (char **) &debug->ssext_end,
    1382                            symhdr->issExtMax + namelen + 1)
    1383           == false)
    1384         return false;
     1380      if (! ecoff_add_bytes ((char **) &debug->ssext,
     1381                             (char **) &debug->ssext_end,
     1382                             symhdr->issExtMax + namelen + 1))
     1383        return FALSE;
    13851384    }
    13861385  if ((size_t) ((char *) debug->external_ext_end
     
    13881387      < (symhdr->iextMax + 1) * external_ext_size)
    13891388    {
    1390       if (ecoff_add_bytes ((char **) &debug->external_ext,
    1391                            (char **) &debug->external_ext_end,
    1392                            (symhdr->iextMax + 1) * external_ext_size)
    1393           == false)
    1394         return false;
     1389      if (! ecoff_add_bytes ((char **) &debug->external_ext,
     1390                             (char **) &debug->external_ext_end,
     1391                             (symhdr->iextMax + 1) * (size_t) external_ext_size))
     1392        return FALSE;
    13951393    }
    13961394
     
    14061404  symhdr->issExtMax += namelen + 1;
    14071405
    1408   return true;
     1406  return TRUE;
    14091407}
    14101408
     
    15071505   correctly.  */
    15081506
    1509 static boolean
     1507static bfd_boolean
    15101508ecoff_write_symhdr (abfd, debug, swap, where)
    15111509     bfd *abfd;
     
    15211519  /* Go to the right location in the file.  */
    15221520  if (bfd_seek (abfd, where, SEEK_SET) != 0)
    1523     return false;
     1521    return FALSE;
    15241522
    15251523  where += swap->external_hdr_size;
     
    15501548#undef SET
    15511549
    1552   buff = (PTR) bfd_malloc ((size_t) swap->external_hdr_size);
     1550  buff = (PTR) bfd_malloc (swap->external_hdr_size);
    15531551  if (buff == NULL && swap->external_hdr_size != 0)
    15541552    goto error_return;
    15551553
    15561554  (*swap->swap_hdr_out) (abfd, symhdr, buff);
    1557   if (bfd_write (buff, 1, swap->external_hdr_size, abfd)
     1555  if (bfd_bwrite (buff, swap->external_hdr_size, abfd)
    15581556      != swap->external_hdr_size)
    15591557    goto error_return;
     
    15611559  if (buff != NULL)
    15621560    free (buff);
    1563   return true;
     1561  return TRUE;
    15641562 error_return:
    15651563  if (buff != NULL)
    15661564    free (buff);
    1567   return false;
     1565  return FALSE;
    15681566}
    15691567
     
    15741572   symbolic header.  */
    15751573
    1576 boolean
     1574bfd_boolean
    15771575bfd_ecoff_write_debug (abfd, debug, swap, where)
    15781576     bfd *abfd;
     
    15841582
    15851583  if (! ecoff_write_symhdr (abfd, debug, swap, where))
    1586     return false;
     1584    return FALSE;
    15871585
    15881586#define WRITE(ptr, count, size, offset) \
    15891587  BFD_ASSERT (symhdr->offset == 0 \
    15901588              || (bfd_vma) bfd_tell (abfd) == symhdr->offset); \
    1591   if (bfd_write ((PTR) debug->ptr, size, symhdr->count, abfd) \
     1589  if (bfd_bwrite ((PTR) debug->ptr, (bfd_size_type) size * symhdr->count, abfd)\
    15921590      != size * symhdr->count) \
    1593     return false;
     1591    return FALSE;
    15941592
    15951593  WRITE (line, cbLine, sizeof (unsigned char), cbLineOffset);
     
    15981596  WRITE (external_sym, isymMax, swap->external_sym_size, cbSymOffset);
    15991597  WRITE (external_opt, ioptMax, swap->external_opt_size, cbOptOffset);
    1600   WRITE (external_aux, iauxMax, sizeof (union aux_ext), cbAuxOffset);
     1598  WRITE (external_aux, iauxMax, (bfd_size_type) sizeof (union aux_ext),
     1599         cbAuxOffset);
    16011600  WRITE (ss, issMax, sizeof (char), cbSsOffset);
    16021601  WRITE (ssext, issExtMax, sizeof (char), cbSsExtOffset);
     
    16061605#undef WRITE
    16071606
    1608   return true;
     1607  return TRUE;
    16091608}
    16101609
    16111610/* Write out a shuffle list.  */
    16121611
    1613 static boolean ecoff_write_shuffle PARAMS ((bfd *,
    1614                                             const struct ecoff_debug_swap *,
    1615                                             struct shuffle *, PTR space));
    1616 
    1617 static boolean
     1612static bfd_boolean ecoff_write_shuffle
     1613  PARAMS ((bfd *, const struct ecoff_debug_swap *, struct shuffle *,
     1614          PTR space));
     1615
     1616static bfd_boolean
    16181617ecoff_write_shuffle (abfd, swap, shuffle, space)
    16191618     bfd *abfd;
     
    16301629      if (! l->filep)
    16311630        {
    1632           if (bfd_write (l->u.memory, 1, l->size, abfd) != l->size)
    1633             return false;
     1631          if (bfd_bwrite (l->u.memory, (bfd_size_type) l->size, abfd)
     1632              != l->size)
     1633            return FALSE;
    16341634        }
    16351635      else
    16361636        {
    16371637          if (bfd_seek (l->u.file.input_bfd, l->u.file.offset, SEEK_SET) != 0
    1638               || bfd_read (space, 1, l->size, l->u.file.input_bfd) != l->size
    1639               || bfd_write (space, 1, l->size, abfd) != l->size)
    1640             return false;
     1638              || bfd_bread (space, (bfd_size_type) l->size,
     1639                           l->u.file.input_bfd) != l->size
     1640              || bfd_bwrite (space, (bfd_size_type) l->size, abfd) != l->size)
     1641            return FALSE;
    16411642        }
    16421643      total += l->size;
     
    16491650
    16501651      i = swap->debug_align - (total & (swap->debug_align - 1));
    1651       s = (bfd_byte *) bfd_malloc (i);
     1652      s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i);
    16521653      if (s == NULL && i != 0)
    1653         return false;
    1654 
    1655       memset ((PTR) s, 0, i);
    1656       if (bfd_write ((PTR) s, 1, i, abfd) != i)
     1654        return FALSE;
     1655
     1656      if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
    16571657        {
    16581658          free (s);
    1659           return false;
     1659          return FALSE;
    16601660        }
    16611661      free (s);
    16621662    }
    16631663
    1664   return true;
     1664  return TRUE;
    16651665}
    16661666
     
    16681668   information.  */
    16691669
    1670 boolean
     1670bfd_boolean
    16711671bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where)
    16721672     PTR handle;
     
    16791679  struct accumulate *ainfo = (struct accumulate *) handle;
    16801680  PTR space = NULL;
     1681  bfd_size_type amt;
    16811682
    16821683  if (! ecoff_write_symhdr (abfd, debug, swap, where))
    16831684    goto error_return;
    16841685
    1685   space = (PTR) bfd_malloc (ainfo->largest_file_shuffle);
     1686  amt = ainfo->largest_file_shuffle;
     1687  space = (PTR) bfd_malloc (amt);
    16861688  if (space == NULL && ainfo->largest_file_shuffle != 0)
    16871689    goto error_return;
     
    17101712      BFD_ASSERT (ainfo->ss == (struct shuffle *) NULL);
    17111713      null = 0;
    1712       if (bfd_write ((PTR) &null, 1, 1, abfd) != 1)
     1714      if (bfd_bwrite ((PTR) &null, (bfd_size_type) 1, abfd) != 1)
    17131715        goto error_return;
    17141716      total = 1;
     
    17211723
    17221724          len = strlen (sh->root.string);
    1723           if (bfd_write ((PTR) sh->root.string, 1, len + 1, abfd) != len + 1)
     1725          amt = len + 1;
     1726          if (bfd_bwrite ((PTR) sh->root.string, amt, abfd) != amt)
    17241727            goto error_return;
    17251728          total += len + 1;
     
    17321735
    17331736          i = swap->debug_align - (total & (swap->debug_align - 1));
    1734           s = (bfd_byte *) bfd_malloc (i);
     1737          s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i);
    17351738          if (s == NULL && i != 0)
    17361739            goto error_return;
    1737           memset ((PTR) s, 0, i);
    1738           if (bfd_write ((PTR) s, 1, i, abfd) != i)
     1740
     1741          if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
    17391742            {
    17401743              free (s);
     
    17471750  /* The external strings and symbol are not converted over to using
    17481751     shuffles.  FIXME: They probably should be.  */
    1749   if (bfd_write (debug->ssext, 1, debug->symbolic_header.issExtMax, abfd)
    1750       != (bfd_size_type) debug->symbolic_header.issExtMax)
     1752  amt = debug->symbolic_header.issExtMax;
     1753  if (bfd_bwrite (debug->ssext, amt, abfd) != amt)
    17511754    goto error_return;
    17521755  if ((debug->symbolic_header.issExtMax & (swap->debug_align - 1)) != 0)
     
    17571760      i = (swap->debug_align
    17581761           - (debug->symbolic_header.issExtMax & (swap->debug_align - 1)));
    1759       s = (bfd_byte *) bfd_malloc (i);
     1762      s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i);
    17601763      if (s == NULL && i != 0)
    17611764        goto error_return;
    1762       memset ((PTR) s, 0, i);
    1763       if (bfd_write ((PTR) s, 1, i, abfd) != i)
     1765
     1766      if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i)
    17641767        {
    17651768          free (s);
     
    17771780                  == (bfd_vma) bfd_tell (abfd)));
    17781781
    1779   if (bfd_write (debug->external_ext, swap->external_ext_size,
    1780                  debug->symbolic_header.iextMax, abfd)
    1781       != debug->symbolic_header.iextMax * swap->external_ext_size)
     1782  amt = debug->symbolic_header.iextMax * swap->external_ext_size;
     1783  if (bfd_bwrite (debug->external_ext, amt, abfd) != amt)
    17821784    goto error_return;
    17831785
    17841786  if (space != NULL)
    17851787    free (space);
    1786   return true;
     1788  return TRUE;
    17871789
    17881790 error_return:
    17891791  if (space != NULL)
    17901792    free (space);
    1791   return false;
     1793  return FALSE;
    17921794}
    17931795
     
    18211823   search.  */
    18221824
    1823 static boolean
     1825static bfd_boolean
    18241826mk_fdrtab (abfd, debug_info, debug_swap, line_info)
    18251827     bfd *abfd;
     
    18321834  FDR *fdr_start;
    18331835  FDR *fdr_end;
    1834   boolean stabs;
     1836  bfd_boolean stabs;
    18351837  long len;
     1838  bfd_size_type amt;
    18361839
    18371840  fdr_start = debug_info->fdr;
    18381841  fdr_end = fdr_start + debug_info->symbolic_header.ifdMax;
    18391842
    1840   /* First, let's see how long the table needs to be: */
     1843  /* First, let's see how long the table needs to be. */
    18411844  for (len = 0, fdr_ptr = fdr_start; fdr_ptr < fdr_end; fdr_ptr++)
    18421845    {
    1843       if (fdr_ptr->cpd == 0)    /* skip FDRs that have no PDRs */
     1846      if (fdr_ptr->cpd == 0)    /* Skip FDRs that have no PDRs. */
    18441847        continue;
    18451848      ++len;
    18461849    }
    18471850
    1848   /* Now, create and fill in the table: */
    1849 
    1850   line_info->fdrtab = ((struct ecoff_fdrtab_entry*)
    1851                        bfd_zalloc (abfd,
    1852                                    len * sizeof (struct ecoff_fdrtab_entry)));
     1851  /* Now, create and fill in the table.  */
     1852  amt = (bfd_size_type) len * sizeof (struct ecoff_fdrtab_entry);
     1853  line_info->fdrtab = (struct ecoff_fdrtab_entry*) bfd_zalloc (abfd, amt);
    18531854  if (line_info->fdrtab == NULL)
    1854     return false;
     1855    return FALSE;
    18551856  line_info->fdrtab_len = len;
    18561857
     
    18641865         a file with stabs debugging information, the second local
    18651866         symbol is named @stabs.  */
    1866       stabs = false;
     1867      stabs = FALSE;
    18671868      if (fdr_ptr->csym >= 2)
    18681869        {
     
    18711872
    18721873          sym_ptr = ((char *) debug_info->external_sym
    1873                      + (fdr_ptr->isymBase + 1)*debug_swap->external_sym_size);
     1874                     + (fdr_ptr->isymBase + 1) * debug_swap->external_sym_size);
    18741875          (*debug_swap->swap_sym_in) (abfd, sym_ptr, &sym);
    18751876          if (strcmp (debug_info->ss + fdr_ptr->issBase + sym.iss,
    18761877                      STABS_SYMBOL) == 0)
    1877             stabs = true;
     1878            stabs = TRUE;
    18781879        }
    18791880
    18801881      if (!stabs)
    18811882        {
    1882           bfd_size_type external_pdr_size;
    1883           char *pdr_ptr;
    1884           PDR pdr;
    1885 
    1886           external_pdr_size = debug_swap->external_pdr_size;
    1887 
    1888           pdr_ptr = ((char *) debug_info->external_pdr
    1889                      + fdr_ptr->ipdFirst * external_pdr_size);
    1890           (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr);
     1883          /* eraxxon: There are at least two problems with this computation:
     1884             1) PDRs do *not* contain offsets but full vma's; and typically the
     1885             address of the first PDR is the address of the FDR, which will
     1886             make (most) of the results of the original computation 0!
     1887             2) Once in a wacky while, the Compaq compiler generated PDR
     1888             addresses do not equal the FDR vma, but they (the PDR address)
     1889             are still vma's and not offsets.  Cf. comments in
     1890             'lookup_line'.  */
     1891#if 0
     1892            bfd_size_type external_pdr_size;
     1893            char *pdr_ptr;
     1894            PDR pdr;
     1895           
     1896            external_pdr_size = debug_swap->external_pdr_size;
     1897           
     1898            pdr_ptr = ((char *) debug_info->external_pdr
     1899                      + fdr_ptr->ipdFirst * external_pdr_size);
     1900            (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr);
    18911901          /* The address of the first PDR is the offset of that
    18921902             procedure relative to the beginning of file FDR.  */
    1893           tab->base_addr = fdr_ptr->adr - pdr.adr;
     1903            tab->base_addr = fdr_ptr->adr - pdr.adr;
     1904#else
     1905          /* The address of the first PDR is the offset of that
     1906             procedure relative to the beginning of file FDR.  */
     1907          tab->base_addr = fdr_ptr->adr;
     1908#endif
    18941909        }
    18951910      else
    18961911        {
    18971912          /* XXX I don't know about stabs, so this is a guess
    1898              (davidm@cs.arizona.edu): */
     1913             (davidm@cs.arizona.edu). */
    18991914          tab->base_addr = fdr_ptr->adr;
    19001915        }
     
    19071922     static functions in include files), where this does not hold.
    19081923     Use "odump -PFv" to verify...  */
    1909   qsort ((PTR) line_info->fdrtab, len,
     1924  qsort ((PTR) line_info->fdrtab, (size_t) len,
    19101925         sizeof (struct ecoff_fdrtab_entry), cmp_fdrtab_entry);
    19111926
    1912   return true;
     1927  return TRUE;
    19131928}
    19141929
     
    19401955        low = mid + 1;
    19411956    }
     1957
     1958  /* eraxxon: at this point 'offset' is either lower than the lowest entry or
     1959     higher than the highest entry. In the former case high = low = mid = 0;
     1960     we want to return -1.  In the latter case, low = high and mid = low - 1;
     1961     we want to return the index of the highest entry.  Only in former case
     1962     will the following 'catch-all' test be true.  */
    19421963  ++mid;
    19431964
    1944   /* last entry is catch-all for all higher addresses: */
     1965  /* Last entry is catch-all for all higher addresses. */
    19451966  if (offset < tab[mid].base_addr)
    19461967    return -1;
     
    19481969 find_min:
    19491970
     1971  /* eraxxon: There may be multiple FDRs in the table with the
     1972     same base_addr; make sure that we are at the first one.  */
    19501973  while (mid > 0 && tab[mid - 1].base_addr == tab[mid].base_addr)
    19511974    --mid;
     
    19571980   LINE_INFO->cache.  */
    19581981
    1959 static boolean
     1982static bfd_boolean
    19601983lookup_line (abfd, debug_info, debug_swap, line_info)
    19611984     bfd *abfd;
     
    19661989  struct ecoff_fdrtab_entry *tab;
    19671990  bfd_vma offset;
    1968   boolean stabs;
     1991  bfd_boolean stabs;
    19691992  FDR *fdr_ptr;
    19701993  int i;
    19711994
     1995  /* eraxxon: note that 'offset' is the full vma, not a section offset.  */
    19721996  offset = line_info->cache.start;
    19731997
     
    19762000  if (line_info->fdrtab == NULL
    19772001      && !mk_fdrtab (abfd, debug_info, debug_swap, line_info))
    1978     return false;
     2002    return FALSE;
    19792003
    19802004  tab = line_info->fdrtab;
    19812005
    1982   /* find first FDR for address OFFSET */
     2006  /* Find first FDR for address OFFSET. */
    19832007  i = fdrtab_lookup (line_info, offset);
    19842008  if (i < 0)
    1985     return false;               /* no FDR, no fun...  */
     2009    return FALSE;               /* no FDR, no fun...  */
     2010 
     2011  /* eraxxon: 'fdrtab_lookup' doesn't give what we want, at least for Compaq's
     2012     C++ compiler 6.2.  Consider three FDRs with starting addresses of x, y,
     2013     and z, respectively, such that x < y < z.  Assume further that
     2014     y < 'offset' < z.  It is possble at times that the PDR for 'offset' is
     2015     associated with FDR x and *not* with FDR y.  Erg!!
     2016
     2017     From a binary dump of my C++ test case 'moo' using Compaq's coffobjanl
     2018     (output format has been edited for our purposes):
     2019
     2020     FDR [2]: (main.C): First instruction: 0x12000207c <x>
     2021       PDR [5] for File [2]: LoopTest__Xv                 <0x1200020a0> (a)
     2022       PDR [7] for File [2]: foo__Xv                      <0x120002168>
     2023     FDR [1]: (-1):     First instruction: 0x1200020e8 <y>
     2024       PDR [3] for File [1]:                              <0x120001ad0> (b)
     2025     FDR [6]: (-1):     First instruction: 0x1200026f0 <z>
     2026
     2027     (a) In the case of PDR5, the vma is such that the first few instructions
     2028     of the procedure can be found.  But since the size of this procedure is
     2029     160b, the vma will soon cross into the 'address space' of FDR1 and no
     2030     debugging info will be found.  How repugnant!
     2031
     2032     (b) It is also possible for a PDR to have a *lower* vma than its associated
     2033     FDR; see FDR1 and PDR3.  Gross!
     2034
     2035     Since the FDRs that are causing so much havok (in this case) 1) do not
     2036     describe actual files (fdr.rss == -1), and 2) contain only compiler
     2037     genarated routines, I thought a simple fix would be to exclude them from
     2038     the FDR table in 'mk_fdrtab'.  But, besides not knowing for certain
     2039     whether this would be correct, it creates an additional problem.  If we
     2040     happen to ask for source file info on a compiler generated (procedure)
     2041     symbol -- which is still in the symbol table -- the result can be
     2042     information from a real procedure!  This is because compiler generated
     2043     procedures with vma's higher than the last FDR in the fdr table will be
     2044     associated with a PDR from this FDR, specifically the PDR with the
     2045     highest vma.  This wasn't a problem before, because each procedure had a
     2046     PDR.  (Yes, this problem could be eliminated if we kept the size of the
     2047     last PDR around, but things are already getting ugly).
     2048
     2049     Probably, a better solution would be to have a sorted PDR table.  Each
     2050     PDR would have a pointer to its FDR so file information could still be
     2051     obtained.  A FDR table could still be constructed if necessary -- since
     2052     it only contains pointers, not much extra memory would be used -- but
     2053     the PDR table would be searched to locate debugging info.
     2054
     2055     There is still at least one remaining issue.  Sometimes a FDR can have a
     2056     bogus name, but contain PDRs that should belong to another FDR with a
     2057     real name.  E.g:
     2058
     2059     FDR [3]: 0000000120001b50 (/home/.../Array.H~alt~deccxx_5E5A62AD)
     2060       PDR [a] for File [3]: 0000000120001b50
     2061       PDR [b] for File [3]: 0000000120001cf0
     2062       PDR [c] for File [3]: 0000000120001dc8
     2063       PDR [d] for File [3]: 0000000120001e40
     2064       PDR [e] for File [3]: 0000000120001eb8
     2065       PDR [f] for File [3]: 0000000120001f4c
     2066     FDR [4]: 0000000120001b50 (/home/.../Array.H)
     2067
     2068     Here, FDR4 has the correct name, but should (seemingly) contain PDRa-f.
     2069     The symbol table for PDR4 does contain symbols for PDRa-f, but so does
     2070     the symbol table for FDR3.  However the former is different; perhaps this
     2071     can be detected easily. (I'm not sure at this point.)  This problem only
     2072     seems to be associated with files with templates.  I am assuming the idea
     2073     is that there is a 'fake' FDR (with PDRs) for each differently typed set
     2074     of templates that must be generated.  Currently, FDR4 is completely
     2075     excluded from the FDR table in 'mk_fdrtab' because it contains no PDRs.
     2076
     2077     Since I don't have time to prepare a real fix for this right now, be
     2078     prepared for 'A Horrible Hack' to force the inspection of all non-stabs
     2079     FDRs.  It's coming...  */
    19862080  fdr_ptr = tab[i].fdr;
    19872081
     
    19892083     file with stabs debugging information, the second local symbol is
    19902084     named @stabs.  */
    1991   stabs = false;
     2085  stabs = FALSE;
    19922086  if (fdr_ptr->csym >= 2)
    19932087    {
     
    20002094      if (strcmp (debug_info->ss + fdr_ptr->issBase + sym.iss,
    20012095                  STABS_SYMBOL) == 0)
    2002         stabs = true;
     2096        stabs = TRUE;
    20032097    }
    20042098
     
    20092103      char *best_pdr = NULL;
    20102104      FDR *best_fdr;
    2011       bfd_vma best_dist = ~0;
     2105      bfd_signed_vma best_dist = -1;
    20122106      PDR pdr;
    20132107      unsigned char *line_ptr;
     
    20712165      external_pdr_size = debug_swap->external_pdr_size;
    20722166
    2073       /* Make offset relative to object file's start-address: */
     2167#if 0 /* eraxxon: PDR addresses (pdr.adr) are not relative to FDRs!
     2168         Leave 'offset' alone.  */
     2169      /* Make offset relative to object file's start-address.  */
    20742170      offset -= tab[i].base_addr;
     2171#endif
     2172      /* eraxxon: The Horrible Hack: Because of the problems above, set 'i'
     2173         to 0 so we look through all FDRs.
     2174
     2175         Because FDR's without any symbols are assumed to be non-stabs,
     2176         searching through all FDRs may cause the following code to try to
     2177         read stabs FDRs as ECOFF ones.  However, I don't think this will
     2178         harm anything.  */
     2179      i = 0;
     2180     
    20752181      /* Search FDR list starting at tab[i] for the PDR that best matches
    20762182         OFFSET.  Normally, the FDR list is only one entry long.  */
     
    20782184      do
    20792185        {
    2080           bfd_vma dist, min_dist = 0;
     2186          /* eraxxon: 'dist' and 'min_dist' can be negative now
     2187             because we iterate over every FDR rather than just ones
     2188             with a base address less than or equal to 'offset'.  */
     2189          bfd_signed_vma dist = -1, min_dist = -1;
    20812190          char *pdr_hold;
    20822191          char *pdr_end;
     
    21012210                {
    21022211                  dist = offset - (pdr.adr - 0x10 * pdr.prof);
    2103                   if (!pdr_hold || dist < min_dist)
     2212
     2213                  /* eraxxon: 'dist' can be negative now.  Note that
     2214                     'min_dist' can be negative if 'pdr_hold' below is NULL.  */
     2215                  if (!pdr_hold || (dist >= 0 && dist < min_dist))
    21042216                    {
    21052217                      min_dist = dist;
     
    21092221            }
    21102222
    2111           if (!best_pdr || min_dist < best_dist)
     2223          if (!best_pdr || (min_dist >= 0 && min_dist < best_dist))
    21122224            {
    2113               best_dist = min_dist;
     2225              best_dist = (bfd_vma) min_dist; 
    21142226              best_fdr = fdr_ptr;
    21152227              best_pdr = pdr_hold;
    21162228            }
    2117           /* continue looping until base_addr of next entry is different: */
    2118         }
    2119       while (++i < line_info->fdrtab_len
    2120              && tab[i].base_addr == tab[i - 1].base_addr);
     2229          /* Continue looping until base_addr of next entry is different.  */
     2230        }
     2231      /* eraxxon: We want to iterate over all FDRs.
     2232         See previous comment about 'fdrtab_lookup'.  */
     2233      while (++i < line_info->fdrtab_len);
    21212234
    21222235      if (!best_fdr || !best_pdr)
    2123         return false;                   /* shouldn't happen...  */
    2124 
    2125       /* phew, finally we got something that we can hold onto: */
     2236        return FALSE;                   /* Shouldn't happen...  */
     2237
     2238      /* Phew, finally we got something that we can hold onto. */
    21262239      fdr_ptr = best_fdr;
    21272240      pdr_ptr = best_pdr;
     
    21332246      line_end = debug_info->line + fdr_ptr->cbLineOffset + fdr_ptr->cbLine;
    21342247
    2135       /* Make offset relative to procedure entry: */
     2248      /* Make offset relative to procedure entry. */
    21362249      offset -= pdr.adr - 0x10 * pdr.prof;
    21372250      lineno = pdr.lnLow;
     
    22142327      bfd_vma low_func_vma;
    22152328      bfd_vma low_line_vma;
    2216       boolean past_line;
    2217       boolean past_fn;
     2329      bfd_boolean past_line;
     2330      bfd_boolean past_fn;
    22182331      char *sym_ptr, *sym_ptr_end;
    22192332      size_t len, funclen;
     
    22412354      low_func_vma = 0;
    22422355      low_line_vma = 0;
    2243       past_line = false;
    2244       past_fn = false;
     2356      past_line = FALSE;
     2357      past_fn = FALSE;
    22452358
    22462359      external_sym_size = debug_swap->external_sym_size;
     
    22922405                case N_FUN:
    22932406                  if (sym.value > offset)
    2294                     past_fn = true;
     2407                    past_fn = TRUE;
    22952408                  else if (sym.value >= low_func_vma)
    22962409                    {
     
    23052418            {
    23062419              if (sym.value > offset)
    2307                 past_line = true;
     2420                past_line = TRUE;
    23082421              else if (sym.value >= low_line_vma)
    23092422                {
     
    23352448          if (line_info->find_buffer != NULL)
    23362449            free (line_info->find_buffer);
    2337           buffer = (char *) bfd_malloc (len);
     2450          buffer = (char *) bfd_malloc ((bfd_size_type) len);
    23382451          if (buffer == NULL)
    2339             return false;
     2452            return FALSE;
    23402453          line_info->find_buffer = buffer;
    23412454        }
     
    23652478    }
    23662479
    2367   return true;
     2480  return TRUE;
    23682481}
    23692482
    23702483/* Do the work of find_nearest_line.  */
    23712484
    2372 boolean
     2485bfd_boolean
    23732486_bfd_ecoff_locate_line (abfd, section, offset, debug_info, debug_swap,
    23742487                        line_info, filename_ptr, functionname_ptr, retline_ptr)
     
    23962509        {
    23972510          line_info->cache.sect = NULL;
    2398           return false;
     2511          return FALSE;
    23992512        }
    24002513    }
     
    24042517  *retline_ptr = line_info->cache.line_num;
    24052518
    2406   return true;
     2519  return TRUE;
    24072520}
    24082521
     
    24182531/* Collect a shuffle into a memory buffer.  */
    24192532
    2420 static boolean ecoff_collect_shuffle PARAMS ((struct shuffle *, bfd_byte *));
    2421 
    2422 static boolean
     2533static bfd_boolean ecoff_collect_shuffle
     2534  PARAMS ((struct shuffle *, bfd_byte *));
     2535
     2536static bfd_boolean
    24232537ecoff_collect_shuffle (l, buff)
    24242538     struct shuffle *l;
     
    24352549        {
    24362550          if (bfd_seek (l->u.file.input_bfd, l->u.file.offset, SEEK_SET) != 0
    2437               || bfd_read (buff, 1, l->size, l->u.file.input_bfd) != l->size)
    2438             return false;
     2551              || (bfd_bread (buff, (bfd_size_type) l->size, l->u.file.input_bfd)
     2552                  != l->size))
     2553            return FALSE;
    24392554        }
    24402555      total += l->size;
     
    24422557    }
    24432558
    2444   return true;
     2559  return TRUE;
    24452560}
    24462561
    24472562/* Copy PDR information into a memory buffer.  */
    24482563
    2449 boolean
     2564bfd_boolean
    24502565_bfd_ecoff_get_accumulated_pdr (handle, buff)
    24512566     PTR handle;
     
    24592574/* Copy symbol information into a memory buffer.  */
    24602575
    2461 boolean
     2576bfd_boolean
    24622577_bfd_ecoff_get_accumulated_sym (handle, buff)
    24632578     PTR handle;
     
    24712586/* Copy the string table into a memory buffer.  */
    24722587
    2473 boolean
     2588bfd_boolean
    24742589_bfd_ecoff_get_accumulated_ss (handle, buff)
    24752590     PTR handle;
     
    24982613    }
    24992614
    2500   return true;
    2501 }
     2615  return TRUE;
     2616}
Note: See TracChangeset for help on using the changeset viewer.