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

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* BFD backend for SunOS binaries.
    2    Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000
    3    Free Software Foundation, Inc.
     2   Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
     3   2002 Free Software Foundation, Inc.
    44   Written by Cygnus Support.
    55
     
    2121
    2222#define TARGETNAME "a.out-sunos-big"
    23 #define MY(OP) CAT(sunos_big_,OP)
     23
     24/* Do not "beautify" the CONCAT* macro args.  Traditional C will not
     25   remove whitespace added here, and thus will fail to concatenate
     26   the tokens.  */
     27#define MY(OP) CONCAT2 (sunos_big_,OP)
    2428
    2529#include "bfd.h"
     
    2933/* Static routines defined in this file.  */
    3034
    31 static boolean sunos_read_dynamic_info PARAMS ((bfd *));
     35static bfd_boolean sunos_read_dynamic_info PARAMS ((bfd *));
    3236static long sunos_get_dynamic_symtab_upper_bound PARAMS ((bfd *));
    33 static boolean sunos_slurp_dynamic_symtab PARAMS ((bfd *));
     37static bfd_boolean sunos_slurp_dynamic_symtab PARAMS ((bfd *));
    3438static long sunos_canonicalize_dynamic_symtab PARAMS ((bfd *, asymbol **));
    3539static long sunos_get_dynamic_reloc_upper_bound PARAMS ((bfd *));
     
    4044static struct bfd_link_hash_table *sunos_link_hash_table_create
    4145  PARAMS ((bfd *));
    42 static boolean sunos_create_dynamic_sections
    43   PARAMS ((bfd *, struct bfd_link_info *, boolean));
    44 static boolean sunos_add_dynamic_symbols
     46static bfd_boolean sunos_create_dynamic_sections
     47  PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean));
     48static bfd_boolean sunos_add_dynamic_symbols
    4549  PARAMS ((bfd *, struct bfd_link_info *, struct external_nlist **,
    4650           bfd_size_type *, char **));
    47 static boolean sunos_add_one_symbol
     51static bfd_boolean sunos_add_one_symbol
    4852  PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *,
    49            bfd_vma, const char *, boolean, boolean,
     53           bfd_vma, const char *, bfd_boolean, bfd_boolean,
    5054           struct bfd_link_hash_entry **));
    51 static boolean sunos_scan_relocs
     55static bfd_boolean sunos_scan_relocs
    5256  PARAMS ((struct bfd_link_info *, bfd *, asection *, bfd_size_type));
    53 static boolean sunos_scan_std_relocs
     57static bfd_boolean sunos_scan_std_relocs
    5458  PARAMS ((struct bfd_link_info *, bfd *, asection *,
    5559           const struct reloc_std_external *, bfd_size_type));
    56 static boolean sunos_scan_ext_relocs
     60static bfd_boolean sunos_scan_ext_relocs
    5761  PARAMS ((struct bfd_link_info *, bfd *, asection *,
    5862           const struct reloc_ext_external *, bfd_size_type));
    59 static boolean sunos_link_dynamic_object
     63static bfd_boolean sunos_link_dynamic_object
    6064  PARAMS ((struct bfd_link_info *, bfd *));
    61 static boolean sunos_write_dynamic_symbol
     65static bfd_boolean sunos_write_dynamic_symbol
    6266  PARAMS ((bfd *, struct bfd_link_info *, struct aout_link_hash_entry *));
    63 static boolean sunos_check_dynamic_reloc
     67static bfd_boolean sunos_check_dynamic_reloc
    6468  PARAMS ((struct bfd_link_info *, bfd *, asection *,
    65            struct aout_link_hash_entry *, PTR, bfd_byte *, boolean *,
     69           struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *,
    6670           bfd_vma *));
    67 static boolean sunos_finish_dynamic_link
     71static bfd_boolean sunos_finish_dynamic_link
    6872  PARAMS ((bfd *, struct bfd_link_info *));
    6973
     
    102106{
    103107  /* Whether we found any dynamic information.  */
    104   boolean valid;
     108  bfd_boolean valid;
    105109  /* Dynamic information.  */
    106110  struct internal_sun4_dynamic_link dyninfo;
     
    131135   creates and saves a sunos_dynamic_info structure.  If it can't find
    132136   __DYNAMIC, it sets the valid field of the sunos_dynamic_info
    133    structure to false to avoid doing this work again.  */
    134 
    135 static boolean
     137   structure to FALSE to avoid doing this work again.  */
     138
     139static bfd_boolean
    136140sunos_read_dynamic_info (abfd)
    137141     bfd *abfd;
     
    143147  unsigned long dynver;
    144148  struct external_sun4_dynamic_link linkinfo;
     149  bfd_size_type amt;
    145150
    146151  if (obj_aout_dynamic_info (abfd) != (PTR) NULL)
    147     return true;
     152    return TRUE;
    148153
    149154  if ((abfd->flags & DYNAMIC) == 0)
    150155    {
    151156      bfd_set_error (bfd_error_invalid_operation);
    152       return false;
    153     }
    154 
    155   info = ((struct sunos_dynamic_info *)
    156           bfd_zalloc (abfd, sizeof (struct sunos_dynamic_info)));
     157      return FALSE;
     158    }
     159
     160  amt = sizeof (struct sunos_dynamic_info);
     161  info = (struct sunos_dynamic_info *) bfd_zalloc (abfd, amt);
    157162  if (!info)
    158     return false;
    159   info->valid = false;
     163    return FALSE;
     164  info->valid = FALSE;
    160165  info->dynsym = NULL;
    161166  info->dynstr = NULL;
     
    173178     symbols for the __DYNAMIC symbol.  */
    174179  if ((abfd->flags & DYNAMIC) == 0)
    175     return true;
     180    return TRUE;
    176181  if (! bfd_get_section_contents (abfd, obj_datasec (abfd), (PTR) &dyninfo,
    177                                   (file_ptr) 0, sizeof dyninfo))
    178     return true;
     182                                  (file_ptr) 0,
     183                                  (bfd_size_type) sizeof dyninfo))
     184    return TRUE;
    179185
    180186  dynver = GET_WORD (abfd, dyninfo.ld_version);
    181187  if (dynver != 2 && dynver != 3)
    182     return true;
     188    return TRUE;
    183189
    184190  dynoff = GET_WORD (abfd, dyninfo.ld);
     
    192198  dynoff -= bfd_get_section_vma (abfd, dynsec);
    193199  if (dynoff > bfd_section_size (abfd, dynsec))
    194     return true;
     200    return TRUE;
    195201
    196202  /* This executable appears to be dynamically linked in a way that we
    197203     can understand.  */
    198   if (! bfd_get_section_contents (abfd, dynsec, (PTR) &linkinfo, dynoff,
     204  if (! bfd_get_section_contents (abfd, dynsec, (PTR) &linkinfo,
     205                                  (file_ptr) dynoff,
    199206                                  (bfd_size_type) sizeof linkinfo))
    200     return true;
     207    return TRUE;
    201208
    202209  /* Swap in the dynamic link information.  */
     
    245252                                  - info->dyninfo.ld_rel));
    246253
    247   info->valid = true;
    248 
    249   return true;
     254  info->valid = TRUE;
     255
     256  return TRUE;
    250257}
    251258
     
    273280/* Read the external dynamic symbols.  */
    274281
    275 static boolean
     282static bfd_boolean
    276283sunos_slurp_dynamic_symtab (abfd)
    277284     bfd *abfd;
    278285{
    279286  struct sunos_dynamic_info *info;
     287  bfd_size_type amt;
    280288
    281289  /* Get the general dynamic information.  */
     
    283291    {
    284292      if (! sunos_read_dynamic_info (abfd))
    285           return false;
     293          return FALSE;
    286294    }
    287295
     
    290298    {
    291299      bfd_set_error (bfd_error_no_symbols);
    292       return false;
     300      return FALSE;
    293301    }
    294302
     
    296304  if (info->dynsym == (struct external_nlist *) NULL)
    297305    {
    298       info->dynsym = ((struct external_nlist *)
    299                       bfd_alloc (abfd,
    300                                  (info->dynsym_count
    301                                   * EXTERNAL_NLIST_SIZE)));
     306      amt = (bfd_size_type) info->dynsym_count * EXTERNAL_NLIST_SIZE;
     307      info->dynsym = (struct external_nlist *) bfd_alloc (abfd, amt);
    302308      if (info->dynsym == NULL && info->dynsym_count != 0)
    303         return false;
    304       if (bfd_seek (abfd, info->dyninfo.ld_stab, SEEK_SET) != 0
    305           || (bfd_read ((PTR) info->dynsym, info->dynsym_count,
    306                         EXTERNAL_NLIST_SIZE, abfd)
    307               != info->dynsym_count * EXTERNAL_NLIST_SIZE))
     309        return FALSE;
     310      if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_stab, SEEK_SET) != 0
     311          || bfd_bread ((PTR) info->dynsym, amt, abfd) != amt)
    308312        {
    309313          if (info->dynsym != NULL)
     
    312316              info->dynsym = NULL;
    313317            }
    314           return false;
     318          return FALSE;
    315319        }
    316320    }
     
    319323  if (info->dynstr == (char *) NULL)
    320324    {
    321       info->dynstr = (char *) bfd_alloc (abfd, info->dyninfo.ld_symb_size);
     325      amt = info->dyninfo.ld_symb_size;
     326      info->dynstr = (char *) bfd_alloc (abfd, amt);
    322327      if (info->dynstr == NULL && info->dyninfo.ld_symb_size != 0)
    323         return false;
    324       if (bfd_seek (abfd, info->dyninfo.ld_symbols, SEEK_SET) != 0
    325           || (bfd_read ((PTR) info->dynstr, 1, info->dyninfo.ld_symb_size,
    326                         abfd)
    327               != info->dyninfo.ld_symb_size))
     328        return FALSE;
     329      if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_symbols, SEEK_SET) != 0
     330          || bfd_bread ((PTR) info->dynstr, amt, abfd) != amt)
    328331        {
    329332          if (info->dynstr != NULL)
     
    332335              info->dynstr = NULL;
    333336            }
    334           return false;
    335         }
    336     }
    337 
    338   return true;
     337          return FALSE;
     338        }
     339    }
     340
     341  return TRUE;
    339342}
    340343
     
    368371    if (table == NULL && table_size != 0)
    369372      abort ();
    370     if (bfd_seek (abfd, info->dyninfo.ld_hash, SEEK_SET) != 0
    371         || bfd_read ((PTR) table, 1, table_size, abfd) != table_size)
     373    if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_hash, SEEK_SET) != 0
     374        || bfd_bread ((PTR) table, table_size, abfd) != table_size)
    372375      abort ();
    373376    for (i = 0; i < info->dynsym_count; i++)
     
    399402  if (info->canonical_dynsym == (aout_symbol_type *) NULL)
    400403    {
    401       info->canonical_dynsym = ((aout_symbol_type *)
    402                                 bfd_alloc (abfd,
    403                                            (info->dynsym_count
    404                                             * sizeof (aout_symbol_type))));
     404      bfd_size_type size;
     405      bfd_size_type strsize = info->dyninfo.ld_symb_size;
     406
     407      size = (bfd_size_type) info->dynsym_count * sizeof (aout_symbol_type);
     408      info->canonical_dynsym = (aout_symbol_type *) bfd_alloc (abfd, size);
    405409      if (info->canonical_dynsym == NULL && info->dynsym_count != 0)
    406410        return -1;
    407411
    408412      if (! aout_32_translate_symbol_table (abfd, info->canonical_dynsym,
    409                                             info->dynsym, info->dynsym_count,
    410                                             info->dynstr,
    411                                             info->dyninfo.ld_symb_size,
    412                                             true))
     413                                            info->dynsym,
     414                                            (bfd_size_type) info->dynsym_count,
     415                                            info->dynstr, strsize, TRUE))
    413416        {
    414417          if (info->canonical_dynsym != NULL)
     
    460463  struct sunos_dynamic_info *info;
    461464  unsigned long i;
     465  bfd_size_type size;
    462466
    463467  /* Get the general dynamic information.  */
     
    478482  if (info->dynrel == NULL)
    479483    {
    480       info->dynrel = (PTR) bfd_alloc (abfd,
    481                                       (info->dynrel_count
    482                                        * obj_reloc_entry_size (abfd)));
    483       if (info->dynrel == NULL && info->dynrel_count != 0)
     484      size = (bfd_size_type) info->dynrel_count * obj_reloc_entry_size (abfd);
     485      info->dynrel = (PTR) bfd_alloc (abfd, size);
     486      if (info->dynrel == NULL && size != 0)
    484487        return -1;
    485       if (bfd_seek (abfd, info->dyninfo.ld_rel, SEEK_SET) != 0
    486           || (bfd_read ((PTR) info->dynrel, info->dynrel_count,
    487                         obj_reloc_entry_size (abfd), abfd)
    488               != info->dynrel_count * obj_reloc_entry_size (abfd)))
     488      if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_rel, SEEK_SET) != 0
     489          || bfd_bread ((PTR) info->dynrel, size, abfd) != size)
    489490        {
    490491          if (info->dynrel != NULL)
     
    503504      arelent *to;
    504505
    505       info->canonical_dynrel = ((arelent *)
    506                                 bfd_alloc (abfd,
    507                                            (info->dynrel_count
    508                                             * sizeof (arelent))));
     506      size = (bfd_size_type) info->dynrel_count * sizeof (arelent);
     507      info->canonical_dynrel = (arelent *) bfd_alloc (abfd, size);
    509508      if (info->canonical_dynrel == NULL && info->dynrel_count != 0)
    510509        return -1;
     
    521520          for (; p < pend; p++, to++)
    522521            NAME(aout,swap_ext_reloc_in) (abfd, p, to, syms,
    523                                           info->dynsym_count);
     522                                          (bfd_size_type) info->dynsym_count);
    524523        }
    525524      else
     
    532531          for (; p < pend; p++, to++)
    533532            NAME(aout,swap_std_reloc_in) (abfd, p, to, syms,
    534                                           info->dynsym_count);
     533                                          (bfd_size_type) info->dynsym_count);
    535534        }
    536535    }
     
    566565
    567566/* save %sp, -96, %sp */
    568 #define SPARC_PLT_ENTRY_WORD0 0x9de3bfa0
     567#define SPARC_PLT_ENTRY_WORD0 ((bfd_vma) 0x9de3bfa0)
    569568/* call; address filled in later.  */
    570 #define SPARC_PLT_ENTRY_WORD1 0x40000000
     569#define SPARC_PLT_ENTRY_WORD1 ((bfd_vma) 0x40000000)
    571570/* sethi; reloc index filled in later.  */
    572 #define SPARC_PLT_ENTRY_WORD2 0x01000000
     571#define SPARC_PLT_ENTRY_WORD2 ((bfd_vma) 0x01000000)
    573572
    574573/* This sequence is used when for the jump table entry to a defined
     
    576575   compiled code which is not being put into a shared library.  */
    577576/* sethi <address to be filled in later>, %g1 */
    578 #define SPARC_PLT_PIC_WORD0 0x03000000
     577#define SPARC_PLT_PIC_WORD0 ((bfd_vma) 0x03000000)
    579578/* jmp %g1 + <address to be filled in later> */
    580 #define SPARC_PLT_PIC_WORD1 0x81c06000
     579#define SPARC_PLT_PIC_WORD1 ((bfd_vma) 0x81c06000)
    581580/* nop */
    582 #define SPARC_PLT_PIC_WORD2 0x01000000
     581#define SPARC_PLT_PIC_WORD2 ((bfd_vma) 0x01000000)
    583582
    584583/* An m68k procedure linkage table entry is 8 bytes.  The first entry
     
    600599
    601600/* bsrl */
    602 #define M68K_PLT_ENTRY_WORD0 (0x61ff)
     601#define M68K_PLT_ENTRY_WORD0 ((bfd_vma) 0x61ff)
    603602/* Remaining words filled in later.  */
    604603
     
    653652
    654653  /* Whether we have created the dynamic sections.  */
    655   boolean dynamic_sections_created;
     654  bfd_boolean dynamic_sections_created;
    656655
    657656  /* Whether we need the dynamic sections.  */
    658   boolean dynamic_sections_needed;
     657  bfd_boolean dynamic_sections_needed;
    659658
    660659  /* Whether we need the .got table.  */
    661   boolean got_needed;
     660  bfd_boolean got_needed;
    662661
    663662  /* The number of dynamic symbols.  */
     
    717716{
    718717  struct sunos_link_hash_table *ret;
    719 
    720   ret = ((struct sunos_link_hash_table *)
    721          bfd_alloc (abfd, sizeof (struct sunos_link_hash_table)));
     718  bfd_size_type amt = sizeof (struct sunos_link_hash_table);
     719
     720  ret = (struct sunos_link_hash_table *) bfd_malloc (amt);
    722721  if (ret == (struct sunos_link_hash_table *) NULL)
    723722    return (struct bfd_link_hash_table *) NULL;
     
    725724                                         sunos_link_hash_newfunc))
    726725    {
    727       bfd_release (abfd, ret);
     726      free (ret);
    728727      return (struct bfd_link_hash_table *) NULL;
    729728    }
    730729
    731730  ret->dynobj = NULL;
    732   ret->dynamic_sections_created = false;
    733   ret->dynamic_sections_needed = false;
    734   ret->got_needed = false;
     731  ret->dynamic_sections_created = FALSE;
     732  ret->dynamic_sections_needed = FALSE;
     733  ret->got_needed = FALSE;
    735734  ret->dynsymcount = 0;
    736735  ret->bucketcount = 0;
     
    753752  (aout_link_hash_traverse                                              \
    754753   (&(table)->root,                                                     \
    755     (boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \
     754    (bfd_boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \
    756755    (info)))
    757756
     
    761760#define sunos_hash_table(p) ((struct sunos_link_hash_table *) ((p)->hash))
    762761
    763 static boolean sunos_scan_dynamic_symbol
     762static bfd_boolean sunos_scan_dynamic_symbol
    764763  PARAMS ((struct sunos_link_hash_entry *, PTR));
    765764
     
    771770   of the dynamic linking information.  */
    772771
    773 static boolean
     772static bfd_boolean
    774773sunos_create_dynamic_sections (abfd, info, needed)
    775774     bfd *abfd;
    776775     struct bfd_link_info *info;
    777      boolean needed;
     776     bfd_boolean needed;
    778777{
    779778  asection *s;
     
    795794          || ! bfd_set_section_flags (abfd, s, flags)
    796795          || ! bfd_set_section_alignment (abfd, s, 2))
    797         return false;
     796        return FALSE;
    798797
    799798      /* The .got section holds the global offset table.  The address
     
    803802          || ! bfd_set_section_flags (abfd, s, flags)
    804803          || ! bfd_set_section_alignment (abfd, s, 2))
    805         return false;
     804        return FALSE;
    806805
    807806      /* The .plt section holds the procedure linkage table.  The
     
    811810          || ! bfd_set_section_flags (abfd, s, flags | SEC_CODE)
    812811          || ! bfd_set_section_alignment (abfd, s, 2))
    813         return false;
     812        return FALSE;
    814813
    815814      /* The .dynrel section holds the dynamic relocs.  The address is
     
    819818          || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
    820819          || ! bfd_set_section_alignment (abfd, s, 2))
    821         return false;
     820        return FALSE;
    822821
    823822      /* The .hash section holds the dynamic hash table.  The address
     
    827826          || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
    828827          || ! bfd_set_section_alignment (abfd, s, 2))
    829         return false;
     828        return FALSE;
    830829
    831830      /* The .dynsym section holds the dynamic symbols.  The address
     
    835834          || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
    836835          || ! bfd_set_section_alignment (abfd, s, 2))
    837         return false;
     836        return FALSE;
    838837
    839838      /* The .dynstr section holds the dynamic symbol string table.
     
    843842          || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
    844843          || ! bfd_set_section_alignment (abfd, s, 2))
    845         return false;
    846 
    847       sunos_hash_table (info)->dynamic_sections_created = true;
     844        return FALSE;
     845
     846      sunos_hash_table (info)->dynamic_sections_created = TRUE;
    848847    }
    849848
     
    859858        s->_raw_size = BYTES_IN_WORD;
    860859
    861       sunos_hash_table (info)->dynamic_sections_needed = true;
    862       sunos_hash_table (info)->got_needed = true;
    863     }
    864 
    865   return true;
     860      sunos_hash_table (info)->dynamic_sections_needed = TRUE;
     861      sunos_hash_table (info)->got_needed = TRUE;
     862    }
     863
     864  return TRUE;
    866865}
    867866
     
    869868   backend linker for each object it encounters.  */
    870869
    871 static boolean
     870static bfd_boolean
    872871sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp)
    873872     bfd *abfd;
     
    877876     char **stringsp;
    878877{
    879   asection *s;
    880878  bfd *dynobj;
    881879  struct sunos_dynamic_info *dinfo;
    882880  unsigned long need;
     881  asection **ps;
    883882
    884883  /* Make sure we have all the required sections.  */
     
    886885    {
    887886      if (! sunos_create_dynamic_sections (abfd, info,
    888                                            (((abfd->flags & DYNAMIC) != 0
    889                                              && ! info->relocateable)
    890                                             ? true
    891                                             : false)))
    892         return false;
     887                                           ((abfd->flags & DYNAMIC) != 0
     888                                            && !info->relocateable)))
     889        return FALSE;
    893890    }
    894891
    895892  /* There is nothing else to do for a normal object.  */
    896893  if ((abfd->flags & DYNAMIC) == 0)
    897     return true;
     894    return TRUE;
    898895
    899896  dynobj = sunos_hash_table (info)->dynobj;
     
    906903     space in the output file.  If this is the first object we have
    907904     seen, we must preserve the dynamic sections we just created.  */
    908   if (abfd != dynobj)
    909     abfd->sections = NULL;
    910   else
    911     {
    912       asection *s;
    913 
    914       for (s = abfd->sections;
    915            (s->flags & SEC_LINKER_CREATED) == 0;
    916            s = s->next)
    917         ;
    918       abfd->sections = s;
     905  for (ps = &abfd->sections; *ps != NULL; )
     906    {
     907      if (abfd != dynobj || ((*ps)->flags & SEC_LINKER_CREATED) == 0)
     908        bfd_section_list_remove (abfd, ps);
     909      else
     910        ps = &(*ps)->next;
    919911    }
    920912
     
    922914     used.  */
    923915  if (info->relocateable)
    924     return true;
     916    return TRUE;
    925917
    926918  /* There's no hope of using a dynamic object which does not exactly
     
    929921    {
    930922      bfd_set_error (bfd_error_invalid_operation);
    931       return false;
     923      return FALSE;
    932924    }
    933925
     
    940932         which must be included at runtime.  The address of this
    941933         section is put in the ld_need field.  */
    942       s = bfd_make_section (dynobj, ".need");
     934      asection *s = bfd_make_section (dynobj, ".need");
    943935      if (s == NULL
    944936          || ! bfd_set_section_flags (dynobj, s,
     
    949941                                       | SEC_READONLY))
    950942          || ! bfd_set_section_alignment (dynobj, s, 2))
    951         return false;
     943        return FALSE;
    952944    }
    953945
     
    957949         objects.  The address of this section is put in the ld_rules
    958950         field.  */
    959       s = bfd_make_section (dynobj, ".rules");
     951      asection *s = bfd_make_section (dynobj, ".rules");
    960952      if (s == NULL
    961953          || ! bfd_set_section_flags (dynobj, s,
     
    966958                                       | SEC_READONLY))
    967959          || ! bfd_set_section_alignment (dynobj, s, 2))
    968         return false;
     960        return FALSE;
    969961    }
    970962
    971963  /* Pick up the dynamic symbols and return them to the caller.  */
    972964  if (! sunos_slurp_dynamic_symtab (abfd))
    973     return false;
     965    return FALSE;
    974966
    975967  dinfo = (struct sunos_dynamic_info *) obj_aout_dynamic_info (abfd);
     
    987979      struct bfd_link_needed_list *needed, **pp;
    988980      char *namebuf, *p;
    989       size_t alc;
     981      bfd_size_type alc;
    990982      bfd_byte b;
    991983      char *namecopy;
    992984
    993       if (bfd_seek (abfd, need, SEEK_SET) != 0
    994           || bfd_read (buf, 1, 16, abfd) != 16)
    995         return false;
     985      if (bfd_seek (abfd, (file_ptr) need, SEEK_SET) != 0
     986          || bfd_bread (buf, (bfd_size_type) 16, abfd) != 16)
     987        return FALSE;
    996988
    997989      /* For the format of an ld_need entry, see aout/sun4.h.  We
    998         should probably define structs for this manipulation.  */
     990        should probably define structs for this manipulation.  */
    999991
    1000992      name = bfd_get_32 (abfd, buf);
    1001993      flags = bfd_get_32 (abfd, buf + 4);
    1002       major_vno = (unsigned short)bfd_get_16 (abfd, buf + 8);
    1003       minor_vno = (unsigned short)bfd_get_16 (abfd, buf + 10);
     994      major_vno = (unsigned short) bfd_get_16 (abfd, buf + 8);
     995      minor_vno = (unsigned short) bfd_get_16 (abfd, buf + 10);
    1004996      need = bfd_get_32 (abfd, buf + 12);
    1005997
    1006       needed = ((struct bfd_link_needed_list *)
    1007                 bfd_alloc (abfd, sizeof (struct bfd_link_needed_list)));
     998      alc = sizeof (struct bfd_link_needed_list);
     999      needed = (struct bfd_link_needed_list *) bfd_alloc (abfd, alc);
    10081000      if (needed == NULL)
    1009         return false;
     1001        return FALSE;
    10101002      needed->by = abfd;
    10111003
     
    10141006      namebuf = (char *) bfd_malloc (alc + 1);
    10151007      if (namebuf == NULL)
    1016         return false;
     1008        return FALSE;
    10171009      p = namebuf;
    10181010
     
    10221014          *p++ = 'l';
    10231015        }
    1024       if (bfd_seek (abfd, name, SEEK_SET) != 0)
     1016      if (bfd_seek (abfd, (file_ptr) name, SEEK_SET) != 0)
    10251017        {
    10261018          free (namebuf);
    1027           return false;
     1019          return FALSE;
    10281020        }
    10291021
    10301022      do
    10311023        {
    1032           if (bfd_read (&b, 1, 1, abfd) != 1)
     1024          if (bfd_bread (&b, (bfd_size_type) 1, abfd) != 1)
    10331025            {
    10341026              free (namebuf);
    1035               return false;
     1027              return FALSE;
    10361028            }
    10371029
    1038           if ((size_t) (p - namebuf) >= alc)
     1030          if ((bfd_size_type) (p - namebuf) >= alc)
    10391031            {
    10401032              char *n;
     
    10451037                {
    10461038                  free (namebuf);
    1047                   return false;
     1039                  return FALSE;
    10481040                }
    10491041              p = n + (p - namebuf);
     
    10771069                {
    10781070                  free (namebuf);
    1079                   return false;
     1071                  return FALSE;
    10801072                }
    10811073              p = n + (p - namebuf);
     
    10871079        }
    10881080
    1089       namecopy = bfd_alloc (abfd, strlen (namebuf) + 1);
     1081      namecopy = bfd_alloc (abfd, (bfd_size_type) strlen (namebuf) + 1);
    10901082      if (namecopy == NULL)
    10911083        {
    10921084          free (namebuf);
    1093           return false;
     1085          return FALSE;
    10941086        }
    10951087      strcpy (namecopy, namebuf);
     
    11061098    }
    11071099
    1108   return true;
     1100  return TRUE;
    11091101}
    11101102
     
    11131105   tweaking needed for dynamic linking support.  */
    11141106
    1115 static boolean
     1107static bfd_boolean
    11161108sunos_add_one_symbol (info, abfd, name, flags, section, value, string,
    11171109                      copy, collect, hashp)
     
    11231115     bfd_vma value;
    11241116     const char *string;
    1125      boolean copy;
    1126      boolean collect;
     1117     bfd_boolean copy;
     1118     bfd_boolean collect;
    11271119     struct bfd_link_hash_entry **hashp;
    11281120{
     
    11321124  if ((flags & (BSF_INDIRECT | BSF_WARNING | BSF_CONSTRUCTOR)) != 0
    11331125      || ! bfd_is_und_section (section))
    1134     h = sunos_link_hash_lookup (sunos_hash_table (info), name, true, copy,
    1135                                 false);
     1126    h = sunos_link_hash_lookup (sunos_hash_table (info), name, TRUE, copy,
     1127                                FALSE);
    11361128  else
    11371129    h = ((struct sunos_link_hash_entry *)
    1138          bfd_wrapped_link_hash_lookup (abfd, info, name, true, copy, false));
     1130         bfd_wrapped_link_hash_lookup (abfd, info, name, TRUE, copy, FALSE));
    11391131  if (h == NULL)
    1140     return false;
     1132    return FALSE;
    11411133
    11421134  if (hashp != NULL)
     
    11921184    {
    11931185      /* The existing symbol is a constructor symbol, and this symbol
    1194         is from a dynamic object.  A constructor symbol is actually a
    1195         definition, although the type will be bfd_link_hash_undefined
    1196         at this point.  We want to ignore the definition from the
    1197         dynamic object.  */
     1186        is from a dynamic object.  A constructor symbol is actually a
     1187        definition, although the type will be bfd_link_hash_undefined
     1188        at this point.  We want to ignore the definition from the
     1189        dynamic object.  */
    11981190      section = bfd_und_section_ptr;
    11991191    }
     
    12051197    {
    12061198      /* The existing symbol is defined by a dynamic object, and this
    1207         is a constructor symbol.  As above, we want to force the use
    1208         of the constructor symbol from the regular object.  */
     1199        is a constructor symbol.  As above, we want to force the use
     1200        of the constructor symbol from the regular object.  */
    12091201      h->root.root.type = bfd_link_hash_new;
    12101202    }
     
    12141206                                          value, string, copy, collect,
    12151207                                          hashp))
    1216     return false;
     1208    return FALSE;
    12171209
    12181210  if (abfd->xvec == info->hash->creator)
     
    12511243    }
    12521244
    1253   return true;
     1245  return TRUE;
    12541246}
    12551247
     
    12701262   this in case some dynamic object refers to this symbol.  */
    12711263
    1272 boolean
     1264bfd_boolean
    12731265bfd_sunos_record_link_assignment (output_bfd, info, name)
    12741266     bfd *output_bfd;
     
    12791271
    12801272  if (output_bfd->xvec != &MY(vec))
    1281     return true;
     1273    return TRUE;
    12821274
    12831275  /* This is called after we have examined all the input objects.  If
     
    12851277     to it, and we can just ignore it at this point.  */
    12861278  h = sunos_link_hash_lookup (sunos_hash_table (info), name,
    1287                               false, false, false);
     1279                              FALSE, FALSE, FALSE);
    12881280  if (h == NULL)
    1289     return true;
     1281    return TRUE;
    12901282
    12911283  /* In a shared library, the __DYNAMIC symbol does not appear in the
     
    13021294    }
    13031295
    1304   return true;
     1296  return TRUE;
    13051297}
    13061298
     
    13111303   sections.  This unfortunately requires reading all the relocs so
    13121304   that we can work out which ones need to become dynamic relocs.  If
    1313    info->keep_memory is true, we keep the relocs in memory; otherwise,
     1305   info->keep_memory is TRUE, we keep the relocs in memory; otherwise,
    13141306   we discard them, and will read them again later.  */
    13151307
    1316 boolean
     1308bfd_boolean
    13171309bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr,
    13181310                                 srulesptr)
     
    13241316{
    13251317  bfd *dynobj;
    1326   size_t dynsymcount;
     1318  bfd_size_type dynsymcount;
    13271319  struct sunos_link_hash_entry *h;
    13281320  asection *s;
    13291321  size_t bucketcount;
    1330   size_t hashalloc;
     1322  bfd_size_type hashalloc;
    13311323  size_t i;
    13321324  bfd *sub;
     
    13371329
    13381330  if (info->relocateable)
    1339     return true;
     1331    return TRUE;
    13401332
    13411333  if (output_bfd->xvec != &MY(vec))
    1342     return true;
     1334    return TRUE;
    13431335
    13441336  /* Look through all the input BFD's and read their relocs.  It would
     
    13561348              || ! sunos_scan_relocs (info, sub, obj_datasec (sub),
    13571349                                      exec_hdr (sub)->a_drsize))
    1358             return false;
     1350            return FALSE;
    13591351        }
    13601352    }
     
    13671359  if (! sunos_hash_table (info)->dynamic_sections_needed
    13681360      && ! sunos_hash_table (info)->got_needed)
    1369     return true;
     1361    return TRUE;
    13701362
    13711363  /* If __GLOBAL_OFFSET_TABLE_ was mentioned, define it.  */
    13721364  h = sunos_link_hash_lookup (sunos_hash_table (info),
    1373                               "__GLOBAL_OFFSET_TABLE_", false, false, false);
     1365                              "__GLOBAL_OFFSET_TABLE_", FALSE, FALSE, FALSE);
    13741366  if (h != NULL && (h->flags & SUNOS_REF_REGULAR) != 0)
    13751367    {
     
    13841376
    13851377      /* If the .got section is more than 0x1000 bytes, we set
    1386         __GLOBAL_OFFSET_TABLE_ to be 0x1000 bytes into the section,
    1387         so that 13 bit relocations have a greater chance of working.  */
     1378        __GLOBAL_OFFSET_TABLE_ to be 0x1000 bytes into the section,
     1379        so that 13 bit relocations have a greater chance of working.  */
    13881380      s = bfd_get_section_by_name (dynobj, ".got");
    13891381      BFD_ASSERT (s != NULL);
     
    14221414      s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size);
    14231415      if (s->contents == NULL && s->_raw_size != 0)
    1424         return false;
     1416        return FALSE;
    14251417
    14261418      /* The number of buckets is just the number of symbols divided
     
    14411433      BFD_ASSERT (s != NULL);
    14421434      hashalloc = (dynsymcount + bucketcount - 1) * HASH_ENTRY_SIZE;
    1443       s->contents = (bfd_byte *) bfd_alloc (dynobj, hashalloc);
     1435      s->contents = (bfd_byte *) bfd_zalloc (dynobj, hashalloc);
    14441436      if (s->contents == NULL && dynsymcount > 0)
    1445         return false;
    1446       memset (s->contents, 0, hashalloc);
     1437        return FALSE;
    14471438      for (i = 0; i < bucketcount; i++)
    14481439        PUT_WORD (output_bfd, (bfd_vma) -1, s->contents + i * HASH_ENTRY_SIZE);
     
    14721463          add = 8 - (s->_raw_size & 7);
    14731464          contents = (bfd_byte *) bfd_realloc (s->contents,
    1474                                                (size_t) (s->_raw_size + add));
     1465                                               s->_raw_size + add);
    14751466          if (contents == NULL)
    1476             return false;
     1467            return FALSE;
    14771468          memset (contents + s->_raw_size, 0, (size_t) add);
    14781469          s->contents = contents;
     
    14891480      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
    14901481      if (s->contents == NULL)
    1491         return false;
     1482        return FALSE;
    14921483
    14931484      /* Fill in the first entry in the table.  */
     
    15121503      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
    15131504      if (s->contents == NULL)
    1514         return false;
     1505        return FALSE;
    15151506    }
    15161507  /* We use the reloc_count field to keep track of how many of the
     
    15221513  s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
    15231514  if (s->contents == NULL)
    1524     return false;
     1515    return FALSE;
    15251516
    15261517  *sneedptr = bfd_get_section_by_name (dynobj, ".need");
    15271518  *srulesptr = bfd_get_section_by_name (dynobj, ".rules");
    15281519
    1529   return true;
     1520  return TRUE;
    15301521}
    15311522
    15321523/* Scan the relocs for an input section.  */
    15331524
    1534 static boolean
     1525static bfd_boolean
    15351526sunos_scan_relocs (info, abfd, sec, rel_size)
    15361527     struct bfd_link_info *info;
     
    15431534
    15441535  if (rel_size == 0)
    1545     return true;
     1536    return TRUE;
    15461537
    15471538  if (! info->keep_memory)
    1548     relocs = free_relocs = bfd_malloc ((size_t) rel_size);
     1539    relocs = free_relocs = bfd_malloc (rel_size);
    15491540  else
    15501541    {
    15511542      struct aout_section_data_struct *n;
    1552 
    1553       n = ((struct aout_section_data_struct *)
    1554            bfd_alloc (abfd, sizeof (struct aout_section_data_struct)));
     1543      bfd_size_type amt = sizeof (struct aout_section_data_struct);
     1544
     1545      n = (struct aout_section_data_struct *) bfd_alloc (abfd, amt);
    15551546      if (n == NULL)
    15561547        relocs = NULL;
     
    15581549        {
    15591550          set_aout_section_data (sec, n);
    1560           relocs = bfd_malloc ((size_t) rel_size);
     1551          relocs = bfd_malloc (rel_size);
    15611552          aout_section_data (sec)->relocs = relocs;
    15621553        }
    15631554    }
    15641555  if (relocs == NULL)
    1565     return false;
     1556    return FALSE;
    15661557
    15671558  if (bfd_seek (abfd, sec->rel_filepos, SEEK_SET) != 0
    1568       || bfd_read (relocs, 1, rel_size, abfd) != rel_size)
     1559      || bfd_bread (relocs, rel_size, abfd) != rel_size)
    15691560    goto error_return;
    15701561
     
    15871578    free (free_relocs);
    15881579
    1589   return true;
     1580  return TRUE;
    15901581
    15911582 error_return:
    15921583  if (free_relocs != NULL)
    15931584    free (free_relocs);
    1594   return false;
     1585  return FALSE;
    15951586}
    15961587
     
    16051596   building global offset table entries.  */
    16061597
    1607 static boolean
     1598static bfd_boolean
    16081599sunos_scan_std_relocs (info, abfd, sec, relocs, rel_size)
    16091600     struct bfd_link_info *info;
     
    16231614    {
    16241615      bfd_set_error (bfd_error_invalid_target);
    1625       return false;
     1616      return FALSE;
    16261617    }
    16271618
     
    16851676          asection *sgot;
    16861677
    1687           if (! sunos_create_dynamic_sections (abfd, info, false))
    1688             return false;
     1678          if (! sunos_create_dynamic_sections (abfd, info, FALSE))
     1679            return FALSE;
    16891680          dynobj = sunos_hash_table (info)->dynobj;
    16901681          splt = bfd_get_section_by_name (dynobj, ".plt");
     
    16961687          if (sgot->_raw_size == 0)
    16971688            sgot->_raw_size = BYTES_IN_WORD;
    1698           sunos_hash_table (info)->got_needed = true;
     1689          sunos_hash_table (info)->got_needed = TRUE;
    16991690        }
    17001691
     
    17561747    }
    17571748
    1758   return true;
     1749  return TRUE;
    17591750}
    17601751
     
    17651756   Otherwise, we must preserve the reloc as a dynamic reloc.  */
    17661757
    1767 static boolean
     1758static bfd_boolean
    17681759sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size)
    17691760     struct bfd_link_info *info;
     
    17791770  asection *sgot = NULL;
    17801771  asection *srel = NULL;
     1772  bfd_size_type amt;
    17811773
    17821774  /* We only know how to handle SPARC plt entries.  */
     
    17841776    {
    17851777      bfd_set_error (bfd_error_invalid_target);
    1786       return false;
     1778      return FALSE;
    17871779    }
    17881780
     
    18311823
    18321824      /* If this is a base relative reloc, we need to make an entry in
    1833         the .got section.  */
     1825        the .got section.  */
    18341826      if (r_type == RELOC_BASE10
    18351827          || r_type == RELOC_BASE13
     
    18381830          if (dynobj == NULL)
    18391831            {
    1840               if (! sunos_create_dynamic_sections (abfd, info, false))
    1841                 return false;
     1832              if (! sunos_create_dynamic_sections (abfd, info, FALSE))
     1833                return FALSE;
    18421834              dynobj = sunos_hash_table (info)->dynobj;
    18431835              splt = bfd_get_section_by_name (dynobj, ".plt");
     
    18491841              if (sgot->_raw_size == 0)
    18501842                sgot->_raw_size = BYTES_IN_WORD;
    1851               sunos_hash_table (info)->got_needed = true;
     1843              sunos_hash_table (info)->got_needed = TRUE;
    18521844            }
    18531845
     
    18701862              if (adata (abfd).local_got_offsets == NULL)
    18711863                {
     1864                  amt = bfd_get_symcount (abfd);
     1865                  amt *= sizeof (bfd_vma);
    18721866                  adata (abfd).local_got_offsets =
    1873                     (bfd_vma *) bfd_zalloc (abfd,
    1874                                             (bfd_get_symcount (abfd)
    1875                                              * sizeof (bfd_vma)));
     1867                    (bfd_vma *) bfd_zalloc (abfd, amt);
    18761868                  if (adata (abfd).local_got_offsets == NULL)
    1877                     return false;
     1869                    return FALSE;
    18781870                }
    18791871
     
    18991891
    19001892      /* Otherwise, we are only interested in relocs against symbols
    1901         defined in dynamic objects but not in regular objects.  We
    1902         only need to consider relocs against external symbols.  */
     1893        defined in dynamic objects but not in regular objects.  We
     1894        only need to consider relocs against external symbols.  */
    19031895      if (! r_extern)
    19041896        {
    19051897          /* But, if we are creating a shared library, we need to
    1906              generate an absolute reloc.  */
     1898             generate an absolute reloc.  */
    19071899          if (info->shared)
    19081900            {
    19091901              if (dynobj == NULL)
    19101902                {
    1911                   if (! sunos_create_dynamic_sections (abfd, info, true))
    1912                     return false;
     1903                  if (! sunos_create_dynamic_sections (abfd, info, TRUE))
     1904                    return FALSE;
    19131905                  dynobj = sunos_hash_table (info)->dynobj;
    19141906                  splt = bfd_get_section_by_name (dynobj, ".plt");
     
    19461938        {
    19471939          /* This symbol is apparently undefined.  Don't do anything
    1948              here; just let the relocation routine report an undefined
    1949              symbol.  */
     1940             here; just let the relocation routine report an undefined
     1941             symbol.  */
    19501942          continue;
    19511943        }
     
    19561948      if (dynobj == NULL)
    19571949        {
    1958           if (! sunos_create_dynamic_sections (abfd, info, false))
    1959             return false;
     1950          if (! sunos_create_dynamic_sections (abfd, info, FALSE))
     1951            return FALSE;
    19601952          dynobj = sunos_hash_table (info)->dynobj;
    19611953          splt = bfd_get_section_by_name (dynobj, ".plt");
     
    19671959          if (sgot->_raw_size == 0)
    19681960            sgot->_raw_size = BYTES_IN_WORD;
    1969           sunos_hash_table (info)->got_needed = true;
     1961          sunos_hash_table (info)->got_needed = TRUE;
    19701962        }
    19711963
     
    20322024
    20332025              /* We will also need a dynamic reloc entry, unless this
    2034                 is a JMP_TBL reloc produced by linking PIC compiled
    2035                 code, and we are not making a shared library.  */
     2026                is a JMP_TBL reloc produced by linking PIC compiled
     2027                code, and we are not making a shared library.  */
    20362028              if (info->shared || (h->flags & SUNOS_DEF_REGULAR) == 0)
    20372029                srel->_raw_size += RELOC_EXT_SIZE;
     
    20392031
    20402032          /* If we are creating a shared library, we need to copy over
    2041              any reloc other than a jump table reloc.  */
     2033             any reloc other than a jump table reloc.  */
    20422034          if (info->shared && r_type != RELOC_JMP_TBL)
    20432035            srel->_raw_size += RELOC_EXT_SIZE;
     
    20452037    }
    20462038
    2047   return true;
     2039  return TRUE;
    20482040}
    20492041
     
    20512043   symbols from dynamic objects which we do not plan to write out.  */
    20522044
    2053 static boolean
     2045static bfd_boolean
    20542046sunos_scan_dynamic_symbol (h, data)
    20552047     struct sunos_link_hash_entry *h;
     
    20572049{
    20582050  struct bfd_link_info *info = (struct bfd_link_info *) data;
     2051
     2052  if (h->root.root.type == bfd_link_hash_warning)
     2053    h = (struct sunos_link_hash_entry *) h->root.root.u.i.link;
    20592054
    20602055  /* Set the written flag for symbols we do not want to write out as
     
    20702065      && (h->flags & SUNOS_DEF_DYNAMIC) != 0
    20712066      && strcmp (h->root.root.root.string, "__DYNAMIC") != 0)
    2072     h->root.written = true;
     2067    h->root.written = TRUE;
    20732068
    20742069  /* If this symbol is defined by a dynamic object and referenced by a
     
    21292124                                           s->_raw_size + len + 1);
    21302125      if (contents == NULL)
    2131         return false;
     2126        return FALSE;
    21322127      s->contents = contents;
    21332128
     
    21652160    }
    21662161
    2167   return true;
     2162  return TRUE;
    21682163}
    21692164
     
    21732168
    21742169/*ARGSUSED*/
    2175 static boolean
     2170static bfd_boolean
    21762171sunos_link_dynamic_object (info, abfd)
    21772172     struct bfd_link_info *info ATTRIBUTE_UNUSED;
    21782173     bfd *abfd ATTRIBUTE_UNUSED;
    21792174{
    2180   return true;
     2175  return TRUE;
    21812176}
    21822177
     
    21842179   over the symbol table.  */
    21852180
    2186 static boolean
     2181static bfd_boolean
    21872182sunos_write_dynamic_symbol (output_bfd, info, harg)
    21882183     bfd *output_bfd;
     
    22032198      asection *splt;
    22042199      bfd_byte *p;
    2205       asection *s;
    22062200      bfd_vma r_address;
    22072201
     
    22322226          else
    22332227            {
    2234               bfd_vma val;
    2235 
    22362228              val = (h->root.root.u.def.section->output_section->vma
    22372229                     + h->root.root.u.def.section->output_offset
     
    22522244          bfd_put_16 (output_bfd, M68K_PLT_ENTRY_WORD0, p);
    22532245          bfd_put_32 (output_bfd, (- (h->plt_offset + 2)), p + 2);
    2254           bfd_put_16 (output_bfd, s->reloc_count, p + 6);
     2246          bfd_put_16 (output_bfd, (bfd_vma) s->reloc_count, p + 6);
    22552247          r_address += 2;
    22562248          break;
     
    22612253
    22622254      /* We also need to add a jump table reloc, unless this is the
    2263         result of a JMP_TBL reloc from PIC compiled code.  */
     2255        result of a JMP_TBL reloc from PIC compiled code.  */
    22642256      if (info->shared || (h->flags & SUNOS_DEF_REGULAR) == 0)
    22652257        {
     
    23272319     compiled code from a regular object.  */
    23282320  if (h->dynindx < 0)
    2329     return true;
     2321    return TRUE;
    23302322
    23312323  switch (h->root.root.type)
     
    23352327      abort ();
    23362328      /* Avoid variable not initialized warnings.  */
    2337       return true;
     2329      return TRUE;
    23382330    case bfd_link_hash_undefined:
    23392331      type = N_UNDF | N_EXT;
     
    23932385      /* FIXME: Ignore these for now.  The circumstances under which
    23942386         they should be written out are not clear to me.  */
    2395       return true;
     2387      return TRUE;
    23962388    }
    23972389
     
    24012393            (s->contents + h->dynindx * EXTERNAL_NLIST_SIZE));
    24022394
    2403   bfd_h_put_8 (output_bfd, type, outsym->e_type);
    2404   bfd_h_put_8 (output_bfd, 0, outsym->e_other);
     2395  H_PUT_8 (output_bfd, type, outsym->e_type);
     2396  H_PUT_8 (output_bfd, 0, outsym->e_other);
    24052397
    24062398  /* FIXME: The native linker doesn't use 0 for desc.  It seems to use
    24072399     one less than the desc value in the shared library, although that
    24082400     seems unlikely.  */
    2409   bfd_h_put_16 (output_bfd, 0, outsym->e_desc);
     2401  H_PUT_16 (output_bfd, 0, outsym->e_desc);
    24102402
    24112403  PUT_WORD (output_bfd, h->dynstr_index, outsym->e_strx);
    24122404  PUT_WORD (output_bfd, val, outsym->e_value);
    24132405
    2414   return true;
     2406  return TRUE;
    24152407}
    24162408
     
    24212413
    24222414/*ARGSUSED*/
    2423 static boolean
     2415static bfd_boolean
    24242416sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc,
    24252417                           contents, skip, relocationp)
     
    24302422     PTR reloc;
    24312423     bfd_byte *contents ATTRIBUTE_UNUSED;
    2432      boolean *skip;
     2424     bfd_boolean *skip;
    24332425     bfd_vma *relocationp;
    24342426{
    24352427  struct sunos_link_hash_entry *h = (struct sunos_link_hash_entry *) harg;
    24362428  bfd *dynobj;
    2437   boolean baserel;
    2438   boolean jmptbl;
    2439   boolean pcrel;
     2429  bfd_boolean baserel;
     2430  bfd_boolean jmptbl;
     2431  bfd_boolean pcrel;
    24402432  asection *s;
    24412433  bfd_byte *p;
    24422434  long indx;
    24432435
    2444   *skip = false;
     2436  *skip = FALSE;
    24452437
    24462438  dynobj = sunos_hash_table (info)->dynobj;
     
    25002492               || r_type == RELOC_WDISP22);
    25012493      /* We don't consider the PC10 and PC22 types to be PC relative,
    2502         because they are pcrel_offset.  */
     2494        because they are pcrel_offset.  */
    25032495    }
    25042496
     
    25692561            {
    25702562              /* We need to create a GLOB_DAT or 32 reloc to tell the
    2571                 dynamic linker to fill in this entry in the table.  */
     2563                dynamic linker to fill in this entry in the table.  */
    25722564
    25732565              s = bfd_get_section_by_name (dynobj, ".dynrel");
     
    26702662
    26712663      *relocationp = (sgot->vma
    2672                       + (*got_offsetp &~ 1)
     2664                      + (*got_offsetp &~ (bfd_vma) 1)
    26732665                      - sunos_hash_table (info)->got_base);
    26742666
    26752667      /* There is nothing else to do for a base relative reloc.  */
    2676       return true;
     2668      return TRUE;
    26772669    }
    26782670
    26792671  if (! sunos_hash_table (info)->dynamic_sections_needed)
    2680     return true;
     2672    return TRUE;
    26812673  if (! info->shared)
    26822674    {
     
    26872679          || (h->flags & SUNOS_DEF_DYNAMIC) == 0
    26882680          || (h->root.root.u.undef.abfd->flags & DYNAMIC) == 0)
    2689         return true;
     2681        return TRUE;
    26902682    }
    26912683  else
     
    26962688              || strcmp (h->root.root.root.string,
    26972689                         "__GLOBAL_OFFSET_TABLE_") == 0))
    2698         return true;
     2690        return TRUE;
    26992691    }
    27002692
     
    27392731        }
    27402732      /* FIXME: We may have to change the addend for a PC relative
    2741         reloc.  */
     2733        reloc.  */
    27422734    }
    27432735  else
     
    27782770
    27792771  if (h != NULL)
    2780     *skip = true;
    2781 
    2782   return true;
     2772    *skip = TRUE;
     2773
     2774  return TRUE;
    27832775}
    27842776
    27852777/* Finish up the dynamic linking information.  */
    27862778
    2787 static boolean
     2779static bfd_boolean
    27882780sunos_finish_dynamic_link (abfd, info)
    27892781     bfd *abfd;
     
    27972789  if (! sunos_hash_table (info)->dynamic_sections_needed
    27982790      && ! sunos_hash_table (info)->got_needed)
    2799     return true;
     2791    return TRUE;
    28002792
    28012793  dynobj = sunos_hash_table (info)->dynobj;
     
    28472839                      && o->output_section->owner == abfd);
    28482840          if (! bfd_set_section_contents (abfd, o->output_section,
    2849                                           o->contents, o->output_offset,
     2841                                          o->contents,
     2842                                          (file_ptr) o->output_offset,
    28502843                                          o->_raw_size))
    2851             return false;
     2844            return FALSE;
    28522845        }
    28532846    }
     
    28572850      struct external_sun4_dynamic esd;
    28582851      struct external_sun4_dynamic_link esdl;
     2852      file_ptr pos;
    28592853
    28602854      /* Finish up the dynamic link information.  */
     
    28712865
    28722866      if (! bfd_set_section_contents (abfd, sdyn->output_section, &esd,
    2873                                       sdyn->output_offset, sizeof esd))
    2874         return false;
     2867                                      (file_ptr) sdyn->output_offset,
     2868                                      (bfd_size_type) sizeof esd))
     2869        return FALSE;
    28752870
    28762871      PUT_WORD (dynobj, (bfd_vma) 0, esdl.ld_loaded);
     
    29362931                esdl.ld_text);
    29372932
     2933      pos = sdyn->output_offset;
     2934      pos += sizeof esd + EXTERNAL_SUN4_DYNAMIC_DEBUGGER_SIZE;
    29382935      if (! bfd_set_section_contents (abfd, sdyn->output_section, &esdl,
    2939                                       (sdyn->output_offset
    2940                                        + sizeof esd
    2941                                        + EXTERNAL_SUN4_DYNAMIC_DEBUGGER_SIZE),
    2942                                       sizeof esdl))
    2943         return false;
     2936                                      pos, (bfd_size_type) sizeof esdl))
     2937        return FALSE;
    29442938
    29452939      abfd->flags |= DYNAMIC;
    29462940    }
    29472941
    2948   return true;
     2942  return TRUE;
    29492943}
Note: See TracChangeset for help on using the changeset viewer.