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

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* COFF specific linker code.
    2    Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
     2   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
    33   Free Software Foundation, Inc.
    44   Written by Ian Lance Taylor, Cygnus Support.
     
    2929#include "libcoff.h"
    3030
    31 static boolean coff_link_add_object_symbols
     31static bfd_boolean coff_link_add_object_symbols
    3232  PARAMS ((bfd *, struct bfd_link_info *));
    33 static boolean coff_link_check_archive_element
    34   PARAMS ((bfd *, struct bfd_link_info *, boolean *));
    35 static boolean coff_link_check_ar_symbols
    36   PARAMS ((bfd *, struct bfd_link_info *, boolean *));
    37 static boolean coff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *));
    38 static char *dores_com PARAMS ((char *, bfd *, int));
    39 static char *get_name PARAMS ((char *, char **));
     33static bfd_boolean coff_link_check_archive_element
     34  PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *));
     35static bfd_boolean coff_link_check_ar_symbols
     36  PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *));
     37static bfd_boolean coff_link_add_symbols
     38  PARAMS ((bfd *, struct bfd_link_info *));
     39static char *dores_com
     40  PARAMS ((char *, bfd *, int));
     41static char *get_name
     42  PARAMS ((char *, char **));
    4043static int process_embedded_commands
    4144  PARAMS ((bfd *, struct bfd_link_info *, bfd *));
    42 static void mark_relocs PARAMS ((struct coff_final_link_info *, bfd *));
    43 
    44 /* Return true if SYM is a weak, external symbol.  */
     45static void mark_relocs
     46  PARAMS ((struct coff_final_link_info *, bfd *));
     47
     48/* Return TRUE if SYM is a weak, external symbol.  */
    4549#define IS_WEAK_EXTERNAL(abfd, sym)                     \
    4650  ((sym).n_sclass == C_WEAKEXT                          \
    4751   || (obj_pe (abfd) && (sym).n_sclass == C_NT_WEAK))
    4852
    49 /* Return true if SYM is an external symbol.  */
     53/* Return TRUE if SYM is an external symbol.  */
    5054#define IS_EXTERNAL(abfd, sym)                          \
    5155  ((sym).n_sclass == C_EXT || IS_WEAK_EXTERNAL (abfd, sym))
     
    99103/* Initialize a COFF linker hash table.  */
    100104
    101 boolean
     105bfd_boolean
    102106_bfd_coff_link_hash_table_init (table, abfd, newfunc)
    103107     struct coff_link_hash_table *table;
     
    118122{
    119123  struct coff_link_hash_table *ret;
    120 
    121   ret = ((struct coff_link_hash_table *)
    122          bfd_alloc (abfd, sizeof (struct coff_link_hash_table)));
     124  bfd_size_type amt = sizeof (struct coff_link_hash_table);
     125
     126  ret = (struct coff_link_hash_table *) bfd_malloc (amt);
    123127  if (ret == NULL)
    124128    return NULL;
     
    126130                                        _bfd_coff_link_hash_newfunc))
    127131    {
    128       bfd_release (abfd, ret);
     132      free (ret);
    129133      return (struct bfd_link_hash_table *) NULL;
    130134    }
     
    167171   appropriate.  */
    168172
    169 boolean
     173bfd_boolean
    170174_bfd_coff_link_add_symbols (abfd, info)
    171175     bfd *abfd;
     
    181185    default:
    182186      bfd_set_error (bfd_error_wrong_format);
    183       return false;
     187      return FALSE;
    184188    }
    185189}
     
    187191/* Add symbols from a COFF object file.  */
    188192
    189 static boolean
     193static bfd_boolean
    190194coff_link_add_object_symbols (abfd, info)
    191195     bfd *abfd;
     
    193197{
    194198  if (! _bfd_coff_get_external_symbols (abfd))
    195     return false;
     199    return FALSE;
    196200  if (! coff_link_add_symbols (abfd, info))
    197     return false;
     201    return FALSE;
    198202
    199203  if (! info->keep_memory)
    200204    {
    201205      if (! _bfd_coff_free_symbols (abfd))
    202         return false;
    203     }
    204   return true;
     206        return FALSE;
     207    }
     208  return TRUE;
    205209}
    206210
     
    210214   _bfd_generic_link_add_archive_symbols.  */
    211215
    212 static boolean
     216static bfd_boolean
    213217coff_link_check_archive_element (abfd, info, pneeded)
    214218     bfd *abfd;
    215219     struct bfd_link_info *info;
    216      boolean *pneeded;
     220     bfd_boolean *pneeded;
    217221{
    218222  if (! _bfd_coff_get_external_symbols (abfd))
    219     return false;
     223    return FALSE;
    220224
    221225  if (! coff_link_check_ar_symbols (abfd, info, pneeded))
    222     return false;
     226    return FALSE;
    223227
    224228  if (*pneeded)
    225229    {
    226230      if (! coff_link_add_symbols (abfd, info))
    227         return false;
     231        return FALSE;
    228232    }
    229233
     
    231235    {
    232236      if (! _bfd_coff_free_symbols (abfd))
    233         return false;
    234     }
    235 
    236   return true;
     237        return FALSE;
     238    }
     239
     240  return TRUE;
    237241}
    238242
     
    240244   included in the link.  */
    241245
    242 static boolean
     246static bfd_boolean
    243247coff_link_check_ar_symbols (abfd, info, pneeded)
    244248     bfd *abfd;
    245249     struct bfd_link_info *info;
    246      boolean *pneeded;
     250     bfd_boolean *pneeded;
    247251{
    248252  bfd_size_type symesz;
     
    250254  bfd_byte *esym_end;
    251255
    252   *pneeded = false;
     256  *pneeded = FALSE;
    253257
    254258  symesz = bfd_coff_symesz (abfd);
     
    275279          name = _bfd_coff_internal_syment_name (abfd, &sym, buf);
    276280          if (name == NULL)
    277             return false;
    278           h = bfd_link_hash_lookup (info->hash, name, false, false, true);
    279 
     281            return FALSE;
     282          h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE);
     283
     284          /* auto import */
     285          if (!h && info->pei386_auto_import)
     286            {
     287              if (!strncmp (name,"__imp_", 6))
     288                {
     289                  h =
     290                    bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE,
     291                                          TRUE);
     292                }
     293            }
    280294          /* We are only interested in symbols that are currently
    281295             undefined.  If a symbol is currently known to be common,
     
    286300            {
    287301              if (! (*info->callbacks->add_archive_element) (info, abfd, name))
    288                 return false;
    289               *pneeded = true;
    290               return true;
     302                return FALSE;
     303              *pneeded = TRUE;
     304              return TRUE;
    291305            }
    292306        }
     
    296310
    297311  /* We do not need this object file.  */
    298   return true;
     312  return TRUE;
    299313}
    300314
    301315/* Add all the symbols from an object file to the hash table.  */
    302316
    303 static boolean
     317static bfd_boolean
    304318coff_link_add_symbols (abfd, info)
    305319     bfd *abfd;
     
    309323  unsigned int n_btshft = coff_data (abfd)->local_n_btshft;
    310324  unsigned int n_btmask = coff_data (abfd)->local_n_btmask;
    311   boolean keep_syms;
    312   boolean default_copy;
     325  bfd_boolean keep_syms;
     326  bfd_boolean default_copy;
    313327  bfd_size_type symcount;
    314328  struct coff_link_hash_entry **sym_hash;
     
    316330  bfd_byte *esym;
    317331  bfd_byte *esym_end;
     332  bfd_size_type amt;
    318333
    319334  /* Keep the symbols during this function, in case the linker needs
    320335     to read the generic symbols in order to report an error message.  */
    321336  keep_syms = obj_coff_keep_syms (abfd);
    322   obj_coff_keep_syms (abfd) = true;
     337  obj_coff_keep_syms (abfd) = TRUE;
    323338
    324339  if (info->keep_memory)
    325     default_copy = false;
     340    default_copy = FALSE;
    326341  else
    327     default_copy = true;
     342    default_copy = TRUE;
    328343
    329344  symcount = obj_raw_syment_count (abfd);
     
    331346  /* We keep a list of the linker hash table entries that correspond
    332347     to particular symbols.  */
    333   sym_hash = ((struct coff_link_hash_entry **)
    334               bfd_alloc (abfd,
    335                          ((size_t) symcount
    336                           * sizeof (struct coff_link_hash_entry *))));
     348  amt = symcount * sizeof (struct coff_link_hash_entry *);
     349  sym_hash = (struct coff_link_hash_entry **) bfd_zalloc (abfd, amt);
    337350  if (sym_hash == NULL && symcount != 0)
    338351    goto error_return;
    339352  obj_coff_sym_hashes (abfd) = sym_hash;
    340   memset (sym_hash, 0,
    341           (size_t) symcount * sizeof (struct coff_link_hash_entry *));
    342353
    343354  symesz = bfd_coff_symesz (abfd);
     
    349360      struct internal_syment sym;
    350361      enum coff_symbol_classification classification;
    351       boolean copy;
     362      bfd_boolean copy;
    352363
    353364      bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &sym);
     
    361372          asection *section;
    362373          bfd_vma value;
    363           boolean addit;
     374          bfd_boolean addit;
    364375
    365376          /* This symbol is externally visible.  */
     
    374385          if (sym._n._n_n._n_zeroes != 0
    375386              || sym._n._n_n._n_offset == 0)
    376             copy = true;
     387            copy = TRUE;
    377388
    378389          value = sym.n_value;
     
    409420            flags = BSF_WEAK;
    410421
    411           addit = true;
     422          addit = TRUE;
    412423
    413424          /* In the PE format, section symbols actually refer to the
     
    417428            {
    418429              *sym_hash = coff_link_hash_lookup (coff_hash_table (info),
    419                                                  name, false, copy, false);
     430                                                 name, FALSE, copy, FALSE);
    420431              if (*sym_hash != NULL)
    421432                {
     
    428439                       name);
    429440
    430                   addit = false;
     441                  addit = FALSE;
    431442                }
    432443            }
     
    434445          /* The Microsoft Visual C compiler does string pooling by
    435446             hashing the constants to an internal symbol name, and
    436              relying on the the linker comdat support to discard
     447             relying on the linker comdat support to discard
    437448             duplicate names.  However, if one string is a literal and
    438449             one is a data initializer, one will end up in the .data
     
    463474              if (*sym_hash == NULL)
    464475                *sym_hash = coff_link_hash_lookup (coff_hash_table (info),
    465                                                    name, false, copy, false);
     476                                                   name, FALSE, copy, FALSE);
    466477              if (*sym_hash != NULL
    467478                  && (*sym_hash)->root.type == bfd_link_hash_defined
     
    469480                  && strcmp ((*sym_hash)->root.u.def.section->comdat->name,
    470481                             section->comdat->name) == 0)
    471                 addit = false;
     482                addit = FALSE;
    472483            }
    473484
     
    476487              if (! (bfd_coff_link_add_one_symbol
    477488                     (info, abfd, name, flags, section, value,
    478                       (const char *) NULL, copy, false,
     489                      (const char *) NULL, copy, FALSE,
    479490                      (struct bfd_link_hash_entry **) sym_hash)))
    480491                goto error_return;
     
    527538                          (_("Warning: type of symbol `%s' changed from %d to %d in %s"),
    528539                           name, (*sym_hash)->type, sym.n_type,
    529                            bfd_get_filename (abfd));
     540                           bfd_archive_filename (abfd));
    530541
    531542                      /* We don't want to change from a meaningful
     
    555566                           i++, eaux += symesz, iaux++)
    556567                        bfd_coff_swap_aux_in (abfd, (PTR) eaux, sym.n_type,
    557                                               sym.n_sclass, i, sym.n_numaux,
    558                                               (PTR) iaux);
     568                                              sym.n_sclass, (int) i,
     569                                              sym.n_numaux, (PTR) iaux);
    559570                      (*sym_hash)->aux = alloc;
    560571                    }
     
    609620              if (secdata == NULL)
    610621                {
    611                   stab->used_by_bfd =
    612                     (PTR) bfd_zalloc (abfd,
    613                                       sizeof (struct coff_section_tdata));
     622                  amt = sizeof (struct coff_section_tdata);
     623                  stab->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
    614624                  if (stab->used_by_bfd == NULL)
    615625                    goto error_return;
     
    629639  obj_coff_keep_syms (abfd) = keep_syms;
    630640
    631   return true;
     641  return TRUE;
    632642
    633643 error_return:
    634644  obj_coff_keep_syms (abfd) = keep_syms;
    635   return false;
     645  return FALSE;
    636646}
    637647
     
    639649/* Do the final link step.  */
    640650
    641 boolean
     651bfd_boolean
    642652_bfd_coff_final_link (abfd, info)
    643653     bfd *abfd;
     
    646656  bfd_size_type symesz;
    647657  struct coff_final_link_info finfo;
    648   boolean debug_merge_allocated;
    649   boolean long_section_names;
     658  bfd_boolean debug_merge_allocated;
     659  bfd_boolean long_section_names;
    650660  asection *o;
    651661  struct bfd_link_order *p;
    652   size_t max_sym_count;
    653   size_t max_lineno_count;
    654   size_t max_reloc_count;
    655   size_t max_output_reloc_count;
    656   size_t max_contents_size;
     662  bfd_size_type max_sym_count;
     663  bfd_size_type max_lineno_count;
     664  bfd_size_type max_reloc_count;
     665  bfd_size_type max_output_reloc_count;
     666  bfd_size_type max_contents_size;
    657667  file_ptr rel_filepos;
    658668  unsigned int relsz;
     
    662672  bfd_byte *external_relocs = NULL;
    663673  char strbuf[STRING_SIZE_SIZE];
     674  bfd_size_type amt;
    664675
    665676  symesz = bfd_coff_symesz (abfd);
     
    679690  finfo.external_relocs = NULL;
    680691  finfo.internal_relocs = NULL;
    681   finfo.global_to_static = false;
    682   debug_merge_allocated = false;
     692  finfo.global_to_static = FALSE;
     693  debug_merge_allocated = FALSE;
    683694
    684695  coff_data (abfd)->link_info = info;
     
    690701  if (! coff_debug_merge_hash_table_init (&finfo.debug_merge))
    691702    goto error_return;
    692   debug_merge_allocated = true;
     703  debug_merge_allocated = TRUE;
    693704
    694705  /* Compute the file positions for all the sections.  */
     
    707718  max_reloc_count = 0;
    708719
    709   long_section_names = false;
     720  long_section_names = FALSE;
    710721  for (o = abfd->sections; o != NULL; o = o->next)
    711722    {
     
    724735                 to do this so that we can identify any sections which
    725736                 the linker has decided to not include.  */
    726               sec->linker_mark = true;
     737              sec->linker_mark = TRUE;
    727738
    728739              if (info->strip == strip_none
     
    752763          o->rel_filepos = rel_filepos;
    753764          rel_filepos += o->reloc_count * relsz;
     765          /* In PE COFF, if there are at least 0xffff relocations an
     766             extra relocation will be written out to encode the count.  */
     767          if (obj_pe (abfd) && o->reloc_count >= 0xffff)
     768            rel_filepos += relsz;
    754769        }
    755770
     
    761776             coff_write_object_contents which puts the string index
    762777             into the s_name field of the section header.  That is why
    763              we pass hash as false.  */
    764           if (_bfd_stringtab_add (finfo.strtab, o->name, false, false)
     778             we pass hash as FALSE.  */
     779          if (_bfd_stringtab_add (finfo.strtab, o->name, FALSE, FALSE)
    765780              == (bfd_size_type) -1)
    766781            goto error_return;
    767           long_section_names = true;
     782          long_section_names = TRUE;
    768783        }
    769784    }
     
    777792      /* We use section_count + 1, rather than section_count, because
    778793         the target_index fields are 1 based.  */
    779       finfo.section_info =
    780         ((struct coff_link_section_info *)
    781          bfd_malloc ((abfd->section_count + 1)
    782                      * sizeof (struct coff_link_section_info)));
     794      amt = abfd->section_count + 1;
     795      amt *= sizeof (struct coff_link_section_info);
     796      finfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt);
    783797      if (finfo.section_info == NULL)
    784798        goto error_return;
     
    821835             common case.  */
    822836          BFD_ASSERT (info->relocateable);
     837          amt = o->reloc_count;
     838          amt *= sizeof (struct internal_reloc);
    823839          finfo.section_info[o->target_index].relocs =
    824             ((struct internal_reloc *)
    825              bfd_malloc (o->reloc_count * sizeof (struct internal_reloc)));
     840            (struct internal_reloc *) bfd_malloc (amt);
     841          amt = o->reloc_count;
     842          amt *= sizeof (struct coff_link_hash_entry *);
    826843          finfo.section_info[o->target_index].rel_hashes =
    827             ((struct coff_link_hash_entry **)
    828              bfd_malloc (o->reloc_count
    829                      * sizeof (struct coff_link_hash_entry *)));
     844            (struct coff_link_hash_entry **) bfd_malloc (amt);
    830845          if (finfo.section_info[o->target_index].relocs == NULL
    831846              || finfo.section_info[o->target_index].rel_hashes == NULL)
     
    852867      size_t sz;
    853868
    854       sub->output_has_begun = false;
     869      sub->output_has_begun = FALSE;
    855870      sz = obj_raw_syment_count (sub);
    856871      if (sz > max_sym_count)
     
    859874
    860875  /* Allocate some buffers used while linking.  */
    861   finfo.internal_syms = ((struct internal_syment *)
    862                          bfd_malloc (max_sym_count
    863                                      * sizeof (struct internal_syment)));
    864   finfo.sec_ptrs = (asection **) bfd_malloc (max_sym_count
    865                                              * sizeof (asection *));
    866   finfo.sym_indices = (long *) bfd_malloc (max_sym_count * sizeof (long));
    867   finfo.outsyms = ((bfd_byte *)
    868                    bfd_malloc ((size_t) ((max_sym_count + 1) * symesz)));
    869   finfo.linenos = (bfd_byte *) bfd_malloc (max_lineno_count
    870                                        * bfd_coff_linesz (abfd));
     876  amt = max_sym_count * sizeof (struct internal_syment);
     877  finfo.internal_syms = (struct internal_syment *) bfd_malloc (amt);
     878  amt = max_sym_count * sizeof (asection *);
     879  finfo.sec_ptrs = (asection **) bfd_malloc (amt);
     880  amt = max_sym_count * sizeof (long);
     881  finfo.sym_indices = (long *) bfd_malloc (amt);
     882  finfo.outsyms = (bfd_byte *) bfd_malloc ((max_sym_count + 1) * symesz);
     883  amt = max_lineno_count * bfd_coff_linesz (abfd);
     884  finfo.linenos = (bfd_byte *) bfd_malloc (amt);
    871885  finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size);
    872   finfo.external_relocs = (bfd_byte *) bfd_malloc (max_reloc_count * relsz);
     886  amt = max_reloc_count * relsz;
     887  finfo.external_relocs = (bfd_byte *) bfd_malloc (amt);
    873888  if (! info->relocateable)
    874     finfo.internal_relocs = ((struct internal_reloc *)
    875                              bfd_malloc (max_reloc_count
    876                                          * sizeof (struct internal_reloc)));
     889    {
     890      amt = max_reloc_count * sizeof (struct internal_reloc);
     891      finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt);
     892    }
    877893  if ((finfo.internal_syms == NULL && max_sym_count > 0)
    878894      || (finfo.sec_ptrs == NULL && max_sym_count > 0)
     
    912928                  if (! _bfd_coff_link_input_bfd (&finfo, sub))
    913929                    goto error_return;
    914                   sub->output_has_begun = true;
     930                  sub->output_has_begun = TRUE;
    915931                }
    916932            }
     
    935951
    936952  coff_debug_merge_hash_table_free (&finfo.debug_merge);
    937   debug_merge_allocated = false;
     953  debug_merge_allocated = FALSE;
    938954
    939955  if (finfo.internal_syms != NULL)
     
    979995      && (unsigned int) finfo.last_file.n_value != obj_raw_syment_count (abfd))
    980996    {
     997      file_ptr pos;
     998
    981999      finfo.last_file.n_value = obj_raw_syment_count (abfd);
    9821000      bfd_coff_swap_sym_out (abfd, (PTR) &finfo.last_file,
    9831001                             (PTR) finfo.outsyms);
    984       if (bfd_seek (abfd,
    985                     (obj_sym_filepos (abfd)
    986                      + finfo.last_file_index * symesz),
    987                     SEEK_SET) != 0
    988           || bfd_write (finfo.outsyms, symesz, 1, abfd) != symesz)
    989         return false;
     1002
     1003      pos = obj_sym_filepos (abfd) + finfo.last_file_index * symesz;
     1004      if (bfd_seek (abfd, pos, SEEK_SET) != 0
     1005          || bfd_bwrite (finfo.outsyms, symesz, abfd) != symesz)
     1006        return FALSE;
    9901007    }
    9911008
     
    9951012  if (info->task_link)
    9961013    {
    997       finfo.failed = false;
    998       coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_task_globals,
     1014      finfo.failed = FALSE;
     1015      coff_link_hash_traverse (coff_hash_table (info),
     1016                               _bfd_coff_write_task_globals,
    9991017                               (PTR) &finfo);
    10001018      if (finfo.failed)
     
    10031021
    10041022  /* Write out the global symbols.  */
    1005   finfo.failed = false;
    1006   coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_global_sym,
     1023  finfo.failed = FALSE;
     1024  coff_link_hash_traverse (coff_hash_table (info),
     1025                           _bfd_coff_write_global_sym,
    10071026                           (PTR) &finfo);
    10081027  if (finfo.failed)
     
    10211040         the symbol indices to use for relocs against them, and we can
    10221041         finally write out the relocs.  */
    1023       external_relocs = ((bfd_byte *)
    1024                          bfd_malloc (max_output_reloc_count * relsz));
     1042      amt = max_output_reloc_count * relsz;
     1043      external_relocs = (bfd_byte *) bfd_malloc (amt);
    10251044      if (external_relocs == NULL)
    10261045        goto error_return;
     
    10511070
    10521071          if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0
    1053               || bfd_write ((PTR) external_relocs, relsz, o->reloc_count,
    1054                             abfd) != relsz * o->reloc_count)
     1072              || (bfd_bwrite ((PTR) external_relocs,
     1073                             (bfd_size_type) relsz * o->reloc_count, abfd)
     1074                  != (bfd_size_type) relsz * o->reloc_count))
    10551075            goto error_return;
    10561076        }
     
    10801100    {
    10811101      if (! _bfd_write_stab_strings (abfd, &coff_hash_table (info)->stab_info))
    1082         return false;
     1102        return FALSE;
    10831103    }
    10841104
     
    10861106  if (obj_raw_syment_count (abfd) != 0 || long_section_names)
    10871107    {
    1088       if (bfd_seek (abfd,
    1089                     (obj_sym_filepos (abfd)
    1090                      + obj_raw_syment_count (abfd) * symesz),
    1091                     SEEK_SET) != 0)
    1092         return false;
     1108      file_ptr pos;
     1109
     1110      pos = obj_sym_filepos (abfd) + obj_raw_syment_count (abfd) * symesz;
     1111      if (bfd_seek (abfd, pos, SEEK_SET) != 0)
     1112        return FALSE;
    10931113
    10941114#if STRING_SIZE_SIZE == 4
    1095       bfd_h_put_32 (abfd,
    1096                     _bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE,
    1097                     (bfd_byte *) strbuf);
     1115      H_PUT_32 (abfd,
     1116                _bfd_stringtab_size (finfo.strtab) + STRING_SIZE_SIZE,
     1117                strbuf);
    10981118#else
    1099  #error Change bfd_h_put_32
     1119 #error Change H_PUT_32 above
    11001120#endif
    11011121
    1102       if (bfd_write (strbuf, 1, STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE)
    1103         return false;
     1122      if (bfd_bwrite (strbuf, (bfd_size_type) STRING_SIZE_SIZE, abfd)
     1123          != STRING_SIZE_SIZE)
     1124        return FALSE;
    11041125
    11051126      if (! _bfd_stringtab_emit (abfd, finfo.strtab))
    1106         return false;
    1107 
    1108       obj_coff_strings_written (abfd) = true;
     1127        return FALSE;
     1128
     1129      obj_coff_strings_written (abfd) = TRUE;
    11091130    }
    11101131
     
    11151136  bfd_get_symcount (abfd) = 0;
    11161137
    1117   return true;
     1138  return TRUE;
    11181139
    11191140 error_return:
     
    11531174  if (external_relocs != NULL)
    11541175    free (external_relocs);
    1155   return false;
     1176  return FALSE;
    11561177}
    11571178
     
    11681189      int val = strtoul (ptr, &ptr, 0);
    11691190      if (heap)
    1170         pe_data(output_bfd)->pe_opthdr.SizeOfHeapReserve =val;
     1191        pe_data(output_bfd)->pe_opthdr.SizeOfHeapReserve = val;
    11711192      else
    1172         pe_data(output_bfd)->pe_opthdr.SizeOfStackReserve =val;
     1193        pe_data(output_bfd)->pe_opthdr.SizeOfStackReserve = val;
    11731194
    11741195      if (ptr[0] == ',')
    11751196        {
    1176           int val = strtoul (ptr+1, &ptr, 0);
     1197          val = strtoul (ptr+1, &ptr, 0);
    11771198          if (heap)
    1178             pe_data(output_bfd)->pe_opthdr.SizeOfHeapCommit =val;
     1199            pe_data(output_bfd)->pe_opthdr.SizeOfHeapCommit = val;
    11791200          else
    1180             pe_data(output_bfd)->pe_opthdr.SizeOfStackCommit =val;
     1201            pe_data(output_bfd)->pe_opthdr.SizeOfStackCommit = val;
    11811202        }
    11821203    }
     
    12121233    return 1;
    12131234
    1214   copy = bfd_malloc ((size_t) sec->_raw_size);
     1235  copy = bfd_malloc (sec->_raw_size);
    12151236  if (!copy)
    12161237    return 0;
    1217   if (! bfd_get_section_contents(abfd, sec, copy, 0, sec->_raw_size))
     1238  if (! bfd_get_section_contents(abfd, sec, copy, (bfd_vma) 0, sec->_raw_size))
    12181239    {
    12191240      free (copy);
     
    13071328      if ((a->flags & SEC_RELOC) == 0 || a->reloc_count  < 1)
    13081329        continue;
     1330      /* Don't mark relocs in excluded sections.  */
     1331      if (a->output_section == bfd_abs_section_ptr)
     1332        continue;
    13091333
    13101334      /* Read in the relocs.  */
    13111335      internal_relocs = _bfd_coff_read_internal_relocs
    1312         (input_bfd, a, false,
     1336        (input_bfd, a, FALSE,
    13131337         finfo->external_relocs,
    13141338         finfo->info->relocateable,
     
    13391363   handles all the sections and relocations of the input file at once.  */
    13401364
    1341 boolean
     1365bfd_boolean
    13421366_bfd_coff_link_input_bfd (finfo, input_bfd)
    13431367     struct coff_final_link_info *finfo;
     
    13491373  unsigned int n_btmask = coff_data (input_bfd)->local_n_btmask;
    13501374#endif
    1351   boolean (*adjust_symndx) PARAMS ((bfd *, struct bfd_link_info *, bfd *,
    1352                                     asection *, struct internal_reloc *,
    1353                                     boolean *));
     1375  bfd_boolean (*adjust_symndx)
     1376    PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
     1377             struct internal_reloc *, bfd_boolean *));
    13541378  bfd *output_bfd;
    13551379  const char *strings;
    13561380  bfd_size_type syment_base;
    1357   boolean copy, hash;
     1381  bfd_boolean copy, hash;
    13581382  bfd_size_type isymesz;
    13591383  bfd_size_type osymesz;
     
    13791403  BFD_ASSERT (linesz == bfd_coff_linesz (output_bfd));
    13801404
    1381   copy = false;
     1405  copy = FALSE;
    13821406  if (! finfo->info->keep_memory)
    1383     copy = true;
    1384   hash = true;
     1407    copy = TRUE;
     1408  hash = TRUE;
    13851409  if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0)
    1386     hash = false;
     1410    hash = FALSE;
    13871411
    13881412  if (! _bfd_coff_get_external_symbols (input_bfd))
    1389     return false;
     1413    return FALSE;
    13901414
    13911415  esym = (bfd_byte *) obj_coff_external_syms (input_bfd);
     
    14001424    {
    14011425      if (! process_embedded_commands (output_bfd, finfo->info, input_bfd))
    1402         return false;
     1426        return FALSE;
    14031427    }
    14041428
     
    14201444      struct internal_syment isym;
    14211445      enum coff_symbol_classification classification;
    1422       boolean skip;
    1423       boolean global;
    1424       boolean dont_skip_symbol;
     1446      bfd_boolean skip;
     1447      bfd_boolean global;
     1448      bfd_boolean dont_skip_symbol;
    14251449      int add;
    14261450
     
    14581482        dont_skip_symbol = *indexp;
    14591483      else
    1460         dont_skip_symbol = false;
     1484        dont_skip_symbol = FALSE;
    14611485
    14621486      *indexp = -1;
    14631487
    1464       skip = false;
    1465       global = false;
     1488      skip = FALSE;
     1489      global = FALSE;
    14661490      add = 1 + isym.n_numaux;
    14671491
    14681492      /* If we are stripping all symbols, we want to skip this one.  */
    14691493      if (finfo->info->strip == strip_all && ! dont_skip_symbol)
    1470         skip = true;
     1494        skip = TRUE;
    14711495
    14721496      if (! skip)
     
    14831507                 Locally defined function symbols, however, are an
    14841508                 exception, and are not moved to the end.  */
    1485               global = true;
     1509              global = TRUE;
    14861510              if (! ISFCN (isym.n_type))
    1487                 skip = true;
     1511                skip = TRUE;
    14881512              break;
    14891513
    14901514            case COFF_SYMBOL_UNDEFINED:
    14911515              /* Undefined symbols are left for the end.  */
    1492               global = true;
    1493               skip = true;
     1516              global = TRUE;
     1517              skip = TRUE;
    14941518              break;
    14951519
     
    14981522                 local symbols.  */
    14991523              if (finfo->info->discard == discard_all && ! dont_skip_symbol)
    1500                 skip = true;
     1524                skip = TRUE;
    15011525              break;
    15021526            }
    15031527        }
     1528
     1529#ifndef COFF_WITH_PE
     1530      /* Skip section symbols for sections which are not going to be
     1531         emitted.  */
     1532      if (!skip
     1533          && isym.n_sclass == C_STAT
     1534          && isym.n_type == T_NULL
     1535          && isym.n_numaux > 0)
     1536        {
     1537          if ((*secpp)->output_section == bfd_abs_section_ptr)
     1538            skip = TRUE;
     1539        }
     1540#endif
    15041541
    15051542      /* If we stripping debugging symbols, and this is a debugging
     
    15211558                      || isym.n_sclass == C_FIELD
    15221559                      || isym.n_sclass == C_EOS))))
    1523         skip = true;
     1560        skip = TRUE;
    15241561
    15251562      /* If some symbols are stripped based on the name, work out the
     
    15341571          name = _bfd_coff_internal_syment_name (input_bfd, &isym, buf);
    15351572          if (name == NULL)
    1536             return false;
     1573            return FALSE;
    15371574
    15381575          if (! dont_skip_symbol
    15391576              && ((finfo->info->strip == strip_some
    1540                    && (bfd_hash_lookup (finfo->info->keep_hash, name, false,
    1541                                     false) == NULL))
     1577                   && (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE,
     1578                                    FALSE) == NULL))
    15421579                   || (! global
    15431580                       && finfo->info->discard == discard_l
    15441581                       && bfd_is_local_label_name (input_bfd, name))))
    1545             skip = true;
     1582            skip = TRUE;
    15461583        }
    15471584
     
    15631600          bfd_byte *esl, *eslend;
    15641601          struct internal_syment *islp;
     1602          bfd_size_type amt;
    15651603
    15661604          name = _bfd_coff_internal_syment_name (input_bfd, &isym, buf);
    15671605          if (name == NULL)
    1568             return false;
     1606            return FALSE;
    15691607
    15701608          /* Ignore fake names invented by compiler; treat them all as
     
    15761614
    15771615          mh = coff_debug_merge_hash_lookup (&finfo->debug_merge, name,
    1578                                              true, true);
     1616                                             TRUE, TRUE);
    15791617          if (mh == NULL)
    1580             return false;
     1618            return FALSE;
    15811619
    15821620          /* Allocate memory to hold type information.  If this turns
    15831621             out to be a duplicate, we pass this address to
    15841622             bfd_release.  */
    1585           mt = ((struct coff_debug_merge_type *)
    1586                 bfd_alloc (input_bfd,
    1587                            sizeof (struct coff_debug_merge_type)));
     1623          amt = sizeof (struct coff_debug_merge_type);
     1624          mt = (struct coff_debug_merge_type *) bfd_alloc (input_bfd, amt);
    15881625          if (mt == NULL)
    1589             return false;
     1626            return FALSE;
    15901627          mt->class = isym.n_sclass;
    15911628
     
    16111648              bfd_coff_swap_sym_in (input_bfd, (PTR) esl, (PTR) islp);
    16121649
     1650              amt = sizeof (struct coff_debug_merge_element);
    16131651              *epp = ((struct coff_debug_merge_element *)
    1614                       bfd_alloc (input_bfd,
    1615                                  sizeof (struct coff_debug_merge_element)));
     1652                      bfd_alloc (input_bfd, amt));
    16161653              if (*epp == NULL)
    1617                 return false;
     1654                return FALSE;
    16181655
    16191656              elename = _bfd_coff_internal_syment_name (input_bfd, islp,
    16201657                                                        elebuf);
    16211658              if (elename == NULL)
    1622                 return false;
    1623 
    1624               name_copy = (char *) bfd_alloc (input_bfd,
    1625                                               strlen (elename) + 1);
     1659                return FALSE;
     1660
     1661              amt = strlen (elename) + 1;
     1662              name_copy = (char *) bfd_alloc (input_bfd, amt);
    16261663              if (name_copy == NULL)
    1627                 return false;
     1664                return FALSE;
    16281665              strcpy (name_copy, elename);
    16291666
     
    17091746                  *indexp = mtl->indx;
    17101747                  add = (eslend - esym) / isymesz;
    1711                   skip = true;
     1748                  skip = TRUE;
    17121749                }
    17131750            }
     
    17331770                                                     (char *) NULL);
    17341771              if (name == NULL)
    1735                 return false;
     1772                return FALSE;
    17361773              indx = _bfd_stringtab_add (finfo->strtab, name, hash, copy);
    17371774              if (indx == (bfd_size_type) -1)
    1738                 return false;
     1775                return FALSE;
    17391776              isym._n._n_n._n_offset = STRING_SIZE_SIZE + indx;
    17401777            }
     
    18061843
    18071844              if (finfo->last_file_index != -1
    1808                   && finfo->last_file.n_value != (long) output_index)
     1845                  && finfo->last_file.n_value != (bfd_vma) output_index)
    18091846                {
    18101847                  /* We must correct the value of the last C_FILE
     
    18231860                  else
    18241861                    {
     1862                      file_ptr pos;
     1863
    18251864                      /* We have already written out the last C_FILE
    18261865                         symbol.  We need to write it out again.  We
     
    18291868                                             (PTR) &finfo->last_file,
    18301869                                             (PTR) outsym);
    1831                       if (bfd_seek (output_bfd,
    1832                                     (obj_sym_filepos (output_bfd)
    1833                                      + finfo->last_file_index * osymesz),
    1834                                     SEEK_SET) != 0
    1835                           || (bfd_write (outsym, osymesz, 1, output_bfd)
    1836                               != osymesz))
    1837                         return false;
     1870                      pos = obj_sym_filepos (output_bfd);
     1871                      pos += finfo->last_file_index * osymesz;
     1872                      if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
     1873                          || bfd_bwrite (outsym, osymesz, output_bfd) != osymesz)
     1874                        return FALSE;
    18381875                    }
    18391876                }
     
    18681905                     the link.  */
    18691906                  bfd_set_error (bfd_error_bad_value);
    1870                   return false;
     1907                  return FALSE;
    18711908                }
    18721909              h->indx = output_index;
     
    19642001                          strings = _bfd_coff_read_string_table (input_bfd);
    19652002                          if (strings == NULL)
    1966                             return false;
     2003                            return FALSE;
    19672004                        }
    19682005                      filename = strings + auxp->x_file.x_n.x_offset;
     
    19702007                                                 hash, copy);
    19712008                      if (indx == (bfd_size_type) -1)
    1972                         return false;
     2009                        return FALSE;
    19732010                      auxp->x_file.x_n.x_offset = STRING_SIZE_SIZE + indx;
    19742011                    }
     
    20562093                          else
    20572094                            {
     2095                              file_ptr pos;
     2096
    20582097                              /* We have already written out the last
    20592098                                 .bf aux entry.  We need to write it
     
    20672106                                                     0, isymp->n_numaux,
    20682107                                                     (PTR) outsym);
    2069                               if (bfd_seek (output_bfd,
    2070                                             (obj_sym_filepos (output_bfd)
    2071                                              + finfo->last_bf_index * osymesz),
    2072                                             SEEK_SET) != 0
    2073                                   || bfd_write (outsym, osymesz, 1,
    2074                                                 output_bfd) != osymesz)
    2075                                 return false;
     2108                              pos = obj_sym_filepos (output_bfd);
     2109                              pos += finfo->last_bf_index * osymesz;
     2110                              if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
     2111                                  || (bfd_bwrite (outsym, osymesz, output_bfd)
     2112                                      != osymesz))
     2113                                return FALSE;
    20762114                            }
    20772115                        }
     
    21192157          bfd_byte *elineend;
    21202158          bfd_byte *oeline;
    2121           boolean skipping;
     2159          bfd_boolean skipping;
     2160          file_ptr pos;
     2161          bfd_size_type amt;
    21222162
    21232163          /* FIXME: If SEC_HAS_CONTENTS is not for the section, then
     
    21352175
    21362176          if (bfd_seek (input_bfd, o->line_filepos, SEEK_SET) != 0
    2137               || bfd_read (finfo->linenos, linesz, o->lineno_count,
     2177              || bfd_bread (finfo->linenos, linesz * o->lineno_count,
    21382178                           input_bfd) != linesz * o->lineno_count)
    2139             return false;
     2179            return FALSE;
    21402180
    21412181          offset = o->output_section->vma + o->output_offset - o->vma;
     
    21432183          oeline = finfo->linenos;
    21442184          elineend = eline + linesz * o->lineno_count;
    2145           skipping = false;
     2185          skipping = FALSE;
    21462186          for (; eline < elineend; eline += linesz)
    21472187            {
     
    21692209                         the space in the output file, but at least
    21702210                         they're dense.  */
    2171                       skipping = true;
     2211                      skipping = TRUE;
    21722212                    }
    21732213                  else
     
    22092249                        }
    22102250
    2211                       skipping = false;
     2251                      skipping = FALSE;
    22122252                    }
    22132253
     
    22232263            }
    22242264
    2225           if (bfd_seek (output_bfd,
    2226                         (o->output_section->line_filepos
    2227                          + o->output_section->lineno_count * linesz),
    2228                         SEEK_SET) != 0
    2229               || (bfd_write (finfo->linenos, 1, oeline - finfo->linenos,
    2230                              output_bfd)
    2231                   != (bfd_size_type) (oeline - finfo->linenos)))
    2232             return false;
    2233 
    2234           o->output_section->lineno_count +=
    2235             (oeline - finfo->linenos) / linesz;
     2265          pos = o->output_section->line_filepos;
     2266          pos += o->output_section->lineno_count * linesz;
     2267          amt = oeline - finfo->linenos;
     2268          if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
     2269              || bfd_bwrite (finfo->linenos, amt, output_bfd) != amt)
     2270            return FALSE;
     2271
     2272          o->output_section->lineno_count += amt / linesz;
    22362273        }
    22372274    }
     
    22542291  if (outsym > finfo->outsyms)
    22552292    {
    2256       if (bfd_seek (output_bfd,
    2257                     obj_sym_filepos (output_bfd) + syment_base * osymesz,
    2258                     SEEK_SET) != 0
    2259           || (bfd_write (finfo->outsyms, outsym - finfo->outsyms, 1,
    2260                         output_bfd)
    2261               != (bfd_size_type) (outsym - finfo->outsyms)))
    2262         return false;
     2293      file_ptr pos;
     2294      bfd_size_type amt;
     2295
     2296      pos = obj_sym_filepos (output_bfd) + syment_base * osymesz;
     2297      amt = outsym - finfo->outsyms;
     2298      if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
     2299          || bfd_bwrite (finfo->outsyms, amt, output_bfd) != amt)
     2300        return FALSE;
    22632301
    22642302      BFD_ASSERT ((obj_raw_syment_count (output_bfd)
     
    22902328              ((*_bfd_error_handler)
    22912329               (_("%s: relocs in section `%s', but it has no contents"),
    2292                 bfd_get_filename (input_bfd),
     2330                bfd_archive_filename (input_bfd),
    22932331                bfd_get_section_name (input_bfd, o)));
    22942332              bfd_set_error (bfd_error_no_contents);
    2295               return false;
     2333              return FALSE;
    22962334            }
    22972335
     
    23062344          if (! bfd_get_section_contents (input_bfd, o, finfo->contents,
    23072345                                          (file_ptr) 0, o->_raw_size))
    2308             return false;
     2346            return FALSE;
    23092347          contents = finfo->contents;
    23102348        }
     
    23192357          target_index = o->output_section->target_index;
    23202358          internal_relocs = (_bfd_coff_read_internal_relocs
    2321                              (input_bfd, o, false, finfo->external_relocs,
     2359                             (input_bfd, o, FALSE, finfo->external_relocs,
    23222360                              finfo->info->relocateable,
    23232361                              (finfo->info->relocateable
     
    23262364                               : finfo->internal_relocs)));
    23272365          if (internal_relocs == NULL)
    2328             return false;
     2366            return FALSE;
    23292367
    23302368          /* Call processor specific code to relocate the section
     
    23362374                                           finfo->internal_syms,
    23372375                                           finfo->sec_ptrs))
    2338             return false;
     2376            return FALSE;
    23392377
    23402378          if (finfo->info->relocateable)
     
    23522390                {
    23532391                  struct coff_link_hash_entry *h;
    2354                   boolean adjusted;
     2392                  bfd_boolean adjusted;
    23552393
    23562394                  *rel_hash = NULL;
     
    23682406                                              input_bfd, o, irel,
    23692407                                              &adjusted))
    2370                         return false;
     2408                        return FALSE;
    23712409                      if (adjusted)
    23722410                        continue;
     
    24142452                                  (input_bfd, is, buf));
    24152453                          if (name == NULL)
    2416                             return false;
     2454                            return FALSE;
    24172455
    24182456                          if (! ((*finfo->info->callbacks->unattached_reloc)
    24192457                                 (finfo->info, name, input_bfd, o,
    24202458                                  irel->r_vaddr)))
    2421                             return false;
     2459                            return FALSE;
    24222460                        }
    24232461                    }
     
    24312469      if (secdata == NULL || secdata->stab_info == NULL)
    24322470        {
     2471          file_ptr loc = o->output_offset * bfd_octets_per_byte (output_bfd);
     2472          bfd_size_type amt = (o->_cooked_size != 0
     2473                               ? o->_cooked_size : o->_raw_size);
    24332474          if (! bfd_set_section_contents (output_bfd, o->output_section,
    2434                                           contents,
    2435                                           (file_ptr)
    2436                                           (o->output_offset *
    2437                                            bfd_octets_per_byte (output_bfd)),
    2438                                           (o->_cooked_size != 0
    2439                                            ? o->_cooked_size
    2440                                            : o->_raw_size)))
    2441             return false;
     2475                                          contents, loc, amt))
     2476            return FALSE;
    24422477        }
    24432478      else
     
    24462481                 (output_bfd, &coff_hash_table (finfo->info)->stab_info,
    24472482                  o, &secdata->stab_info, contents)))
    2448             return false;
     2483            return FALSE;
    24492484        }
    24502485    }
     
    24532488    {
    24542489      if (! _bfd_coff_free_symbols (input_bfd))
    2455         return false;
    2456     }
    2457 
    2458   return true;
     2490        return FALSE;
     2491    }
     2492
     2493  return TRUE;
    24592494}
    24602495
    24612496/* Write out a global symbol.  Called via coff_link_hash_traverse.  */
    24622497
    2463 boolean
     2498bfd_boolean
    24642499_bfd_coff_write_global_sym (h, data)
    24652500     struct coff_link_hash_entry *h;
     
    24712506  bfd_size_type symesz;
    24722507  unsigned int i;
     2508  file_ptr pos;
    24732509
    24742510  output_bfd = finfo->output_bfd;
    24752511
     2512  if (h->root.type == bfd_link_hash_warning)
     2513    {
     2514      h = (struct coff_link_hash_entry *) h->root.u.i.link;
     2515      if (h->root.type == bfd_link_hash_new)
     2516        return TRUE;
     2517    }
     2518
    24762519  if (h->indx >= 0)
    2477     return true;
     2520    return TRUE;
    24782521
    24792522  if (h->indx != -2
     
    24812524          || (finfo->info->strip == strip_some
    24822525              && (bfd_hash_lookup (finfo->info->keep_hash,
    2483                                    h->root.root.string, false, false)
     2526                                   h->root.root.string, FALSE, FALSE)
    24842527                  == NULL))))
    2485     return true;
     2528    return TRUE;
    24862529
    24872530  switch (h->root.type)
     
    24892532    default:
    24902533    case bfd_link_hash_new:
     2534    case bfd_link_hash_warning:
    24912535      abort ();
    2492       return false;
     2536      return FALSE;
    24932537
    24942538    case bfd_link_hash_undefined:
     
    25212565
    25222566    case bfd_link_hash_indirect:
    2523     case bfd_link_hash_warning:
    25242567      /* Just ignore these.  They can't be handled anyhow.  */
    2525       return true;
     2568      return TRUE;
    25262569    }
    25272570
     
    25302573  else
    25312574    {
    2532       boolean hash;
     2575      bfd_boolean hash;
    25332576      bfd_size_type indx;
    25342577
    2535       hash = true;
     2578      hash = TRUE;
    25362579      if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0)
    2537         hash = false;
     2580        hash = FALSE;
    25382581      indx = _bfd_stringtab_add (finfo->strtab, h->root.root.string, hash,
    2539                                  false);
     2582                                 FALSE);
    25402583      if (indx == (bfd_size_type) -1)
    25412584        {
    2542           finfo->failed = true;
    2543           return false;
     2585          finfo->failed = TRUE;
     2586          return FALSE;
    25442587        }
    25452588      isym._n._n_n._n_zeroes = 0;
     
    25602603    {
    25612604      if (! IS_EXTERNAL (output_bfd, isym))
    2562         return true;
     2605        return TRUE;
    25632606
    25642607      isym.n_sclass = C_STAT;
     
    25792622  symesz = bfd_coff_symesz (output_bfd);
    25802623
    2581   if (bfd_seek (output_bfd,
    2582                 (obj_sym_filepos (output_bfd)
    2583                  + obj_raw_syment_count (output_bfd) * symesz),
    2584                 SEEK_SET) != 0
    2585       || bfd_write (finfo->outsyms, symesz, 1, output_bfd) != symesz)
    2586     {
    2587       finfo->failed = true;
    2588       return false;
     2624  pos = obj_sym_filepos (output_bfd);
     2625  pos += obj_raw_syment_count (output_bfd) * symesz;
     2626  if (bfd_seek (output_bfd, pos, SEEK_SET) != 0
     2627      || bfd_bwrite (finfo->outsyms, symesz, output_bfd) != symesz)
     2628    {
     2629      finfo->failed = TRUE;
     2630      return FALSE;
    25892631    }
    25902632
     
    26512693
    26522694      bfd_coff_swap_aux_out (output_bfd, (PTR) auxp, isym.n_type,
    2653                              isym.n_sclass, i, isym.n_numaux,
     2695                             isym.n_sclass, (int) i, isym.n_numaux,
    26542696                             (PTR) finfo->outsyms);
    2655       if (bfd_write (finfo->outsyms, symesz, 1, output_bfd) != symesz)
    2656         {
    2657           finfo->failed = true;
    2658           return false;
     2697      if (bfd_bwrite (finfo->outsyms, symesz, output_bfd) != symesz)
     2698        {
     2699          finfo->failed = TRUE;
     2700          return FALSE;
    26592701        }
    26602702      ++obj_raw_syment_count (output_bfd);
    26612703    }
    26622704
    2663   return true;
     2705  return TRUE;
    26642706}
    26652707
     
    26682710   the dirty work, if the symbol we are processing needs conversion.  */
    26692711
    2670 boolean
     2712bfd_boolean
    26712713_bfd_coff_write_task_globals (h, data)
    26722714     struct coff_link_hash_entry *h;
     
    26742716{
    26752717  struct coff_final_link_info *finfo = (struct coff_final_link_info *) data;
    2676   boolean rtnval = true;
    2677   boolean save_global_to_static;
     2718  bfd_boolean rtnval = TRUE;
     2719  bfd_boolean save_global_to_static;
     2720
     2721  if (h->root.type == bfd_link_hash_warning)
     2722    h = (struct coff_link_hash_entry *) h->root.u.i.link;
    26782723
    26792724  if (h->indx < 0)
     
    26842729        case bfd_link_hash_defweak:
    26852730          save_global_to_static = finfo->global_to_static;
    2686           finfo->global_to_static = true;
     2731          finfo->global_to_static = TRUE;
    26872732          rtnval = _bfd_coff_write_global_sym (h, data);
    26882733          finfo->global_to_static = save_global_to_static;
     
    26972742/* Handle a link order which is supposed to generate a reloc.  */
    26982743
    2699 boolean
     2744bfd_boolean
    27002745_bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order)
    27012746     bfd *output_bfd;
     
    27122757    {
    27132758      bfd_set_error (bfd_error_bad_value);
    2714       return false;
     2759      return FALSE;
    27152760    }
    27162761
     
    27202765      bfd_byte *buf;
    27212766      bfd_reloc_status_type rstat;
    2722       boolean ok;
     2767      bfd_boolean ok;
     2768      file_ptr loc;
    27232769
    27242770      size = bfd_get_reloc_size (howto);
    27252771      buf = (bfd_byte *) bfd_zmalloc (size);
    27262772      if (buf == NULL)
    2727         return false;
     2773        return FALSE;
    27282774
    27292775      rstat = _bfd_relocate_contents (howto, output_bfd,
    2730                                       link_order->u.reloc.p->addend, buf);
     2776                                      (bfd_vma) link_order->u.reloc.p->addend,\
     2777                                      buf);
    27312778      switch (rstat)
    27322779        {
     
    27472794            {
    27482795              free (buf);
    2749               return false;
     2796              return FALSE;
    27502797            }
    27512798          break;
    27522799        }
     2800      loc = link_order->offset * bfd_octets_per_byte (output_bfd);
    27532801      ok = bfd_set_section_contents (output_bfd, output_section, (PTR) buf,
    2754                                      (file_ptr)
    2755                                      (link_order->offset *
    2756                                       bfd_octets_per_byte (output_bfd)), size);
     2802                                     loc, size);
    27572803      free (buf);
    27582804      if (! ok)
    2759         return false;
     2805        return FALSE;
    27602806    }
    27612807
     
    27902836           bfd_wrapped_link_hash_lookup (output_bfd, finfo->info,
    27912837                                         link_order->u.reloc.p->u.name,
    2792                                          false, false, true));
     2838                                         FALSE, FALSE, TRUE));
    27932839      if (h != NULL)
    27942840        {
     
    28092855                 (finfo->info, link_order->u.reloc.p->u.name, (bfd *) NULL,
    28102856                  (asection *) NULL, (bfd_vma) 0)))
    2811             return false;
     2857            return FALSE;
    28122858          irel->r_symndx = 0;
    28132859        }
     
    28242870  ++output_section->reloc_count;
    28252871
    2826   return true;
     2872  return TRUE;
    28272873}
    28282874
     
    28302876   simple relocs.  */
    28312877
    2832 boolean
     2878bfd_boolean
    28332879_bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
    28342880                                    input_section, contents, relocs, syms,
     
    28702916          (*_bfd_error_handler)
    28712917            ("%s: illegal symbol index %ld in relocs",
    2872              bfd_get_filename (input_bfd), symndx);
    2873           return false;
     2918             bfd_archive_filename (input_bfd), symndx);
     2919          return FALSE;
    28742920        }
    28752921      else
     
    28922938                                       sym, &addend);
    28932939      if (howto == NULL)
    2894         return false;
     2940        return FALSE;
    28952941
    28962942      /* If we are doing a relocateable link, then we can just ignore
     
    29472993              if (! ((*info->callbacks->undefined_symbol)
    29482994                     (info, h->root.root.string, input_bfd, input_section,
    2949                       rel->r_vaddr - input_section->vma, true)))
    2950                 return false;
     2995                      rel->r_vaddr - input_section->vma, TRUE)))
     2996                return FALSE;
    29512997            }
    29522998        }
     
    29733019                {
    29743020                  bfd_set_error (bfd_error_system_call);
    2975                   return false;
     3021                  return FALSE;
    29763022                }
    29773023            }
     
    29923038          (*_bfd_error_handler)
    29933039            (_("%s: bad reloc address 0x%lx in section `%s'"),
    2994              bfd_get_filename (input_bfd),
     3040             bfd_archive_filename (input_bfd),
    29953041             (unsigned long) rel->r_vaddr,
    29963042             bfd_get_section_name (input_bfd, input_section));
    2997           return false;
     3043          return FALSE;
    29983044        case bfd_reloc_overflow:
    29993045          {
     
    30093055                name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
    30103056                if (name == NULL)
    3011                   return false;
     3057                  return FALSE;
    30123058              }
    30133059
     
    30153061                   (info, name, howto->name, (bfd_vma) 0, input_bfd,
    30163062                    input_section, rel->r_vaddr - input_section->vma)))
    3017               return false;
     3063              return FALSE;
    30183064          }
    30193065        }
    30203066    }
    3021   return true;
     3067  return TRUE;
    30223068}
Note: See TracChangeset for help on using the changeset viewer.