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

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* bfd back-end for HP PA-RISC SOM objects.
    22   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    3    2000, 2001
     3   2000, 2001, 2002, 2003
    44   Free Software Foundation, Inc.
    55
     
    3232#include "libbfd.h"
    3333#include "som.h"
     34#include "safe-ctype.h"
    3435
    3536#include <sys/param.h>
     
    3738#include <machine/reg.h>
    3839#include <sys/file.h>
    39 #include <ctype.h>
    40 
    41 /* Magic not defined in standard HP-UX header files until 8.0 */
     40
     41/* Magic not defined in standard HP-UX header files until 8.0.  */
    4242
    4343#ifndef CPU_PA_RISC1_0
     
    103103/* Generic alignment macro.  */
    104104#define SOM_ALIGN(val, alignment) \
    105   (((val) + (alignment) - 1) & ~((alignment) - 1))
     105  (((val) + (alignment) - 1) &~ ((unsigned long) (alignment) - 1))
    106106
    107107/* SOM allows any one of the four previous relocations to be reused
     
    149149};
    150150
    151 /* Forward declarations */
    152 
    153 static boolean som_mkobject PARAMS ((bfd *));
    154 static const bfd_target * som_object_setup PARAMS ((bfd *,
    155                                                     struct header *,
    156                                                     struct som_exec_auxhdr *,
    157                                                     unsigned long));
    158 static boolean setup_sections PARAMS ((bfd *, struct header *, unsigned long));
    159 static const bfd_target * som_object_p PARAMS ((bfd *));
    160 static boolean som_write_object_contents PARAMS ((bfd *));
    161 static boolean som_slurp_string_table PARAMS ((bfd *));
    162 static unsigned int som_slurp_symbol_table PARAMS ((bfd *));
    163 static long som_get_symtab_upper_bound PARAMS ((bfd *));
    164 static long som_canonicalize_reloc PARAMS ((bfd *, sec_ptr,
    165                                             arelent **, asymbol **));
    166 static long som_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr));
    167 static unsigned int som_set_reloc_info PARAMS ((unsigned char *, unsigned int,
    168                                                 arelent *, asection *,
    169                                                 asymbol **, boolean));
    170 static boolean som_slurp_reloc_table PARAMS ((bfd *, asection *,
    171                                               asymbol **, boolean));
    172 static long som_get_symtab PARAMS ((bfd *, asymbol **));
    173 static asymbol * som_make_empty_symbol PARAMS ((bfd *));
    174 static void som_print_symbol PARAMS ((bfd *, PTR,
    175                                       asymbol *, bfd_print_symbol_type));
    176 static boolean som_new_section_hook PARAMS ((bfd *, asection *));
    177 static boolean som_bfd_copy_private_symbol_data PARAMS ((bfd *, asymbol *,
    178                                                           bfd *, asymbol *));
    179 static boolean som_bfd_copy_private_section_data PARAMS ((bfd *, asection *,
    180                                                           bfd *, asection *));
    181 static boolean som_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *));
     151/* Forward declarations.  */
     152
     153static bfd_boolean som_mkobject
     154  PARAMS ((bfd *));
     155static const bfd_target * som_object_setup
     156  PARAMS ((bfd *, struct header *, struct som_exec_auxhdr *, unsigned long));
     157static bfd_boolean setup_sections
     158  PARAMS ((bfd *, struct header *, unsigned long));
     159static const bfd_target * som_object_p
     160  PARAMS ((bfd *));
     161static bfd_boolean som_write_object_contents
     162  PARAMS ((bfd *));
     163static bfd_boolean som_slurp_string_table
     164  PARAMS ((bfd *));
     165static unsigned int som_slurp_symbol_table
     166  PARAMS ((bfd *));
     167static long som_get_symtab_upper_bound
     168  PARAMS ((bfd *));
     169static long som_canonicalize_reloc
     170  PARAMS ((bfd *, sec_ptr, arelent **, asymbol **));
     171static long som_get_reloc_upper_bound
     172  PARAMS ((bfd *, sec_ptr));
     173static unsigned int som_set_reloc_info
     174  PARAMS ((unsigned char *, unsigned int, arelent *, asection *,
     175           asymbol **, bfd_boolean));
     176static bfd_boolean som_slurp_reloc_table
     177  PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
     178static long som_get_symtab
     179  PARAMS ((bfd *, asymbol **));
     180static asymbol * som_make_empty_symbol
     181  PARAMS ((bfd *));
     182static void som_print_symbol
     183  PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type));
     184static bfd_boolean som_new_section_hook
     185  PARAMS ((bfd *, asection *));
     186static bfd_boolean som_bfd_copy_private_symbol_data
     187  PARAMS ((bfd *, asymbol *, bfd *, asymbol *));
     188static bfd_boolean som_bfd_copy_private_section_data
     189  PARAMS ((bfd *, asection *, bfd *, asection *));
     190static bfd_boolean som_bfd_copy_private_bfd_data
     191  PARAMS ((bfd *, bfd *));
    182192#define som_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
    183193#define som_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
    184 static boolean som_bfd_is_local_label_name PARAMS ((bfd *, const char *));
    185 static boolean som_set_section_contents PARAMS ((bfd *, sec_ptr, PTR,
    186                                                  file_ptr, bfd_size_type));
    187 static boolean som_get_section_contents PARAMS ((bfd *, sec_ptr, PTR,
    188                                                  file_ptr, bfd_size_type));
    189 static boolean som_set_arch_mach PARAMS ((bfd *, enum bfd_architecture,
    190                                           unsigned long));
    191 static boolean som_find_nearest_line PARAMS ((bfd *, asection *,
    192                                               asymbol **, bfd_vma,
    193                                               CONST char **,
    194                                               CONST char **,
    195                                               unsigned int *));
    196 static void som_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
    197 static asection * bfd_section_from_som_symbol PARAMS ((bfd *,
    198                                         struct symbol_dictionary_record *));
    199 static int log2 PARAMS ((unsigned int));
    200 static bfd_reloc_status_type hppa_som_reloc PARAMS ((bfd *, arelent *,
    201                                                      asymbol *, PTR,
    202                                                      asection *, bfd *,
    203                                                      char **));
    204 static void som_initialize_reloc_queue PARAMS ((struct reloc_queue *));
    205 static void som_reloc_queue_insert PARAMS ((unsigned char *, unsigned int,
    206                                             struct reloc_queue *));
    207 static void som_reloc_queue_fix PARAMS ((struct reloc_queue *, unsigned int));
    208 static int som_reloc_queue_find PARAMS ((unsigned char *, unsigned int,
    209                                          struct reloc_queue *));
    210 static unsigned char * try_prev_fixup PARAMS ((bfd *, int *, unsigned char *,
    211                                                unsigned int,
    212                                                struct reloc_queue *));
    213 
    214 static unsigned char * som_reloc_skip PARAMS ((bfd *, unsigned int,
    215                                                unsigned char *, unsigned int *,
    216                                                struct reloc_queue *));
    217 static unsigned char * som_reloc_addend PARAMS ((bfd *, int, unsigned char *,
    218                                                  unsigned int *,
    219                                                  struct reloc_queue *));
    220 static unsigned char * som_reloc_call PARAMS ((bfd *, unsigned char *,
    221                                                unsigned int *,
    222                                                arelent *, int,
    223                                                struct reloc_queue *));
    224 static unsigned long som_count_spaces PARAMS ((bfd *));
    225 static unsigned long som_count_subspaces PARAMS ((bfd *));
    226 static int compare_syms PARAMS ((const void *, const void *));
    227 static int compare_subspaces PARAMS ((const void *, const void *));
    228 static unsigned long som_compute_checksum PARAMS ((bfd *));
    229 static boolean som_prep_headers PARAMS ((bfd *));
    230 static int som_sizeof_headers PARAMS ((bfd *, boolean));
    231 static boolean som_finish_writing PARAMS ((bfd *));
    232 static boolean som_build_and_write_symbol_table PARAMS ((bfd *));
    233 static void som_prep_for_fixups PARAMS ((bfd *, asymbol **, unsigned long));
    234 static boolean som_write_fixups PARAMS ((bfd *, unsigned long, unsigned int *));
    235 static boolean som_write_space_strings PARAMS ((bfd *, unsigned long,
    236                                                 unsigned int *));
    237 static boolean som_write_symbol_strings PARAMS ((bfd *, unsigned long,
    238                                                  asymbol **, unsigned int,
    239                                                  unsigned *,
    240                                                  COMPUNIT *));
    241 static boolean som_begin_writing PARAMS ((bfd *));
     194static bfd_boolean som_bfd_is_local_label_name
     195  PARAMS ((bfd *, const char *));
     196static bfd_boolean som_set_section_contents
     197  PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
     198static bfd_boolean som_get_section_contents
     199  PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
     200static bfd_boolean som_set_arch_mach
     201  PARAMS ((bfd *, enum bfd_architecture, unsigned long));
     202static bfd_boolean som_find_nearest_line
     203  PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
     204           const char **, unsigned int *));
     205static void som_get_symbol_info
     206  PARAMS ((bfd *, asymbol *, symbol_info *));
     207static asection * bfd_section_from_som_symbol
     208  PARAMS ((bfd *, struct symbol_dictionary_record *));
     209static int log2
     210  PARAMS ((unsigned int));
     211static bfd_reloc_status_type hppa_som_reloc
     212  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
     213static void som_initialize_reloc_queue
     214  PARAMS ((struct reloc_queue *));
     215static void som_reloc_queue_insert
     216  PARAMS ((unsigned char *, unsigned int, struct reloc_queue *));
     217static void som_reloc_queue_fix
     218  PARAMS ((struct reloc_queue *, unsigned int));
     219static int som_reloc_queue_find
     220  PARAMS ((unsigned char *, unsigned int, struct reloc_queue *));
     221static unsigned char * try_prev_fixup
     222  PARAMS ((bfd *, int *, unsigned char *, unsigned int, struct reloc_queue *));
     223static unsigned char * som_reloc_skip
     224  PARAMS ((bfd *, unsigned int, unsigned char *, unsigned int *,
     225           struct reloc_queue *));
     226static unsigned char * som_reloc_addend
     227  PARAMS ((bfd *, bfd_vma, unsigned char *, unsigned int *,
     228           struct reloc_queue *));
     229static unsigned char * som_reloc_call
     230  PARAMS ((bfd *, unsigned char *, unsigned int *, arelent *, int,
     231           struct reloc_queue *));
     232static unsigned long som_count_spaces
     233  PARAMS ((bfd *));
     234static unsigned long som_count_subspaces
     235  PARAMS ((bfd *));
     236static int compare_syms
     237  PARAMS ((const void *, const void *));
     238static int compare_subspaces
     239  PARAMS ((const void *, const void *));
     240static unsigned long som_compute_checksum
     241  PARAMS ((bfd *));
     242static bfd_boolean som_prep_headers
     243  PARAMS ((bfd *));
     244static int som_sizeof_headers
     245  PARAMS ((bfd *, bfd_boolean));
     246static bfd_boolean som_finish_writing
     247  PARAMS ((bfd *));
     248static bfd_boolean som_build_and_write_symbol_table
     249  PARAMS ((bfd *));
     250static void som_prep_for_fixups
     251  PARAMS ((bfd *, asymbol **, unsigned long));
     252static bfd_boolean som_write_fixups
     253  PARAMS ((bfd *, unsigned long, unsigned int *));
     254static bfd_boolean som_write_space_strings
     255  PARAMS ((bfd *, unsigned long, unsigned int *));
     256static bfd_boolean som_write_symbol_strings
     257  PARAMS ((bfd *, unsigned long, asymbol **, unsigned int, unsigned *,
     258           COMPUNIT *));
     259static bfd_boolean som_begin_writing
     260  PARAMS ((bfd *));
    242261static reloc_howto_type * som_bfd_reloc_type_lookup
    243         PARAMS ((bfd *, bfd_reloc_code_real_type));
    244 static char som_section_type PARAMS ((const char *));
    245 static int som_decode_symclass PARAMS ((asymbol *));
    246 static boolean som_bfd_count_ar_symbols PARAMS ((bfd *, struct lst_header *,
    247                                                  symindex *));
    248 
    249 static boolean som_bfd_fill_in_ar_symbols PARAMS ((bfd *, struct lst_header *,
    250                                                    carsym **syms));
    251 static boolean som_slurp_armap PARAMS ((bfd *));
    252 static boolean som_write_armap PARAMS ((bfd *, unsigned int, struct orl *,
    253                                         unsigned int, int));
    254 static void som_bfd_derive_misc_symbol_info PARAMS ((bfd *, asymbol *,
    255                                              struct som_misc_symbol_info *));
    256 static boolean som_bfd_prep_for_ar_write PARAMS ((bfd *, unsigned int *,
    257                                                   unsigned int *));
    258 static unsigned int som_bfd_ar_symbol_hash PARAMS ((asymbol *));
    259 static boolean som_bfd_ar_write_symbol_stuff PARAMS ((bfd *, unsigned int,
    260                                                       unsigned int,
    261                                                       struct lst_header,
    262                                                       unsigned int));
    263 static boolean som_is_space PARAMS ((asection *));
    264 static boolean som_is_subspace PARAMS ((asection *));
    265 static boolean som_is_container PARAMS ((asection *, asection *));
    266 static boolean som_bfd_free_cached_info PARAMS ((bfd *));
    267 static boolean som_bfd_link_split_section PARAMS ((bfd *, asection *));
     262  PARAMS ((bfd *, bfd_reloc_code_real_type));
     263static char som_section_type
     264  PARAMS ((const char *));
     265static int som_decode_symclass
     266  PARAMS ((asymbol *));
     267static bfd_boolean som_bfd_count_ar_symbols
     268  PARAMS ((bfd *, struct lst_header *, symindex *));
     269static bfd_boolean som_bfd_fill_in_ar_symbols
     270  PARAMS ((bfd *, struct lst_header *, carsym **));
     271static bfd_boolean som_slurp_armap
     272  PARAMS ((bfd *));
     273static bfd_boolean som_write_armap
     274  PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
     275static void som_bfd_derive_misc_symbol_info
     276  PARAMS ((bfd *, asymbol *, struct som_misc_symbol_info *));
     277static bfd_boolean som_bfd_prep_for_ar_write
     278  PARAMS ((bfd *, unsigned int *, unsigned int *));
     279static unsigned int som_bfd_ar_symbol_hash
     280  PARAMS ((asymbol *));
     281static bfd_boolean som_bfd_ar_write_symbol_stuff
     282  PARAMS ((bfd *, unsigned int, unsigned int, struct lst_header,
     283           unsigned int));
     284static bfd_boolean som_is_space
     285  PARAMS ((asection *));
     286static bfd_boolean som_is_subspace
     287  PARAMS ((asection *));
     288static bfd_boolean som_is_container
     289  PARAMS ((asection *, asection *));
     290static bfd_boolean som_bfd_free_cached_info
     291  PARAMS ((bfd *));
     292static bfd_boolean som_bfd_link_split_section
     293  PARAMS ((bfd *, asection *));
    268294
    269295/* Map SOM section names to POSIX/BSD single-character symbol types.
     
    384410static const struct fixup_format som_fixup_formats[256] = {
    385411  /* R_NO_RELOCATION */
    386   0,   "LD1+4*=",       /* 0x00 */
    387   1,   "LD1+4*=",       /* 0x01 */
    388   2,   "LD1+4*=",       /* 0x02 */
    389   3,   "LD1+4*=",       /* 0x03 */
    390   4,   "LD1+4*=",       /* 0x04 */
    391   5,   "LD1+4*=",       /* 0x05 */
    392   6,   "LD1+4*=",       /* 0x06 */
    393   7,   "LD1+4*=",       /* 0x07 */
    394   8,   "LD1+4*=",       /* 0x08 */
    395   9,   "LD1+4*=",       /* 0x09 */
    396   10,  "LD1+4*=",       /* 0x0a */
    397   11,  "LD1+4*=",       /* 0x0b */
    398   12,  "LD1+4*=",       /* 0x0c */
    399   13,  "LD1+4*=",       /* 0x0d */
    400   14,  "LD1+4*=",       /* 0x0e */
    401   15,  "LD1+4*=",       /* 0x0f */
    402   16,  "LD1+4*=",       /* 0x10 */
    403   17,  "LD1+4*=",       /* 0x11 */
    404   18,  "LD1+4*=",       /* 0x12 */
    405   19,  "LD1+4*=",       /* 0x13 */
    406   20,  "LD1+4*=",       /* 0x14 */
    407   21,  "LD1+4*=",       /* 0x15 */
    408   22,  "LD1+4*=",       /* 0x16 */
    409   23,  "LD1+4*=",       /* 0x17 */
    410   0,   "LD8<b+1+4*=",   /* 0x18 */
    411   1,   "LD8<b+1+4*=",   /* 0x19 */
    412   2,   "LD8<b+1+4*=",   /* 0x1a */
    413   3,   "LD8<b+1+4*=",   /* 0x1b */
    414   0,   "LD16<c+1+4*=",  /* 0x1c */
    415   1,   "LD16<c+1+4*=",  /* 0x1d */
    416   2,   "LD16<c+1+4*=",  /* 0x1e */
    417   0,   "Ld1+=",         /* 0x1f */
     412  {  0, "LD1+4*=" },            /* 0x00 */
     413  {  1, "LD1+4*=" },            /* 0x01 */
     414  {  2, "LD1+4*=" },            /* 0x02 */
     415  {  3, "LD1+4*=" },            /* 0x03 */
     416  {  4, "LD1+4*=" },            /* 0x04 */
     417  {  5, "LD1+4*=" },            /* 0x05 */
     418  {  6, "LD1+4*=" },            /* 0x06 */
     419  {  7, "LD1+4*=" },            /* 0x07 */
     420  {  8, "LD1+4*=" },            /* 0x08 */
     421  {  9, "LD1+4*=" },            /* 0x09 */
     422  { 10, "LD1+4*=" },            /* 0x0a */
     423  { 11, "LD1+4*=" },            /* 0x0b */
     424  { 12, "LD1+4*=" },            /* 0x0c */
     425  { 13, "LD1+4*=" },            /* 0x0d */
     426  { 14, "LD1+4*=" },            /* 0x0e */
     427  { 15, "LD1+4*=" },            /* 0x0f */
     428  { 16, "LD1+4*=" },            /* 0x10 */
     429  { 17, "LD1+4*=" },            /* 0x11 */
     430  { 18, "LD1+4*=" },            /* 0x12 */
     431  { 19, "LD1+4*=" },            /* 0x13 */
     432  { 20, "LD1+4*=" },            /* 0x14 */
     433  { 21, "LD1+4*=" },            /* 0x15 */
     434  { 22, "LD1+4*=" },            /* 0x16 */
     435  { 23, "LD1+4*=" },            /* 0x17 */
     436  {  0, "LD8<b+1+4*=" },        /* 0x18 */
     437  {  1, "LD8<b+1+4*=" },        /* 0x19 */
     438  {  2, "LD8<b+1+4*=" },        /* 0x1a */
     439  {  3, "LD8<b+1+4*=" },        /* 0x1b */
     440  {  0, "LD16<c+1+4*=" },       /* 0x1c */
     441  {  1, "LD16<c+1+4*=" },       /* 0x1d */
     442  {  2, "LD16<c+1+4*=" },       /* 0x1e */
     443  {  0, "Ld1+=" },              /* 0x1f */
    418444  /* R_ZEROES */
    419   0,    "Lb1+4*=",      /* 0x20 */
    420   1,    "Ld1+=",        /* 0x21 */
     445  {  0, "Lb1+4*=" },            /* 0x20 */
     446  {  1, "Ld1+=" },              /* 0x21 */
    421447  /* R_UNINIT */
    422   0,    "Lb1+4*=",      /* 0x22 */
    423   1,    "Ld1+=",        /* 0x23 */
     448  {  0, "Lb1+4*=" },            /* 0x22 */
     449  {  1, "Ld1+=" },              /* 0x23 */
    424450  /* R_RELOCATION */
    425   0,    "L4=",          /* 0x24 */
     451  {  0, "L4=" },                /* 0x24 */
    426452  /* R_DATA_ONE_SYMBOL */
    427   0,    "L4=Sb=",       /* 0x25 */
    428   1,    "L4=Sd=",       /* 0x26 */
     453  {  0, "L4=Sb=" },             /* 0x25 */
     454  {  1, "L4=Sd=" },             /* 0x26 */
    429455  /* R_DATA_PLEBEL */
    430   0,    "L4=Sb=",       /* 0x27 */
    431   1,    "L4=Sd=",       /* 0x28 */
     456  {  0, "L4=Sb=" },             /* 0x27 */
     457  {  1, "L4=Sd=" },             /* 0x28 */
    432458  /* R_SPACE_REF */
    433   0,    "L4=",          /* 0x29 */
     459  {  0, "L4=" },                /* 0x29 */
    434460  /* R_REPEATED_INIT */
    435   0,    "L4=Mb1+4*=",   /* 0x2a */
    436   1,    "Lb4*=Mb1+L*=", /* 0x2b */
    437   2,    "Lb4*=Md1+4*=", /* 0x2c */
    438   3,    "Ld1+=Me1+=",   /* 0x2d */
    439   0,    "",             /* 0x2e */
    440   0,    "",             /* 0x2f */
     461  {  0, "L4=Mb1+4*=" },         /* 0x2a */
     462  {  1, "Lb4*=Mb1+L*=" },       /* 0x2b */
     463  {  2, "Lb4*=Md1+4*=" },       /* 0x2c */
     464  {  3, "Ld1+=Me1+=" },         /* 0x2d */
     465  {  0, "" },                   /* 0x2e */
     466  {  0, "" },                   /* 0x2f */
    441467  /* R_PCREL_CALL */
    442   0,    "L4=RD=Sb=",    /* 0x30 */
    443   1,    "L4=RD=Sb=",    /* 0x31 */
    444   2,    "L4=RD=Sb=",    /* 0x32 */
    445   3,    "L4=RD=Sb=",    /* 0x33 */
    446   4,    "L4=RD=Sb=",    /* 0x34 */
    447   5,    "L4=RD=Sb=",    /* 0x35 */
    448   6,    "L4=RD=Sb=",    /* 0x36 */
    449   7,    "L4=RD=Sb=",    /* 0x37 */
    450   8,    "L4=RD=Sb=",    /* 0x38 */
    451   9,    "L4=RD=Sb=",    /* 0x39 */
    452   0,    "L4=RD8<b+=Sb=",/* 0x3a */
    453   1,    "L4=RD8<b+=Sb=",/* 0x3b */
    454   0,    "L4=RD8<b+=Sd=",/* 0x3c */
    455   1,    "L4=RD8<b+=Sd=",/* 0x3d */
     468  {  0, "L4=RD=Sb=" },          /* 0x30 */
     469  {  1, "L4=RD=Sb=" },          /* 0x31 */
     470  {  2, "L4=RD=Sb=" },          /* 0x32 */
     471  {  3, "L4=RD=Sb=" },          /* 0x33 */
     472  {  4, "L4=RD=Sb=" },          /* 0x34 */
     473  {  5, "L4=RD=Sb=" },          /* 0x35 */
     474  {  6, "L4=RD=Sb=" },          /* 0x36 */
     475  {  7, "L4=RD=Sb=" },          /* 0x37 */
     476  {  8, "L4=RD=Sb=" },          /* 0x38 */
     477  {  9, "L4=RD=Sb=" },          /* 0x39 */
     478  {  0, "L4=RD8<b+=Sb=" },      /* 0x3a */
     479  {  1, "L4=RD8<b+=Sb=" },      /* 0x3b */
     480  {  0, "L4=RD8<b+=Sd=" },      /* 0x3c */
     481  {  1, "L4=RD8<b+=Sd=" },      /* 0x3d */
    456482  /* R_SHORT_PCREL_MODE */
    457   0,    "",             /* 0x3e */
     483  {  0, "" },                   /* 0x3e */
    458484  /* R_LONG_PCREL_MODE */
    459   0,    "",             /* 0x3f */
     485  {  0, "" },                   /* 0x3f */
    460486  /* R_ABS_CALL */
    461   0,    "L4=RD=Sb=",    /* 0x40 */
    462   1,    "L4=RD=Sb=",    /* 0x41 */
    463   2,    "L4=RD=Sb=",    /* 0x42 */
    464   3,    "L4=RD=Sb=",    /* 0x43 */
    465   4,    "L4=RD=Sb=",    /* 0x44 */
    466   5,    "L4=RD=Sb=",    /* 0x45 */
    467   6,    "L4=RD=Sb=",    /* 0x46 */
    468   7,    "L4=RD=Sb=",    /* 0x47 */
    469   8,    "L4=RD=Sb=",    /* 0x48 */
    470   9,    "L4=RD=Sb=",    /* 0x49 */
    471   0,    "L4=RD8<b+=Sb=",/* 0x4a */
    472   1,    "L4=RD8<b+=Sb=",/* 0x4b */
    473   0,    "L4=RD8<b+=Sd=",/* 0x4c */
    474   1,    "L4=RD8<b+=Sd=",/* 0x4d */
     487  {  0, "L4=RD=Sb=" },          /* 0x40 */
     488  {  1, "L4=RD=Sb=" },          /* 0x41 */
     489  {  2, "L4=RD=Sb=" },          /* 0x42 */
     490  {  3, "L4=RD=Sb=" },          /* 0x43 */
     491  {  4, "L4=RD=Sb=" },          /* 0x44 */
     492  {  5, "L4=RD=Sb=" },          /* 0x45 */
     493  {  6, "L4=RD=Sb=" },          /* 0x46 */
     494  {  7, "L4=RD=Sb=" },          /* 0x47 */
     495  {  8, "L4=RD=Sb=" },          /* 0x48 */
     496  {  9, "L4=RD=Sb=" },          /* 0x49 */
     497  {  0, "L4=RD8<b+=Sb=" },      /* 0x4a */
     498  {  1, "L4=RD8<b+=Sb=" },      /* 0x4b */
     499  {  0, "L4=RD8<b+=Sd=" },      /* 0x4c */
     500  {  1, "L4=RD8<b+=Sd=" },      /* 0x4d */
    475501  /* R_RESERVED */
    476   0,     "",            /* 0x4e */
    477   0,     "",            /* 0x4f */
     502  {  0, "" },                   /* 0x4e */
     503  {  0, "" },                   /* 0x4f */
    478504  /* R_DP_RELATIVE */
    479   0,    "L4=SD=",       /* 0x50 */
    480   1,    "L4=SD=",       /* 0x51 */
    481   2,    "L4=SD=",       /* 0x52 */
    482   3,    "L4=SD=",       /* 0x53 */
    483   4,    "L4=SD=",       /* 0x54 */
    484   5,    "L4=SD=",       /* 0x55 */
    485   6,    "L4=SD=",       /* 0x56 */
    486   7,    "L4=SD=",       /* 0x57 */
    487   8,    "L4=SD=",       /* 0x58 */
    488   9,    "L4=SD=",       /* 0x59 */
    489   10,   "L4=SD=",       /* 0x5a */
    490   11,   "L4=SD=",       /* 0x5b */
    491   12,   "L4=SD=",       /* 0x5c */
    492   13,   "L4=SD=",       /* 0x5d */
    493   14,   "L4=SD=",       /* 0x5e */
    494   15,   "L4=SD=",       /* 0x5f */
    495   16,   "L4=SD=",       /* 0x60 */
    496   17,   "L4=SD=",       /* 0x61 */
    497   18,   "L4=SD=",       /* 0x62 */
    498   19,   "L4=SD=",       /* 0x63 */
    499   20,   "L4=SD=",       /* 0x64 */
    500   21,   "L4=SD=",       /* 0x65 */
    501   22,   "L4=SD=",       /* 0x66 */
    502   23,   "L4=SD=",       /* 0x67 */
    503   24,   "L4=SD=",       /* 0x68 */
    504   25,   "L4=SD=",       /* 0x69 */
    505   26,   "L4=SD=",       /* 0x6a */
    506   27,   "L4=SD=",       /* 0x6b */
    507   28,   "L4=SD=",       /* 0x6c */
    508   29,   "L4=SD=",       /* 0x6d */
    509   30,   "L4=SD=",       /* 0x6e */
    510   31,   "L4=SD=",       /* 0x6f */
    511   32,   "L4=Sb=",       /* 0x70 */
    512   33,   "L4=Sd=",       /* 0x71 */
     505  {  0, "L4=SD=" },             /* 0x50 */
     506  {  1, "L4=SD=" },             /* 0x51 */
     507  {  2, "L4=SD=" },             /* 0x52 */
     508  {  3, "L4=SD=" },             /* 0x53 */
     509  {  4, "L4=SD=" },             /* 0x54 */
     510  {  5, "L4=SD=" },             /* 0x55 */
     511  {  6, "L4=SD=" },             /* 0x56 */
     512  {  7, "L4=SD=" },             /* 0x57 */
     513  {  8, "L4=SD=" },             /* 0x58 */
     514  {  9, "L4=SD=" },             /* 0x59 */
     515  { 10, "L4=SD=" },             /* 0x5a */
     516  { 11, "L4=SD=" },             /* 0x5b */
     517  { 12, "L4=SD=" },             /* 0x5c */
     518  { 13, "L4=SD=" },             /* 0x5d */
     519  { 14, "L4=SD=" },             /* 0x5e */
     520  { 15, "L4=SD=" },             /* 0x5f */
     521  { 16, "L4=SD=" },             /* 0x60 */
     522  { 17, "L4=SD=" },             /* 0x61 */
     523  { 18, "L4=SD=" },             /* 0x62 */
     524  { 19, "L4=SD=" },             /* 0x63 */
     525  { 20, "L4=SD=" },             /* 0x64 */
     526  { 21, "L4=SD=" },             /* 0x65 */
     527  { 22, "L4=SD=" },             /* 0x66 */
     528  { 23, "L4=SD=" },             /* 0x67 */
     529  { 24, "L4=SD=" },             /* 0x68 */
     530  { 25, "L4=SD=" },             /* 0x69 */
     531  { 26, "L4=SD=" },             /* 0x6a */
     532  { 27, "L4=SD=" },             /* 0x6b */
     533  { 28, "L4=SD=" },             /* 0x6c */
     534  { 29, "L4=SD=" },             /* 0x6d */
     535  { 30, "L4=SD=" },             /* 0x6e */
     536  { 31, "L4=SD=" },             /* 0x6f */
     537  { 32, "L4=Sb=" },             /* 0x70 */
     538  { 33, "L4=Sd=" },             /* 0x71 */
    513539  /* R_RESERVED */
    514   0,    "",             /* 0x72 */
    515   0,    "",             /* 0x73 */
    516   0,    "",             /* 0x74 */
    517   0,    "",             /* 0x75 */
    518   0,    "",             /* 0x76 */
    519   0,    "",             /* 0x77 */
     540  {  0, "" },                   /* 0x72 */
     541  {  0, "" },                   /* 0x73 */
     542  {  0, "" },                   /* 0x74 */
     543  {  0, "" },                   /* 0x75 */
     544  {  0, "" },                   /* 0x76 */
     545  {  0, "" },                   /* 0x77 */
    520546  /* R_DLT_REL */
    521   0,    "L4=Sb=",       /* 0x78 */
    522   1,    "L4=Sd=",       /* 0x79 */
     547  {  0, "L4=Sb=" },             /* 0x78 */
     548  {  1, "L4=Sd=" },             /* 0x79 */
    523549  /* R_RESERVED */
    524   0,    "",             /* 0x7a */
    525   0,    "",             /* 0x7b */
    526   0,    "",             /* 0x7c */
    527   0,    "",             /* 0x7d */
    528   0,    "",             /* 0x7e */
    529   0,    "",             /* 0x7f */
     550  {  0, "" },                   /* 0x7a */
     551  {  0, "" },                   /* 0x7b */
     552  {  0, "" },                   /* 0x7c */
     553  {  0, "" },                   /* 0x7d */
     554  {  0, "" },                   /* 0x7e */
     555  {  0, "" },                   /* 0x7f */
    530556  /* R_CODE_ONE_SYMBOL */
    531   0,    "L4=SD=",       /* 0x80 */
    532   1,    "L4=SD=",       /* 0x81 */
    533   2,    "L4=SD=",       /* 0x82 */
    534   3,    "L4=SD=",       /* 0x83 */
    535   4,    "L4=SD=",       /* 0x84 */
    536   5,    "L4=SD=",       /* 0x85 */
    537   6,    "L4=SD=",       /* 0x86 */
    538   7,    "L4=SD=",       /* 0x87 */
    539   8,    "L4=SD=",       /* 0x88 */
    540   9,    "L4=SD=",       /* 0x89 */
    541   10,   "L4=SD=",       /* 0x8q */
    542   11,   "L4=SD=",       /* 0x8b */
    543   12,   "L4=SD=",       /* 0x8c */
    544   13,   "L4=SD=",       /* 0x8d */
    545   14,   "L4=SD=",       /* 0x8e */
    546   15,   "L4=SD=",       /* 0x8f */
    547   16,   "L4=SD=",       /* 0x90 */
    548   17,   "L4=SD=",       /* 0x91 */
    549   18,   "L4=SD=",       /* 0x92 */
    550   19,   "L4=SD=",       /* 0x93 */
    551   20,   "L4=SD=",       /* 0x94 */
    552   21,   "L4=SD=",       /* 0x95 */
    553   22,   "L4=SD=",       /* 0x96 */
    554   23,   "L4=SD=",       /* 0x97 */
    555   24,   "L4=SD=",       /* 0x98 */
    556   25,   "L4=SD=",       /* 0x99 */
    557   26,   "L4=SD=",       /* 0x9a */
    558   27,   "L4=SD=",       /* 0x9b */
    559   28,   "L4=SD=",       /* 0x9c */
    560   29,   "L4=SD=",       /* 0x9d */
    561   30,   "L4=SD=",       /* 0x9e */
    562   31,   "L4=SD=",       /* 0x9f */
    563   32,   "L4=Sb=",       /* 0xa0 */
    564   33,   "L4=Sd=",       /* 0xa1 */
     557  {  0, "L4=SD=" },             /* 0x80 */
     558  {  1, "L4=SD=" },             /* 0x81 */
     559  {  2, "L4=SD=" },             /* 0x82 */
     560  {  3, "L4=SD=" },             /* 0x83 */
     561  {  4, "L4=SD=" },             /* 0x84 */
     562  {  5, "L4=SD=" },             /* 0x85 */
     563  {  6, "L4=SD=" },             /* 0x86 */
     564  {  7, "L4=SD=" },             /* 0x87 */
     565  {  8, "L4=SD=" },             /* 0x88 */
     566  {  9, "L4=SD=" },             /* 0x89 */
     567  { 10, "L4=SD=" },             /* 0x8q */
     568  { 11, "L4=SD=" },             /* 0x8b */
     569  { 12, "L4=SD=" },             /* 0x8c */
     570  { 13, "L4=SD=" },             /* 0x8d */
     571  { 14, "L4=SD=" },             /* 0x8e */
     572  { 15, "L4=SD=" },             /* 0x8f */
     573  { 16, "L4=SD=" },             /* 0x90 */
     574  { 17, "L4=SD=" },             /* 0x91 */
     575  { 18, "L4=SD=" },             /* 0x92 */
     576  { 19, "L4=SD=" },             /* 0x93 */
     577  { 20, "L4=SD=" },             /* 0x94 */
     578  { 21, "L4=SD=" },             /* 0x95 */
     579  { 22, "L4=SD=" },             /* 0x96 */
     580  { 23, "L4=SD=" },             /* 0x97 */
     581  { 24, "L4=SD=" },             /* 0x98 */
     582  { 25, "L4=SD=" },             /* 0x99 */
     583  { 26, "L4=SD=" },             /* 0x9a */
     584  { 27, "L4=SD=" },             /* 0x9b */
     585  { 28, "L4=SD=" },             /* 0x9c */
     586  { 29, "L4=SD=" },             /* 0x9d */
     587  { 30, "L4=SD=" },             /* 0x9e */
     588  { 31, "L4=SD=" },             /* 0x9f */
     589  { 32, "L4=Sb=" },             /* 0xa0 */
     590  { 33, "L4=Sd=" },             /* 0xa1 */
    565591  /* R_RESERVED */
    566   0,    "",             /* 0xa2 */
    567   0,    "",             /* 0xa3 */
    568   0,    "",             /* 0xa4 */
    569   0,    "",             /* 0xa5 */
    570   0,    "",             /* 0xa6 */
    571   0,    "",             /* 0xa7 */
    572   0,    "",             /* 0xa8 */
    573   0,    "",             /* 0xa9 */
    574   0,    "",             /* 0xaa */
    575   0,    "",             /* 0xab */
    576   0,    "",             /* 0xac */
    577   0,    "",             /* 0xad */
     592  {  0, "" },                   /* 0xa2 */
     593  {  0, "" },                   /* 0xa3 */
     594  {  0, "" },                   /* 0xa4 */
     595  {  0, "" },                   /* 0xa5 */
     596  {  0, "" },                   /* 0xa6 */
     597  {  0, "" },                   /* 0xa7 */
     598  {  0, "" },                   /* 0xa8 */
     599  {  0, "" },                   /* 0xa9 */
     600  {  0, "" },                   /* 0xaa */
     601  {  0, "" },                   /* 0xab */
     602  {  0, "" },                   /* 0xac */
     603  {  0, "" },                   /* 0xad */
    578604  /* R_MILLI_REL */
    579   0,    "L4=Sb=",       /* 0xae */
    580   1,    "L4=Sd=",       /* 0xaf */
     605  {  0, "L4=Sb=" },             /* 0xae */
     606  {  1, "L4=Sd=" },             /* 0xaf */
    581607  /* R_CODE_PLABEL */
    582   0,    "L4=Sb=",       /* 0xb0 */
    583   1,    "L4=Sd=",       /* 0xb1 */
     608  {  0, "L4=Sb=" },             /* 0xb0 */
     609  {  1, "L4=Sd=" },             /* 0xb1 */
    584610  /* R_BREAKPOINT */
    585   0,    "L4=",          /* 0xb2 */
     611  {  0, "L4=" },                /* 0xb2 */
    586612  /* R_ENTRY */
    587   0,    "Te=Ue=",       /* 0xb3 */
    588   1,    "Uf=",          /* 0xb4 */
     613  {  0, "Te=Ue=" },             /* 0xb3 */
     614  {  1, "Uf=" },                /* 0xb4 */
    589615  /* R_ALT_ENTRY */
    590   0,    "",             /* 0xb5 */
     616  {  0, "" },                   /* 0xb5 */
    591617  /* R_EXIT */
    592   0,    "",             /* 0xb6 */
     618  {  0, "" },                   /* 0xb6 */
    593619  /* R_BEGIN_TRY */
    594   0,    "",             /* 0xb7 */
     620  {  0, "" },                   /* 0xb7 */
    595621  /* R_END_TRY */
    596   0,    "R0=",          /* 0xb8 */
    597   1,    "Rb4*=",        /* 0xb9 */
    598   2,    "Rd4*=",        /* 0xba */
     622  {  0, "R0=" },                /* 0xb8 */
     623  {  1, "Rb4*=" },              /* 0xb9 */
     624  {  2, "Rd4*=" },              /* 0xba */
    599625  /* R_BEGIN_BRTAB */
    600   0,    "",             /* 0xbb */
     626  {  0, "" },                   /* 0xbb */
    601627  /* R_END_BRTAB */
    602   0,    "",             /* 0xbc */
     628  {  0, "" },                   /* 0xbc */
    603629  /* R_STATEMENT */
    604   0,    "Nb=",          /* 0xbd */
    605   1,    "Nc=",          /* 0xbe */
    606   2,    "Nd=",          /* 0xbf */
     630  {  0, "Nb=" },                /* 0xbd */
     631  {  1, "Nc=" },                /* 0xbe */
     632  {  2, "Nd=" },                /* 0xbf */
    607633  /* R_DATA_EXPR */
    608   0,    "L4=",          /* 0xc0 */
     634  {  0, "L4=" },                /* 0xc0 */
    609635  /* R_CODE_EXPR */
    610   0,    "L4=",          /* 0xc1 */
     636  {  0, "L4=" },                /* 0xc1 */
    611637  /* R_FSEL */
    612   0,    "",             /* 0xc2 */
     638  {  0, "" },                   /* 0xc2 */
    613639  /* R_LSEL */
    614   0,    "",             /* 0xc3 */
     640  {  0, "" },                   /* 0xc3 */
    615641  /* R_RSEL */
    616   0,    "",             /* 0xc4 */
     642  {  0, "" },                   /* 0xc4 */
    617643  /* R_N_MODE */
    618   0,    "",             /* 0xc5 */
     644  {  0, "" },                   /* 0xc5 */
    619645  /* R_S_MODE */
    620   0,    "",             /* 0xc6 */
     646  {  0, "" },                   /* 0xc6 */
    621647  /* R_D_MODE */
    622   0,    "",             /* 0xc7 */
     648  {  0, "" },                   /* 0xc7 */
    623649  /* R_R_MODE */
    624   0,    "",             /* 0xc8 */
     650  {  0, "" },                   /* 0xc8 */
    625651  /* R_DATA_OVERRIDE */
    626   0,    "V0=",          /* 0xc9 */
    627   1,    "Vb=",          /* 0xca */
    628   2,    "Vc=",          /* 0xcb */
    629   3,    "Vd=",          /* 0xcc */
    630   4,    "Ve=",          /* 0xcd */
     652  {  0, "V0=" },                /* 0xc9 */
     653  {  1, "Vb=" },                /* 0xca */
     654  {  2, "Vc=" },                /* 0xcb */
     655  {  3, "Vd=" },                /* 0xcc */
     656  {  4, "Ve=" },                /* 0xcd */
    631657  /* R_TRANSLATED */
    632   0,    "",             /* 0xce */
     658  {  0, "" },                   /* 0xce */
    633659  /* R_AUX_UNWIND */
    634   0,    "Sd=Vf=Ef=",    /* 0xcf */
     660  {  0,"Sd=Ve=Ee=" },          /* 0xcf */
    635661  /* R_COMP1 */
    636   0,    "Ob=",          /* 0xd0 */
     662  {  0, "Ob=" },                /* 0xd0 */
    637663  /* R_COMP2 */
    638   0,    "Ob=Sd=",       /* 0xd1 */
     664  {  0, "Ob=Sd=" },             /* 0xd1 */
    639665  /* R_COMP3 */
    640   0,    "Ob=Ve=",       /* 0xd2 */
     666  {  0, "Ob=Ve=" },             /* 0xd2 */
    641667  /* R_PREV_FIXUP */
    642   0,    "P",            /* 0xd3 */
    643   1,    "P",            /* 0xd4 */
    644   2,    "P",            /* 0xd5 */
    645   3,    "P",            /* 0xd6 */
     668  {  0, "P" },                  /* 0xd3 */
     669  {  1, "P" },                  /* 0xd4 */
     670  {  2, "P" },                  /* 0xd5 */
     671  {  3, "P" },                  /* 0xd6 */
    646672  /* R_SEC_STMT */
    647   0,    "",             /* 0xd7 */
     673  {  0, "" },                   /* 0xd7 */
    648674  /* R_N0SEL */
    649   0,    "",             /* 0xd8 */
     675  {  0, "" },                   /* 0xd8 */
    650676  /* R_N1SEL */
    651   0,    "",             /* 0xd9 */
     677  {  0, "" },                   /* 0xd9 */
    652678  /* R_LINETAB */
    653   0,    "Eb=Sd=Ve=",    /* 0xda */
     679  {  0, "Eb=Sd=Ve=" },          /* 0xda */
    654680  /* R_LINETAB_ESC */
    655   0,    "Eb=Mb=",       /* 0xdb */
     681  {  0, "Eb=Mb=" },             /* 0xdb */
    656682  /* R_LTP_OVERRIDE */
    657   0,    "",             /* 0xdc */
     683  {  0, "" },                   /* 0xdc */
    658684  /* R_COMMENT */
    659   0,    "Ob=Ve=",       /* 0xdd */
     685  {  0, "Ob=Vf=" },             /* 0xdd */
    660686  /* R_RESERVED */
    661   0,    "",             /* 0xde */
    662   0,    "",             /* 0xdf */
    663   0,    "",             /* 0xe0 */
    664   0,    "",             /* 0xe1 */
    665   0,    "",             /* 0xe2 */
    666   0,    "",             /* 0xe3 */
    667   0,    "",             /* 0xe4 */
    668   0,    "",             /* 0xe5 */
    669   0,    "",             /* 0xe6 */
    670   0,    "",             /* 0xe7 */
    671   0,    "",             /* 0xe8 */
    672   0,    "",             /* 0xe9 */
    673   0,    "",             /* 0xea */
    674   0,    "",             /* 0xeb */
    675   0,    "",             /* 0xec */
    676   0,    "",             /* 0xed */
    677   0,    "",             /* 0xee */
    678   0,    "",             /* 0xef */
    679   0,    "",             /* 0xf0 */
    680   0,    "",             /* 0xf1 */
    681   0,    "",             /* 0xf2 */
    682   0,    "",             /* 0xf3 */
    683   0,    "",             /* 0xf4 */
    684   0,    "",             /* 0xf5 */
    685   0,    "",             /* 0xf6 */
    686   0,    "",             /* 0xf7 */
    687   0,    "",             /* 0xf8 */
    688   0,    "",             /* 0xf9 */
    689   0,    "",             /* 0xfa */
    690   0,    "",             /* 0xfb */
    691   0,    "",             /* 0xfc */
    692   0,    "",             /* 0xfd */
    693   0,    "",             /* 0xfe */
    694   0,    "",             /* 0xff */
     687  {  0, "" },                   /* 0xde */
     688  {  0, "" },                   /* 0xdf */
     689  {  0, "" },                   /* 0xe0 */
     690  {  0, "" },                   /* 0xe1 */
     691  {  0, "" },                   /* 0xe2 */
     692  {  0, "" },                   /* 0xe3 */
     693  {  0, "" },                   /* 0xe4 */
     694  {  0, "" },                   /* 0xe5 */
     695  {  0, "" },                   /* 0xe6 */
     696  {  0, "" },                   /* 0xe7 */
     697  {  0, "" },                   /* 0xe8 */
     698  {  0, "" },                   /* 0xe9 */
     699  {  0, "" },                   /* 0xea */
     700  {  0, "" },                   /* 0xeb */
     701  {  0, "" },                   /* 0xec */
     702  {  0, "" },                   /* 0xed */
     703  {  0, "" },                   /* 0xee */
     704  {  0, "" },                   /* 0xef */
     705  {  0, "" },                   /* 0xf0 */
     706  {  0, "" },                   /* 0xf1 */
     707  {  0, "" },                   /* 0xf2 */
     708  {  0, "" },                   /* 0xf3 */
     709  {  0, "" },                   /* 0xf4 */
     710  {  0, "" },                   /* 0xf5 */
     711  {  0, "" },                   /* 0xf6 */
     712  {  0, "" },                   /* 0xf7 */
     713  {  0, "" },                   /* 0xf8 */
     714  {  0, "" },                   /* 0xf9 */
     715  {  0, "" },                   /* 0xfa */
     716  {  0, "" },                   /* 0xfb */
     717  {  0, "" },                   /* 0xfc */
     718  {  0, "" },                   /* 0xfd */
     719  {  0, "" },                   /* 0xfe */
     720  {  0, "" },                   /* 0xff */
    695721};
    696722
     
    778804
    779805#define SOM_HOWTO(TYPE, NAME)   \
    780   HOWTO(TYPE, 0, 0, 32, false, 0, 0, hppa_som_reloc, NAME, false, 0, 0, false)
     806  HOWTO(TYPE, 0, 0, 32, FALSE, 0, 0, hppa_som_reloc, NAME, FALSE, 0, 0, FALSE)
    781807
    782808static reloc_howto_type som_hppa_howto_table[] = {
     
    11991225      bfd_put_8 (abfd, R_NO_RELOCATION + 31, p);
    12001226      bfd_put_8 (abfd, 0xff, p + 1);
    1201       bfd_put_16 (abfd, 0xffff, p + 2);
     1227      bfd_put_16 (abfd, (bfd_vma) 0xffff, p + 2);
    12021228      p = try_prev_fixup (abfd, subspace_reloc_sizep, p, 4, queue);
    12031229      while (skip >= 0x1000000)
     
    12351261        {
    12361262          bfd_put_8 (abfd, R_NO_RELOCATION + 28 + (((skip >> 2) - 1) >> 16), p);
    1237           bfd_put_16 (abfd, (skip >> 2) - 1, p + 1);
     1263          bfd_put_16 (abfd, (bfd_vma) (skip >> 2) - 1, p + 1);
    12381264          p = try_prev_fixup (abfd, subspace_reloc_sizep, p, 3, queue);
    12391265        }
     
    12441270      bfd_put_8 (abfd, R_NO_RELOCATION + 31, p);
    12451271      bfd_put_8 (abfd, (skip - 1) >> 16, p + 1);
    1246       bfd_put_16 (abfd, skip - 1, p + 2);
     1272      bfd_put_16 (abfd, (bfd_vma) skip - 1, p + 2);
    12471273      p = try_prev_fixup (abfd, subspace_reloc_sizep, p, 4, queue);
    12481274    }
     
    12581284som_reloc_addend (abfd, addend, p, subspace_reloc_sizep, queue)
    12591285     bfd *abfd;
    1260      int addend;
     1286     bfd_vma addend;
    12611287     unsigned char *p;
    12621288     unsigned int *subspace_reloc_sizep;
    12631289     struct reloc_queue *queue;
    12641290{
    1265   if ((unsigned) (addend) + 0x80 < 0x100)
     1291  if (addend + 0x80 < 0x100)
    12661292    {
    12671293      bfd_put_8 (abfd, R_DATA_OVERRIDE + 1, p);
     
    12691295      p = try_prev_fixup (abfd, subspace_reloc_sizep, p, 2, queue);
    12701296    }
    1271   else if ((unsigned) (addend) + 0x8000 < 0x10000)
     1297  else if (addend + 0x8000 < 0x10000)
    12721298    {
    12731299      bfd_put_8 (abfd, R_DATA_OVERRIDE + 2, p);
     
    12751301      p = try_prev_fixup (abfd, subspace_reloc_sizep, p, 3, queue);
    12761302    }
    1277   else if ((unsigned) (addend) + 0x800000 < 0x1000000)
     1303  else if (addend + 0x800000 < 0x1000000)
    12781304    {
    12791305      bfd_put_8 (abfd, R_DATA_OVERRIDE + 3, p);
     
    13961422        {
    13971423          bfd_put_8 (abfd, sym_num >> 16, p + 2);
    1398           bfd_put_16 (abfd, sym_num, p + 3);
     1424          bfd_put_16 (abfd, (bfd_vma) sym_num, p + 3);
    13991425          p = try_prev_fixup (abfd, subspace_reloc_sizep, p, 5, queue);
    14001426        }
     
    14541480  int *final_type, **final_types;
    14551481
    1456   final_types = (int **) bfd_alloc (abfd, sizeof (int *) * 6);
    1457   final_type = (int *) bfd_alloc (abfd, sizeof (int));
     1482  final_types = (int **) bfd_alloc (abfd, (bfd_size_type) sizeof (int *) * 6);
     1483  final_type = (int *) bfd_alloc (abfd, (bfd_size_type) sizeof (int));
    14581484  if (!final_types || !final_type)
    14591485    return NULL;
     
    14791505    case e_ltsel:
    14801506    case e_rtsel:
    1481       final_types[0] = (int *) bfd_alloc (abfd, sizeof (int));
     1507      final_types[0] = (int *) bfd_alloc (abfd, (bfd_size_type) sizeof (int));
    14821508      if (!final_types[0])
    14831509        return NULL;
     
    14951521    case e_lssel:
    14961522    case e_rssel:
    1497       final_types[0] = (int *) bfd_alloc (abfd, sizeof (int));
     1523      final_types[0] = (int *) bfd_alloc (abfd, (bfd_size_type) sizeof (int));
    14981524      if (!final_types[0])
    14991525        return NULL;
     
    15061532    case e_lsel:
    15071533    case e_rsel:
    1508       final_types[0] = (int *) bfd_alloc (abfd, sizeof (int));
     1534      final_types[0] = (int *) bfd_alloc (abfd, (bfd_size_type) sizeof (int));
    15091535      if (!final_types[0])
    15101536        return NULL;
     
    15171543    case e_ldsel:
    15181544    case e_rdsel:
    1519       final_types[0] = (int *) bfd_alloc (abfd, sizeof (int));
     1545      final_types[0] = (int *) bfd_alloc (abfd, (bfd_size_type) sizeof (int));
    15201546      if (!final_types[0])
    15211547        return NULL;
     
    15281554    case e_lrsel:
    15291555    case e_rrsel:
    1530       final_types[0] = (int *) bfd_alloc (abfd, sizeof (int));
     1556      final_types[0] = (int *) bfd_alloc (abfd, (bfd_size_type) sizeof (int));
    15311557      if (!final_types[0])
    15321558        return NULL;
     
    15381564
    15391565    case e_nsel:
    1540       final_types[0] = (int *) bfd_alloc (abfd, sizeof (int));
     1566      final_types[0] = (int *) bfd_alloc (abfd, (bfd_size_type) sizeof (int));
    15411567      if (!final_types[0])
    15421568        return NULL;
     
    15491575    case e_nlsel:
    15501576    case e_nlrsel:
    1551       final_types[0] = (int *) bfd_alloc (abfd, sizeof (int));
     1577      final_types[0] = (int *) bfd_alloc (abfd, (bfd_size_type) sizeof (int));
    15521578      if (!final_types[0])
    15531579        return NULL;
    15541580      *final_types[0] = R_N0SEL;
    1555       final_types[1] = (int *) bfd_alloc (abfd, sizeof (int));
     1581      final_types[1] = (int *) bfd_alloc (abfd, (bfd_size_type) sizeof (int));
    15561582      if (!final_types[1])
    15571583        return NULL;
     
    15721598      if (sym_diff)
    15731599        {
    1574           final_types[0] = (int *) bfd_alloc (abfd, sizeof (int));
    1575           final_types[1] = (int *) bfd_alloc (abfd, sizeof (int));
    1576           final_types[2] = (int *) bfd_alloc (abfd, sizeof (int));
    1577           final_types[3] = (int *) bfd_alloc (abfd, sizeof (int));
     1600          bfd_size_type amt = sizeof (int);
     1601          final_types[0] = (int *) bfd_alloc (abfd, amt);
     1602          final_types[1] = (int *) bfd_alloc (abfd, amt);
     1603          final_types[2] = (int *) bfd_alloc (abfd, amt);
     1604          final_types[3] = (int *) bfd_alloc (abfd, amt);
    15781605          if (!final_types[0] || !final_types[1] || !final_types[2])
    15791606            return NULL;
     
    16521679      if (sym_diff)
    16531680        {
    1654           final_types[0] = (int *) bfd_alloc (abfd, sizeof (int));
    1655           final_types[1] = (int *) bfd_alloc (abfd, sizeof (int));
    1656           final_types[2] = (int *) bfd_alloc (abfd, sizeof (int));
    1657           final_types[3] = (int *) bfd_alloc (abfd, sizeof (int));
     1681          bfd_size_type amt = sizeof (int);
     1682          final_types[0] = (int *) bfd_alloc (abfd, amt);
     1683          final_types[1] = (int *) bfd_alloc (abfd, amt);
     1684          final_types[2] = (int *) bfd_alloc (abfd, amt);
     1685          final_types[3] = (int *) bfd_alloc (abfd, amt);
    16581686          if (!final_types[0] || !final_types[1] || !final_types[2])
    16591687            return NULL;
     
    16891717           mode selector, then the pcrel relocation.  Redundant selectors
    16901718           will be eliminted as the relocs are sized and emitted.  */
    1691         final_types[0] = (int *) bfd_alloc (abfd, sizeof (int));
     1719        bfd_size_type amt = sizeof (int);
     1720        final_types[0] = (int *) bfd_alloc (abfd, amt);
    16921721        if (!final_types[0])
    16931722          return NULL;
     
    17371766
    17381767  /* som_mkobject will set bfd_error if som_mkobject fails.  */
    1739   if (som_mkobject (abfd) != true)
     1768  if (! som_mkobject (abfd))
    17401769    return 0;
    17411770
     
    17741803  /* Allocate space to hold the saved exec header information.  */
    17751804  obj_som_exec_data (abfd) = (struct som_exec_data *)
    1776     bfd_zalloc (abfd, sizeof (struct som_exec_data));
     1805    bfd_zalloc (abfd, (bfd_size_type) sizeof (struct som_exec_data));
    17771806  if (obj_som_exec_data (abfd) == NULL)
    17781807    return NULL;
     
    18101839      obj_som_exec_data (abfd)->exec_flags = aux_hdrp->exec_flags;
    18111840    }
     1841
     1842  obj_som_exec_data (abfd)->version_id = file_hdrp->version_id;
    18121843
    18131844  bfd_default_set_arch_mach (abfd, bfd_arch_hppa, pa10);
     
    18371868   associated subspaces.  */
    18381869
    1839 static boolean
     1870static bfd_boolean
    18401871setup_sections (abfd, file_hdr, current_offset)
    18411872     bfd *abfd;
     
    18461877  unsigned int space_index, i;
    18471878  unsigned int total_subspaces = 0;
    1848   asection **subspace_sections, *section;
     1879  asection **subspace_sections = NULL;
     1880  asection *section;
     1881  bfd_size_type amt;
    18491882
    18501883  /* First, read in space names.  */
    18511884
    1852   space_strings = bfd_malloc (file_hdr->space_strings_size);
    1853   if (!space_strings && file_hdr->space_strings_size != 0)
     1885  amt = file_hdr->space_strings_size;
     1886  space_strings = bfd_malloc (amt);
     1887  if (!space_strings && amt != 0)
    18541888    goto error_return;
    18551889
    18561890  if (bfd_seek (abfd, current_offset + file_hdr->space_strings_location,
    1857                 SEEK_SET) < 0)
     1891                SEEK_SET) != 0)
    18581892    goto error_return;
    1859   if (bfd_read (space_strings, 1, file_hdr->space_strings_size, abfd)
    1860       != file_hdr->space_strings_size)
     1893  if (bfd_bread (space_strings, amt, abfd) != amt)
    18611894    goto error_return;
    18621895
     
    18741907                    (current_offset + file_hdr->space_location
    18751908                     + space_index * sizeof space),
    1876                     SEEK_SET) < 0)
     1909                    SEEK_SET) != 0)
    18771910        goto error_return;
    1878       if (bfd_read (&space, 1, sizeof space, abfd) != sizeof space)
     1911      amt = sizeof space;
     1912      if (bfd_bread (&space, amt, abfd) != amt)
    18791913        goto error_return;
    18801914
     
    18831917
    18841918      /* Make a section out of it.  */
    1885       newname = bfd_alloc (abfd, strlen (space.name.n_name) + 1);
     1919      amt = strlen (space.name.n_name) + 1;
     1920      newname = bfd_alloc (abfd, amt);
    18861921      if (!newname)
    18871922        goto error_return;
     
    18961931
    18971932      /* Set up all the attributes for the space.  */
    1898       if (bfd_som_set_section_attributes (space_asect, space.is_defined,
    1899                                           space.is_private, space.sort_key,
    1900                                           space.space_number) == false)
     1933      if (! bfd_som_set_section_attributes (space_asect, space.is_defined,
     1934                                            space.is_private, space.sort_key,
     1935                                            space.space_number))
    19011936        goto error_return;
    19021937
     
    19091944                    (current_offset + file_hdr->subspace_location
    19101945                     + space.subspace_index * sizeof subspace),
    1911                     SEEK_SET) < 0)
     1946                    SEEK_SET) != 0)
    19121947        goto error_return;
    1913       if (bfd_read (&subspace, 1, sizeof subspace, abfd) != sizeof subspace)
     1948      amt = sizeof subspace;
     1949      if (bfd_bread (&subspace, amt, abfd) != amt)
    19141950        goto error_return;
    19151951      /* Seek back to the start of the subspaces for loop below.  */
     
    19171953                    (current_offset + file_hdr->subspace_location
    19181954                     + space.subspace_index * sizeof subspace),
    1919                     SEEK_SET) < 0)
     1955                    SEEK_SET) != 0)
    19201956        goto error_return;
    19211957
    19221958      /* Setup the start address and file loc from the first subspace
    1923         record.  */
     1959        record.  */
    19241960      space_asect->vma = subspace.subspace_start;
    19251961      space_asect->filepos = subspace.file_loc_init_value + current_offset;
    19261962      space_asect->alignment_power = log2 (subspace.alignment);
    1927       if (space_asect->alignment_power == -1)
     1963      if (space_asect->alignment_power == (unsigned) -1)
    19281964        goto error_return;
    19291965
     
    19391975
    19401976          /* Read in the next subspace.  */
    1941           if (bfd_read (&subspace, 1, sizeof subspace, abfd)
    1942               != sizeof subspace)
     1977          amt = sizeof subspace;
     1978          if (bfd_bread (&subspace, amt, abfd) != amt)
    19431979            goto error_return;
    19441980
     
    19461982          subspace.name.n_name = subspace.name.n_strx + space_strings;
    19471983
    1948           newname = bfd_alloc (abfd, strlen (subspace.name.n_name) + 1);
     1984          amt = strlen (subspace.name.n_name) + 1;
     1985          newname = bfd_alloc (abfd, amt);
    19491986          if (!newname)
    19501987            goto error_return;
     
    19571994
    19581995          /* Store private information about the section.  */
    1959           if (bfd_som_set_subsection_attributes (subspace_asect, space_asect,
    1960                                                  subspace.access_control_bits,
    1961                                                  subspace.sort_key,
    1962                                                  subspace.quadrant) == false)
     1996          if (! bfd_som_set_subsection_attributes (subspace_asect, space_asect,
     1997                                                   subspace.access_control_bits,
     1998                                                   subspace.sort_key,
     1999                                                   subspace.quadrant))
    19632000            goto error_return;
    19642001
     
    20372074              /* We can not determine this yet.  When we read in the
    20382075                 relocation table the correct value will be filled in.  */
    2039               subspace_asect->reloc_count = -1;
     2076              subspace_asect->reloc_count = (unsigned) -1;
    20402077            }
    20412078
     
    20502087                                     + current_offset);
    20512088          subspace_asect->alignment_power = log2 (subspace.alignment);
    2052           if (subspace_asect->alignment_power == -1)
     2089          if (subspace_asect->alignment_power == (unsigned) -1)
    20532090            goto error_return;
    20542091        }
    20552092
    20562093      /* This can happen for a .o which defines symbols in otherwise
    2057         empty subspaces.  */
     2094        empty subspaces.  */
    20582095      if (!save_subspace.file_loc_init_value)
    20592096        {
     
    20752112  /* Now that we've read in all the subspace records, we need to assign
    20762113     a target index to each subspace.  */
    2077   subspace_sections = (asection **) bfd_malloc (total_subspaces
    2078                                                 * sizeof (asection *));
     2114  amt = total_subspaces;
     2115  amt *= sizeof (asection *);
     2116  subspace_sections = (asection **) bfd_malloc (amt);
    20792117  if (subspace_sections == NULL)
    20802118    goto error_return;
     
    21022140    free (subspace_sections);
    21032141
    2104   return true;
     2142  return TRUE;
    21052143
    21062144 error_return:
     
    21102148  if (subspace_sections != NULL)
    21112149    free (subspace_sections);
    2112   return false;
     2150  return FALSE;
    21132151}
    21142152
     
    21242162  struct lst_header lst_header;
    21252163  struct som_entry som_entry;
     2164  bfd_size_type amt;
    21262165#define ENTRY_SIZE sizeof (struct som_entry)
    21272166
    2128   if (bfd_read ((PTR) & file_hdr, 1, FILE_HDR_SIZE, abfd) != FILE_HDR_SIZE)
     2167  amt = FILE_HDR_SIZE;
     2168  if (bfd_bread ((PTR) &file_hdr, amt, abfd) != amt)
    21292169    {
    21302170      if (bfd_get_error () != bfd_error_system_call)
     
    21602200      /* Read the lst header and determine where the SOM directory begins.  */
    21612201
    2162       if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) < 0)
     2202      if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
    21632203        {
    21642204          if (bfd_get_error () != bfd_error_system_call)
     
    21672207        }
    21682208
    2169       if (bfd_read ((PTR) & lst_header, 1, SLSTHDR, abfd) != SLSTHDR)
     2209      amt = SLSTHDR;
     2210      if (bfd_bread ((PTR) &lst_header, amt, abfd) != amt)
    21702211        {
    21712212          if (bfd_get_error () != bfd_error_system_call)
     
    21762217      /* Position to and read the first directory entry.  */
    21772218
    2178       if (bfd_seek (abfd, lst_header.dir_loc, SEEK_SET) < 0)
     2219      if (bfd_seek (abfd, lst_header.dir_loc, SEEK_SET) != 0)
    21792220        {
    21802221          if (bfd_get_error () != bfd_error_system_call)
     
    21832224        }
    21842225
    2185       if (bfd_read ((PTR) & som_entry, 1, ENTRY_SIZE, abfd) != ENTRY_SIZE)
     2226      amt = ENTRY_SIZE;
     2227      if (bfd_bread ((PTR) &som_entry, amt, abfd) != amt)
    21862228        {
    21872229          if (bfd_get_error () != bfd_error_system_call)
     
    21922234      /* Now position to the first SOM.  */
    21932235
    2194       if (bfd_seek (abfd, som_entry.location, SEEK_SET) < 0)
     2236      if (bfd_seek (abfd, som_entry.location, SEEK_SET) != 0)
    21952237        {
    21962238          if (bfd_get_error () != bfd_error_system_call)
     
    22022244
    22032245      /* And finally, re-read the som header.  */
    2204 
    2205       if (bfd_read ((PTR) & file_hdr, 1, FILE_HDR_SIZE, abfd) != FILE_HDR_SIZE)
     2246      amt = FILE_HDR_SIZE;
     2247      if (bfd_bread ((PTR) &file_hdr, amt, abfd) != amt)
    22062248        {
    22072249          if (bfd_get_error () != bfd_error_system_call)
     
    22312273  if (file_hdr.aux_header_size != 0)
    22322274    {
    2233       if (bfd_read ((PTR) & aux_hdr, 1, AUX_HDR_SIZE, abfd) != AUX_HDR_SIZE)
     2275      amt = AUX_HDR_SIZE;
     2276      if (bfd_bread ((PTR) &aux_hdr, amt, abfd) != amt)
    22342277        {
    22352278          if (bfd_get_error () != bfd_error_system_call)
     
    22522295/* Create a SOM object.  */
    22532296
    2254 static boolean
     2297static bfd_boolean
    22552298som_mkobject (abfd)
    22562299     bfd *abfd;
     
    22582301  /* Allocate memory to hold backend information.  */
    22592302  abfd->tdata.som_data = (struct som_data_struct *)
    2260     bfd_zalloc (abfd, sizeof (struct som_data_struct));
     2303    bfd_zalloc (abfd, (bfd_size_type) sizeof (struct som_data_struct));
    22612304  if (abfd->tdata.som_data == NULL)
    2262     return false;
    2263   return true;
     2305    return FALSE;
     2306  return TRUE;
    22642307}
    22652308
     
    22682311   is only meant to handle relocatable objects.  */
    22692312
    2270 static boolean
     2313static bfd_boolean
    22712314som_prep_headers (abfd)
    22722315     bfd *abfd;
     
    22742317  struct header *file_hdr;
    22752318  asection *section;
     2319  bfd_size_type amt = sizeof (struct header);
    22762320
    22772321  /* Make and attach a file header to the BFD.  */
    2278   file_hdr = (struct header *) bfd_zalloc (abfd, sizeof (struct header));
     2322  file_hdr = (struct header *) bfd_zalloc (abfd, amt);
    22792323  if (file_hdr == NULL)
    2280     return false;
     2324    return FALSE;
    22812325  obj_som_file_hdr (abfd) = file_hdr;
    22822326
    22832327  if (abfd->flags & (EXEC_P | DYNAMIC))
    22842328    {
    2285 
    22862329      /* Make and attach an exec header to the BFD.  */
    2287       obj_som_exec_hdr (abfd) = (struct som_exec_auxhdr *)
    2288         bfd_zalloc (abfd, sizeof (struct som_exec_auxhdr));
     2330      amt = sizeof (struct som_exec_auxhdr);
     2331      obj_som_exec_hdr (abfd) =
     2332        (struct som_exec_auxhdr *) bfd_zalloc (abfd, amt);
    22892333      if (obj_som_exec_hdr (abfd) == NULL)
    2290         return false;
     2334        return FALSE;
    22912335
    22922336      if (abfd->flags & D_PAGED)
     
    23042348    file_hdr->a_magic = RELOC_MAGIC;
    23052349
    2306   /* Only new format SOM is supported.  */
    2307   file_hdr->version_id = NEW_VERSION_ID;
    2308 
    23092350  /* These fields are optional, and embedding timestamps is not always
    23102351     a wise thing to do, it makes comparing objects during a multi-stage
     
    23312372        {
    23322373          /* Allocate space for the space dictionary.  */
     2374          amt = sizeof (struct space_dictionary_record);
    23332375          som_section_data (section)->space_dict =
    2334             (struct space_dictionary_record *)
    2335             bfd_zalloc (abfd, sizeof (struct space_dictionary_record));
     2376            (struct space_dictionary_record *) bfd_zalloc (abfd, amt);
    23362377          if (som_section_data (section)->space_dict == NULL)
    2337             return false;
     2378            return FALSE;
    23382379          /* Set space attributes.  Note most attributes of SOM spaces
    23392380             are set based on the subspaces it contains.  */
     
    23542395        {
    23552396          /* Allocate space for the subspace dictionary.  */
    2356           som_section_data (section)->subspace_dict
    2357             = (struct subspace_dictionary_record *)
    2358               bfd_zalloc (abfd, sizeof (struct subspace_dictionary_record));
     2397          amt = sizeof (struct subspace_dictionary_record);
     2398          som_section_data (section)->subspace_dict =
     2399            (struct subspace_dictionary_record *) bfd_zalloc (abfd, amt);
    23592400          if (som_section_data (section)->subspace_dict == NULL)
    2360             return false;
     2401            return FALSE;
    23612402
    23622403          /* Set subspace attributes.  Basic stuff is done here, additional
     
    23932434        }
    23942435    }
    2395   return true;
    2396 }
    2397 
    2398 /* Return true if the given section is a SOM space, false otherwise.  */
    2399 
    2400 static boolean
     2436  return TRUE;
     2437}
     2438
     2439/* Return TRUE if the given section is a SOM space, FALSE otherwise.  */
     2440
     2441static bfd_boolean
    24012442som_is_space (section)
    24022443     asection *section;
     
    24052446     subspace.  */
    24062447  if (som_section_data (section)->copy_data == NULL)
    2407     return false;
     2448    return FALSE;
    24082449
    24092450  /* If the containing space isn't the same as the given section,
     
    24122453      && (som_section_data (section)->copy_data->container->output_section
    24132454          != section))
    2414     return false;
     2455    return FALSE;
    24152456
    24162457  /* OK.  Must be a space.  */
    2417   return true;
    2418 }
    2419 
    2420 /* Return true if the given section is a SOM subspace, false otherwise.  */
    2421 
    2422 static boolean
     2458  return TRUE;
     2459}
     2460
     2461/* Return TRUE if the given section is a SOM subspace, FALSE otherwise.  */
     2462
     2463static bfd_boolean
    24232464som_is_subspace (section)
    24242465     asection *section;
     
    24272468     subspace.  */
    24282469  if (som_section_data (section)->copy_data == NULL)
    2429     return false;
     2470    return FALSE;
    24302471
    24312472  /* If the containing space is the same as the given section,
     
    24342475      || (som_section_data (section)->copy_data->container->output_section
    24352476          == section))
    2436     return false;
     2477    return FALSE;
    24372478
    24382479  /* OK.  Must be a subspace.  */
    2439   return true;
    2440 }
    2441 
    2442 /* Return true if the given space containins the given subspace.  It
     2480  return TRUE;
     2481}
     2482
     2483/* Return TRUE if the given space containins the given subspace.  It
    24432484   is safe to assume space really is a space, and subspace really
    24442485   is a subspace.  */
    24452486
    2446 static boolean
     2487static bfd_boolean
    24472488som_is_container (space, subspace)
    24482489     asection *space, *subspace;
     
    25472588     unsigned long num_syms;
    25482589{
    2549   int i;
     2590  unsigned long i;
    25502591  asection *section;
    25512592  asymbol **sorted_syms;
     2593  bfd_size_type amt;
    25522594
    25532595  /* Most SOM relocations involving a symbol have a length which is
     
    25752617  for (section = abfd->sections; section != NULL; section = section->next)
    25762618    {
    2577       int i;
     2619      int j;
    25782620
    25792621      /* Does this section have any relocations?  */
    2580       if (section->reloc_count <= 0)
     2622      if ((int) section->reloc_count <= 0)
    25812623        continue;
    25822624
    25832625      /* Walk through each relocation for this section.  */
    2584       for (i = 1; i < section->reloc_count; i++)
     2626      for (j = 1; j < (int) section->reloc_count; j++)
    25852627        {
    2586           arelent *reloc = section->orelocation[i];
     2628          arelent *reloc = section->orelocation[j];
    25872629          int scale;
    25882630
     
    26212663  /* Sort a copy of the symbol table, rather than the canonical
    26222664     output symbol table.  */
    2623   sorted_syms = (asymbol **) bfd_zalloc (abfd, num_syms * sizeof (asymbol *));
     2665  amt = num_syms;
     2666  amt *= sizeof (asymbol *);
     2667  sorted_syms = (asymbol **) bfd_zalloc (abfd, amt);
    26242668  memcpy (sorted_syms, syms, num_syms * sizeof (asymbol *));
    26252669  qsort (sorted_syms, num_syms, sizeof (asymbol *), compare_syms);
     
    26392683}
    26402684
    2641 static boolean
     2685static bfd_boolean
    26422686som_write_fixups (abfd, current_offset, total_reloc_sizep)
    26432687     bfd *abfd;
     
    26542698  unsigned int num_spaces = obj_som_file_hdr (abfd)->space_total;
    26552699  asection *section = abfd->sections;
     2700  bfd_size_type amt;
    26562701
    26572702  memset (tmp_space, 0, SOM_TMP_BUFSIZE);
     
    26782723           subsection = subsection->next)
    26792724        {
    2680           int reloc_offset, current_rounding_mode;
     2725          int reloc_offset;
     2726          unsigned int current_rounding_mode;
    26812727#ifndef NO_PCREL_MODES
    26822728          int current_call_mode;
     
    27062752             for this subspace in preparation for writing out its fixup
    27072753             stream.  */
    2708           if (bfd_seek (abfd, current_offset + total_reloc_size, SEEK_SET) < 0)
    2709             return false;
     2754          if (bfd_seek (abfd, current_offset + total_reloc_size, SEEK_SET) != 0)
     2755            return FALSE;
    27102756
    27112757          /* Buffer space has already been allocated.  Just perform some
     
    27442790              if (p - tmp_space + 100 > SOM_TMP_BUFSIZE)
    27452791                {
    2746                   if (bfd_write ((PTR) tmp_space, p - tmp_space, 1, abfd)
    2747                       != p - tmp_space)
    2748                     return false;
     2792                  amt = p - tmp_space;
     2793                  if (bfd_bwrite ((PTR) tmp_space, amt, abfd) != amt)
     2794                    return FALSE;
    27492795
    27502796                  p = tmp_space;
     
    28282874                      bfd_put_8 (abfd, bfd_reloc->howto->type + 33, p);
    28292875                      bfd_put_8 (abfd, sym_num >> 16, p + 1);
    2830                       bfd_put_16 (abfd, sym_num, p + 2);
     2876                      bfd_put_16 (abfd, (bfd_vma) sym_num, p + 2);
    28312877                      p = try_prev_fixup (abfd, &subspace_reloc_size,
    28322878                                          p, 4, reloc_queue);
     
    28572903                      bfd_put_8 (abfd, bfd_reloc->howto->type + 1, p);
    28582904                      bfd_put_8 (abfd, sym_num >> 16, p + 1);
    2859                       bfd_put_16 (abfd, sym_num, p + 2);
     2905                      bfd_put_16 (abfd, (bfd_vma) sym_num, p + 2);
    28602906                      p = try_prev_fixup (abfd, &subspace_reloc_size,
    28612907                                          p, 4, reloc_queue);
     
    28672913                case R_ENTRY:
    28682914                  {
    2869                     int tmp;
     2915                    unsigned int tmp;
    28702916                    arelent *tmp_reloc = NULL;
    28712917                    bfd_put_8 (abfd, R_ENTRY, p);
     
    29402986
    29412987                case R_END_TRY:
    2942                   /* The end of a exception handling region.  The reloc's
     2988                  /* The end of an exception handling region.  The reloc's
    29432989                     addend contains the offset of the exception handling
    29442990                     code.  */
     
    29793025                  bfd_put_8 (abfd, 0x80, p + 1);
    29803026                  bfd_put_8 (abfd, sym_num >> 16, p + 2);
    2981                   bfd_put_16 (abfd, sym_num, p + 3);
     3027                  bfd_put_16 (abfd, (bfd_vma) sym_num, p + 3);
    29823028                  p = try_prev_fixup (abfd, &subspace_reloc_size,
    29833029                                      p, 5, reloc_queue);
     
    30073053          /* Last BFD relocation for a subspace has been processed.
    30083054             Map the rest of the subspace with R_NO_RELOCATION fixups.  */
    3009           p = som_reloc_skip (abfd, bfd_section_size (abfd, subsection)
    3010                                       - reloc_offset,
     3055          p = som_reloc_skip (abfd, (bfd_section_size (abfd, subsection)
     3056                                     - reloc_offset),
    30113057                              p, &subspace_reloc_size, reloc_queue);
    30123058
    30133059          /* Scribble out the relocations.  */
    3014           if (bfd_write ((PTR) tmp_space, p - tmp_space, 1, abfd)
    3015               != p - tmp_space)
    3016             return false;
     3060          amt = p - tmp_space;
     3061          if (bfd_bwrite ((PTR) tmp_space, amt, abfd) != amt)
     3062            return FALSE;
    30173063          p = tmp_space;
    30183064
     
    30243070    }
    30253071  *total_reloc_sizep = total_reloc_size;
    3026   return true;
     3072  return TRUE;
    30273073}
    30283074
    30293075/* Write out the space/subspace string table.  */
    30303076
    3031 static boolean
     3077static bfd_boolean
    30323078som_write_space_strings (abfd, current_offset, string_sizep)
    30333079     bfd *abfd;
     
    30423088  unsigned int strings_size = 0;
    30433089  asection *section;
     3090  bfd_size_type amt;
    30443091
    30453092  /* Seek to the start of the space strings in preparation for writing
    30463093     them out.  */
    3047   if (bfd_seek (abfd, current_offset, SEEK_SET) < 0)
    3048     return false;
     3094  if (bfd_seek (abfd, (file_ptr) current_offset, SEEK_SET) != 0)
     3095    return FALSE;
    30493096
    30503097  /* Walk through all the spaces and subspaces (order is not important)
     
    30633110
    30643111      /* If there is not enough room for the next entry, then dump the
    3065         current buffer contents now and maybe allocate a larger
    3066         buffer.  Each entry will take 4 bytes to hold the string
    3067         length + the string itself + null terminator.  */
     3112        current buffer contents now and maybe allocate a larger
     3113        buffer.  Each entry will take 4 bytes to hold the string
     3114        length + the string itself + null terminator.  */
    30683115      if (p - tmp_space + 5 + length > tmp_space_size)
    30693116        {
    30703117          /* Flush buffer before refilling or reallocating.  */
    3071           if (bfd_write ((PTR) &tmp_space[0], p - tmp_space, 1, abfd)
    3072               != p - tmp_space)
    3073             return false;
     3118          amt = p - tmp_space;
     3119          if (bfd_bwrite ((PTR) &tmp_space[0], amt, abfd) != amt)
     3120            return FALSE;
    30743121
    30753122          /* Reallocate if now empty buffer still too small.  */
     
    30773124            {
    30783125              /* Ensure a minimum growth factor to avoid O(n**2) space
    3079                 consumption for n strings.  The optimal minimum
    3080                 factor seems to be 2, as no other value can guarantee
    3081                  wasting less then 50% space.  (Note that we cannot
    3082                 deallocate space allocated by `alloca' without
    3083                 returning from this function.)  The same technique is
    3084                 used a few more times below when a buffer is
    3085                 reallocated.  */
     3126                consumption for n strings.  The optimal minimum
     3127                factor seems to be 2, as no other value can guarantee
     3128                 wasting less than 50% space.  (Note that we cannot
     3129                deallocate space allocated by `alloca' without
     3130                returning from this function.)  The same technique is
     3131                used a few more times below when a buffer is
     3132                reallocated.  */
    30863133              tmp_space_size = MAX (2 * tmp_space_size, 5 + length);
    30873134              tmp_space = alloca (tmp_space_size);
     
    30943141      /* First element in a string table entry is the length of the
    30953142         string.  Alignment issues are already handled.  */
    3096       bfd_put_32 (abfd, length, p);
     3143      bfd_put_32 (abfd, (bfd_vma) length, p);
    30973144      p += 4;
    30983145      strings_size += 4;
     
    31203167  /* Done with the space/subspace strings.  Write out any information
    31213168     contained in a partial block.  */
    3122   if (bfd_write ((PTR) &tmp_space[0], p - tmp_space, 1, abfd) != p - tmp_space)
    3123     return false;
     3169  amt = p - tmp_space;
     3170  if (bfd_bwrite ((PTR) &tmp_space[0], amt, abfd) != amt)
     3171    return FALSE;
    31243172  *string_sizep = strings_size;
    3125   return true;
     3173  return TRUE;
    31263174}
    31273175
    31283176/* Write out the symbol string table.  */
    31293177
    3130 static boolean
     3178static bfd_boolean
    31313179som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep,
    31323180                          compilation_unit)
     
    31483196  unsigned int strings_size = 0;
    31493197  unsigned char *comp[4];
     3198  bfd_size_type amt;
    31503199
    31513200  /* This gets a bit gruesome because of the compilation unit.  The
     
    31653214  /* Seek to the start of the space strings in preparation for writing
    31663215     them out.  */
    3167   if (bfd_seek (abfd, current_offset, SEEK_SET) < 0)
    3168     return false;
     3216  if (bfd_seek (abfd, (file_ptr) current_offset, SEEK_SET) != 0)
     3217    return FALSE;
    31693218
    31703219  if (compilation_unit)
     
    31803229            {
    31813230              /* Flush buffer before refilling or reallocating.  */
    3182               if (bfd_write ((PTR) &tmp_space[0], p - tmp_space, 1, abfd)
    3183                   != p - tmp_space)
    3184                 return false;
     3231              amt = p - tmp_space;
     3232              if (bfd_bwrite ((PTR) &tmp_space[0], amt, abfd) != amt)
     3233                return FALSE;
    31853234
    31863235              /* Reallocate if now empty buffer still too small.  */
     
    31933242
    31943243              /* Reset to beginning of the (possibly new) buffer
    3195                 space.  */
     3244                space.  */
    31963245              p = tmp_space;
    31973246            }
     
    32013250             also an appropriate time to fill in the string index
    32023251             field in the symbol table entry.  */
    3203           bfd_put_32 (abfd, length, p);
     3252          bfd_put_32 (abfd, (bfd_vma) length, p);
    32043253          strings_size += 4;
    32053254          p += 4;
     
    32493298        {
    32503299          /* Flush buffer before refilling or reallocating.  */
    3251           if (bfd_write ((PTR) &tmp_space[0], p - tmp_space, 1, abfd)
    3252               != p - tmp_space)
    3253             return false;
     3300          amt = p - tmp_space;
     3301          if (bfd_bwrite ((PTR) &tmp_space[0], amt, abfd) != amt)
     3302            return FALSE;
    32543303
    32553304          /* Reallocate if now empty buffer still too small.  */
     
    32693318         an appropriate time to fill in the string index field in the
    32703319         symbol table entry.  */
    3271       bfd_put_32 (abfd, length, p);
     3320      bfd_put_32 (abfd, (bfd_vma) length, p);
    32723321      strings_size += 4;
    32733322      p += 4;
     
    32903339
    32913340  /* Scribble out any partial block.  */
    3292   if (bfd_write ((PTR) &tmp_space[0], p - tmp_space, 1, abfd) != p - tmp_space)
    3293     return false;
     3341  amt = p - tmp_space;
     3342  if (bfd_bwrite ((PTR) &tmp_space[0], amt, abfd) != amt)
     3343    return FALSE;
    32943344
    32953345  *string_sizep = strings_size;
    3296   return true;
     3346  return TRUE;
    32973347}
    32983348
     
    33013351   writing parts of the object file.  */
    33023352
    3303 static boolean
     3353static bfd_boolean
    33043354som_begin_writing (abfd)
    33053355     bfd *abfd;
     
    33443394  if (obj_som_version_hdr (abfd) != NULL)
    33453395    {
    3346       unsigned int len;
    3347 
    3348       if (bfd_seek (abfd, current_offset, SEEK_SET) < 0)
    3349         return false;
     3396      bfd_size_type len;
     3397
     3398      if (bfd_seek (abfd, (file_ptr) current_offset, SEEK_SET) != 0)
     3399        return FALSE;
    33503400
    33513401      /* Write the aux_id structure and the string length.  */
     
    33533403      obj_som_file_hdr (abfd)->aux_header_size += len;
    33543404      current_offset += len;
    3355       if (bfd_write ((PTR) obj_som_version_hdr (abfd), len, 1, abfd) != len)
    3356         return false;
     3405      if (bfd_bwrite ((PTR) obj_som_version_hdr (abfd), len, abfd) != len)
     3406        return FALSE;
    33573407
    33583408      /* Write the version string.  */
     
    33603410      obj_som_file_hdr (abfd)->aux_header_size += len;
    33613411      current_offset += len;
    3362       if (bfd_write ((PTR) obj_som_version_hdr (abfd)->user_string,
    3363                      len, 1, abfd) != len)
    3364         return false;
     3412      if (bfd_bwrite ((PTR) obj_som_version_hdr (abfd)->user_string, len, abfd)
     3413          != len)
     3414        return FALSE;
    33653415    }
    33663416
    33673417  if (obj_som_copyright_hdr (abfd) != NULL)
    33683418    {
    3369       unsigned int len;
    3370 
    3371       if (bfd_seek (abfd, current_offset, SEEK_SET) < 0)
    3372         return false;
     3419      bfd_size_type len;
     3420
     3421      if (bfd_seek (abfd, (file_ptr) current_offset, SEEK_SET) != 0)
     3422        return FALSE;
    33733423
    33743424      /* Write the aux_id structure and the string length.  */
     
    33763426      obj_som_file_hdr (abfd)->aux_header_size += len;
    33773427      current_offset += len;
    3378       if (bfd_write ((PTR) obj_som_copyright_hdr (abfd), len, 1, abfd) != len)
    3379         return false;
     3428      if (bfd_bwrite ((PTR) obj_som_copyright_hdr (abfd), len, abfd) != len)
     3429        return FALSE;
    33803430
    33813431      /* Write the copyright string.  */
     
    33833433      obj_som_file_hdr (abfd)->aux_header_size += len;
    33843434      current_offset += len;
    3385       if (bfd_write ((PTR) obj_som_copyright_hdr (abfd)->copyright,
    3386                      len, 1, abfd) != len)
    3387         return false;
     3435      if (bfd_bwrite ((PTR) obj_som_copyright_hdr (abfd)->copyright, len, abfd)
     3436          != len)
     3437        return FALSE;
    33883438    }
    33893439
     
    34323482
    34333483  /* Scribble out the space strings.  */
    3434   if (som_write_space_strings (abfd, current_offset, &strings_size) == false)
    3435     return false;
     3484  if (! som_write_space_strings (abfd, current_offset, &strings_size))
     3485    return FALSE;
    34363486
    34373487  /* Record total string table size in the header and update the
     
    36293679  if (abfd->flags & (EXEC_P | DYNAMIC))
    36303680    current_offset = SOM_ALIGN (current_offset, PA_PAGESIZE);
    3631   if (bfd_seek (abfd, current_offset - 1, SEEK_SET) < 0)
    3632     return false;
    3633   if (bfd_write ((PTR) "", 1, 1, abfd) != 1)
    3634     return false;
     3681  if (bfd_seek (abfd, (file_ptr) current_offset - 1, SEEK_SET) != 0)
     3682    return FALSE;
     3683  if (bfd_bwrite ((PTR) "", (bfd_size_type) 1, abfd) != 1)
     3684    return FALSE;
    36353685
    36363686  obj_som_file_hdr (abfd)->unloadable_sp_size
     
    36443694  obj_som_file_hdr (abfd)->som_length = current_offset;
    36453695
    3646   return true;
     3696  return TRUE;
    36473697}
    36483698
    36493699/* Finally, scribble out the various headers to the disk.  */
    36503700
    3651 static boolean
     3701static bfd_boolean
    36523702som_finish_writing (abfd)
    36533703     bfd *abfd;
     
    36613711  unsigned long current_offset;
    36623712  unsigned int total_reloc_size;
     3713  bfd_size_type amt;
     3714
     3715  /* We must set up the version identifier here as objcopy/strip copy
     3716     private BFD data too late for us to handle this in som_begin_writing.  */
     3717  if (obj_som_exec_data (abfd)
     3718      && obj_som_exec_data (abfd)->version_id)
     3719    obj_som_file_hdr (abfd)->version_id = obj_som_exec_data (abfd)->version_id;
     3720  else
     3721    obj_som_file_hdr (abfd)->version_id = NEW_VERSION_ID;
    36633722
    36643723  /* Next is the symbol table.  These are fixed length records.
     
    36933752
    36943753  /* Scribble out the symbol strings.  */
    3695   if (som_write_symbol_strings (abfd, current_offset, syms,
    3696                                 num_syms, &strings_size,
    3697                                 obj_som_compilation_unit (abfd))
    3698       == false)
    3699     return false;
     3754  if (! som_write_symbol_strings (abfd, current_offset, syms,
     3755                                  num_syms, &strings_size,
     3756                                  obj_som_compilation_unit (abfd)))
     3757    return FALSE;
    37003758
    37013759  /* Record total string table size in header and update the
     
    37173775  /* Write the fixups and update fields in subspace headers which
    37183776     relate to the fixup stream.  */
    3719   if (som_write_fixups (abfd, current_offset, &total_reloc_size) == false)
    3720     return false;
     3777  if (! som_write_fixups (abfd, current_offset, &total_reloc_size))
     3778    return FALSE;
    37213779
    37223780  /* Record the total size of the fixup stream in the file header.  */
     
    37283786  /* Now that the symbol table information is complete, build and
    37293787     write the symbol table.  */
    3730   if (som_build_and_write_symbol_table (abfd) == false)
    3731     return false;
     3788  if (! som_build_and_write_symbol_table (abfd))
     3789    return FALSE;
    37323790
    37333791  /* Subspaces are written first so that we can set up information
     
    37363794  /* Seek to the start of the subspace dictionary records.  */
    37373795  location = obj_som_file_hdr (abfd)->subspace_location;
    3738   if (bfd_seek (abfd, location, SEEK_SET) < 0)
    3739     return false;
     3796  if (bfd_seek (abfd, location, SEEK_SET) != 0)
     3797    return FALSE;
    37403798
    37413799  section = abfd->sections;
     
    37843842
    37853843          /* Dump the current subspace header.  */
    3786           if (bfd_write ((PTR) som_section_data (subsection)->subspace_dict,
    3787                          sizeof (struct subspace_dictionary_record), 1, abfd)
    3788               != sizeof (struct subspace_dictionary_record))
    3789             return false;
     3844          amt = sizeof (struct subspace_dictionary_record);
     3845          if (bfd_bwrite ((PTR) som_section_data (subsection)->subspace_dict,
     3846                         amt, abfd) != amt)
     3847            return FALSE;
    37903848        }
    37913849      /* Goto the next section.  */
     
    38403898
    38413899          /* Dump this subspace header.  */
    3842           if (bfd_write ((PTR) som_section_data (subsection)->subspace_dict,
    3843                          sizeof (struct subspace_dictionary_record), 1, abfd)
    3844               != sizeof (struct subspace_dictionary_record))
    3845             return false;
     3900          amt = sizeof (struct subspace_dictionary_record);
     3901          if (bfd_bwrite ((PTR) som_section_data (subsection)->subspace_dict,
     3902                         amt, abfd) != amt)
     3903            return FALSE;
    38463904        }
    38473905      /* Goto the next section.  */
     
    38553913     dictionary records.  */
    38563914  location = obj_som_file_hdr (abfd)->space_location;
    3857   if (bfd_seek (abfd, location, SEEK_SET) < 0)
    3858     return false;
     3915  if (bfd_seek (abfd, location, SEEK_SET) != 0)
     3916    return FALSE;
    38593917
    38603918  section = abfd->sections;
     
    38663924
    38673925      /* Dump its header.  */
    3868       if (bfd_write ((PTR) som_section_data (section)->space_dict,
    3869                      sizeof (struct space_dictionary_record), 1, abfd)
    3870           != sizeof (struct space_dictionary_record))
    3871         return false;
     3926      amt = sizeof (struct space_dictionary_record);
     3927      if (bfd_bwrite ((PTR) som_section_data (section)->space_dict,
     3928                     amt, abfd) != amt)
     3929        return FALSE;
    38723930
    38733931      /* Goto the next section.  */
     
    38793937    {
    38803938      location = obj_som_file_hdr (abfd)->compiler_location;
    3881       if (bfd_seek (abfd, location, SEEK_SET) < 0)
    3882         return false;
    3883 
    3884       if (bfd_write ((PTR) obj_som_compilation_unit (abfd),
    3885                      COMPUNITSZ, 1, abfd) != COMPUNITSZ)
    3886         return false;
     3939      if (bfd_seek (abfd, location, SEEK_SET) != 0)
     3940        return FALSE;
     3941
     3942      amt = COMPUNITSZ;
     3943      if (bfd_bwrite ((PTR) obj_som_compilation_unit (abfd), amt, abfd) != amt)
     3944        return FALSE;
    38873945    }
    38883946
     
    39043962  /* Only thing left to do is write out the file header.  It is always
    39053963     at location zero.  Seek there and write it.  */
    3906   if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) < 0)
    3907     return false;
    3908   if (bfd_write ((PTR) obj_som_file_hdr (abfd),
    3909                  sizeof (struct header), 1, abfd)
    3910       != sizeof (struct header))
    3911     return false;
     3964  if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
     3965    return FALSE;
     3966  amt = sizeof (struct header);
     3967  if (bfd_bwrite ((PTR) obj_som_file_hdr (abfd), amt, abfd) != amt)
     3968    return FALSE;
    39123969
    39133970  /* Now write the exec header.  */
     
    39383995        {
    39393996          bfd_set_error (bfd_error_bad_value);
    3940           return false;
     3997          return FALSE;
    39413998        }
    39423999
    39434000      if (bfd_seek (abfd, obj_som_file_hdr (abfd)->aux_header_location,
    3944                     SEEK_SET) < 0)
    3945         return false;
    3946 
    3947       if (bfd_write ((PTR) exec_header, AUX_HDR_SIZE, 1, abfd)
    3948           != AUX_HDR_SIZE)
    3949         return false;
    3950     }
    3951   return true;
     4001                    SEEK_SET) != 0)
     4002        return FALSE;
     4003
     4004      amt = AUX_HDR_SIZE;
     4005      if (bfd_bwrite ((PTR) exec_header, amt, abfd) != amt)
     4006        return FALSE;
     4007    }
     4008  return TRUE;
    39524009}
    39534010
     
    40844141  /* The secondary_def field is for weak symbols.  */
    40854142  if (sym->flags & BSF_WEAK)
    4086     info->secondary_def = true;
     4143    info->secondary_def = TRUE;
    40874144  else
    4088     info->secondary_def = false;
     4145    info->secondary_def = FALSE;
    40894146
    40904147}
     
    40934150   this BFD.  */
    40944151
    4095 static boolean
     4152static bfd_boolean
    40964153som_build_and_write_symbol_table (abfd)
    40974154     bfd *abfd;
     
    41014158  asymbol **bfd_syms = obj_som_sorted_syms (abfd);
    41024159  struct symbol_dictionary_record *som_symtab = NULL;
    4103   int i, symtab_size;
     4160  unsigned int i;
     4161  bfd_size_type symtab_size;
    41044162
    41054163  /* Compute total symbol table size and allocate a chunk of memory
    41064164     to hold the symbol table as we build it.  */
    4107   symtab_size = num_syms * sizeof (struct symbol_dictionary_record);
    4108   som_symtab = (struct symbol_dictionary_record *) bfd_malloc (symtab_size);
     4165  symtab_size = num_syms;
     4166  symtab_size *= sizeof (struct symbol_dictionary_record);
     4167  som_symtab = (struct symbol_dictionary_record *) bfd_zmalloc (symtab_size);
    41094168  if (som_symtab == NULL && symtab_size != 0)
    41104169    goto error_return;
    4111   memset (som_symtab, 0, symtab_size);
    41124170
    41134171  /* Walk over each symbol.  */
     
    41374195     scribble out the symbol table.  */
    41384196  if (bfd_seek (abfd, symtab_location, SEEK_SET) != 0)
    4139     return false;
    4140 
    4141   if (bfd_write ((PTR) som_symtab, symtab_size, 1, abfd) != symtab_size)
     4197    return FALSE;
     4198
     4199  if (bfd_bwrite ((PTR) som_symtab, symtab_size, abfd) != symtab_size)
    41424200    goto error_return;
    41434201
    41444202  if (som_symtab != NULL)
    41454203    free (som_symtab);
    4146   return true;
     4204  return TRUE;
    41474205 error_return:
    41484206  if (som_symtab != NULL)
    41494207    free (som_symtab);
    4150   return false;
     4208  return FALSE;
    41514209}
    41524210
    41534211/* Write an object in SOM format.  */
    41544212
    4155 static boolean
     4213static bfd_boolean
    41564214som_write_object_contents (abfd)
    41574215     bfd *abfd;
    41584216{
    4159   if (abfd->output_has_begun == false)
     4217  if (! abfd->output_has_begun)
    41604218    {
    41614219      /* Set up fixed parts of the file, space, and subspace headers.
    41624220         Notify the world that output has begun.  */
    41634221      som_prep_headers (abfd);
    4164       abfd->output_has_begun = true;
     4222      abfd->output_has_begun = TRUE;
    41654223      /* Start writing the object file.  This include all the string
    41664224         tables, fixup streams, and other portions of the object file.  */
     
    41744232/* Read and save the string table associated with the given BFD.  */
    41754233
    4176 static boolean
     4234static bfd_boolean
    41774235som_slurp_string_table (abfd)
    41784236     bfd *abfd;
    41794237{
    41804238  char *stringtab;
     4239  bfd_size_type amt;
    41814240
    41824241  /* Use the saved version if its available.  */
    41834242  if (obj_som_stringtab (abfd) != NULL)
    4184     return true;
     4243    return TRUE;
    41854244
    41864245  /* I don't think this can currently happen, and I'm not sure it should
     
    41904249    {
    41914250      bfd_set_error (bfd_error_no_symbols);
    4192       return false;
     4251      return FALSE;
    41934252    }
    41944253
    41954254  /* Allocate and read in the string table.  */
    4196   stringtab = bfd_malloc (obj_som_stringtab_size (abfd));
     4255  amt = obj_som_stringtab_size (abfd);
     4256  stringtab = bfd_zmalloc (amt);
    41974257  if (stringtab == NULL)
    4198     return false;
    4199   memset (stringtab, 0, obj_som_stringtab_size (abfd));
    4200 
    4201   if (bfd_seek (abfd, obj_som_str_filepos (abfd), SEEK_SET) < 0)
    4202     return false;
    4203 
    4204   if (bfd_read (stringtab, obj_som_stringtab_size (abfd), 1, abfd)
    4205       != obj_som_stringtab_size (abfd))
    4206     return false;
     4258    return FALSE;
     4259
     4260  if (bfd_seek (abfd, obj_som_str_filepos (abfd), SEEK_SET) != 0)
     4261    return FALSE;
     4262
     4263  if (bfd_bread (stringtab, amt, abfd) != amt)
     4264    return FALSE;
    42074265
    42084266  /* Save our results and return success.  */
    42094267  obj_som_stringtab (abfd) = stringtab;
    4210   return true;
     4268  return TRUE;
    42114269}
    42124270
     
    42844342  struct symbol_dictionary_record *buf = NULL, *bufp, *endbufp;
    42854343  som_symbol_type *sym, *symbase;
     4344  bfd_size_type amt;
    42864345
    42874346  /* Return saved value if it exists.  */
     
    42984357  stringtab = obj_som_stringtab (abfd);
    42994358
    4300   symbase = ((som_symbol_type *)
    4301              bfd_malloc (symbol_count * sizeof (som_symbol_type)));
     4359  amt = symbol_count;
     4360  amt *= sizeof (som_symbol_type);
     4361  symbase = (som_symbol_type *) bfd_zmalloc (amt);
    43024362  if (symbase == NULL)
    43034363    goto error_return;
    4304   memset (symbase, 0, symbol_count * sizeof (som_symbol_type));
    43054364
    43064365  /* Read in the external SOM representation.  */
    4307   buf = bfd_malloc (symbol_count * symsize);
    4308   if (buf == NULL && symbol_count * symsize != 0)
     4366  amt = symbol_count;
     4367  amt *= symsize;
     4368  buf = bfd_malloc (amt);
     4369  if (buf == NULL && amt != 0)
    43094370    goto error_return;
    4310   if (bfd_seek (abfd, obj_som_sym_filepos (abfd), SEEK_SET) < 0)
     4371  if (bfd_seek (abfd, obj_som_sym_filepos (abfd), SEEK_SET) != 0)
    43114372    goto error_return;
    4312   if (bfd_read (buf, symbol_count * symsize, 1, abfd)
    4313       != symbol_count * symsize)
     4373  if (bfd_bread (buf, amt, abfd) != amt)
    43144374    goto error_return;
    43154375
     
    44374497
    44384498      /* Note increment at bottom of loop, since we skip some symbols
    4439         we can not include it as part of the for statement.  */
     4499        we can not include it as part of the for statement.  */
    44404500      sym++;
    44414501    }
     
    44504510  if (buf != NULL)
    44514511    free (buf);
    4452   return (true);
     4512  return (TRUE);
    44534513
    44544514 error_return:
    44554515  if (buf != NULL)
    44564516    free (buf);
    4457   return false;
     4517  return FALSE;
    44584518}
    44594519
     
    44894549     bfd *abfd;
    44904550{
    4491   som_symbol_type *new =
    4492     (som_symbol_type *) bfd_zalloc (abfd, sizeof (som_symbol_type));
     4551  bfd_size_type amt = sizeof (som_symbol_type);
     4552  som_symbol_type *new = (som_symbol_type *) bfd_zalloc (abfd, amt);
    44934553  if (new == NULL)
    44944554    return 0;
     
    45014561
    45024562static void
    4503 som_print_symbol (ignore_abfd, afile, symbol, how)
    4504      bfd *ignore_abfd ATTRIBUTE_UNUSED;
     4563som_print_symbol (abfd, afile, symbol, how)
     4564     bfd *abfd;
    45054565     PTR afile;
    45064566     asymbol *symbol;
     
    45204580    case bfd_print_symbol_all:
    45214581      {
    4522         CONST char *section_name;
     4582        const char *section_name;
    45234583        section_name = symbol->section ? symbol->section->name : "(*none*)";
    4524         bfd_print_symbol_vandf ((PTR) file, symbol);
     4584        bfd_print_symbol_vandf (abfd, (PTR) file, symbol);
    45254585        fprintf (file, " %s\t%s", section_name, symbol->name);
    45264586        break;
     
    45294589}
    45304590
    4531 static boolean
     4591static bfd_boolean
    45324592som_bfd_is_local_label_name (abfd, name)
    45334593     bfd *abfd ATTRIBUTE_UNUSED;
     
    45574617     asection *section;
    45584618     asymbol **symbols;
    4559      boolean just_count;
     4619     bfd_boolean just_count;
    45604620{
    45614621  unsigned int op, varname, deallocate_contents = 0;
     
    46424702
    46434703              /* If this is a variable, push it on the stack.  */
    4644               if (isupper (c))
     4704              if (ISUPPER (c))
    46454705                push (var (c));
    46464706
     
    46484708                 additional data from the fixup stream to be pushed onto
    46494709                 the stack.  */
    4650               else if (islower (c))
     4710              else if (ISLOWER (c))
    46514711                {
    46524712                  int bits = (c - 'a') * 8;
     
    46594719
    46604720              /* A decimal constant.  Push it on the stack.  */
    4661               else if (isdigit (c))
     4721              else if (ISDIGIT (c))
    46624722                {
    46634723                  v = c - '0';
    4664                   while (isdigit (*cp))
     4724                  while (ISDIGIT (*cp))
    46654725                    v = (v * 10) + (*cp++ - '0');
    46664726                  push (v);
     
    48474907                    {
    48484908                      /* Got to read the damn contents first.  We don't
    4849                         bother saving the contents (yet).  Add it one
     4909                        bother saving the contents (yet).  Add it one
    48504910                         day if the need arises.  */
    48514911                      section->contents = bfd_malloc (section->_raw_size);
    48524912                      if (section->contents == NULL)
    4853                         return -1;
     4913                        return (unsigned) -1;
    48544914
    48554915                      deallocate_contents = 1;
     
    48574917                                                section,
    48584918                                                section->contents,
    4859                                                 0,
     4919                                                (bfd_vma) 0,
    48604920                                                section->_raw_size);
    48614921                    }
     
    48914951
    48924952   som_get_reloc_upper_bound calls this routine with JUST_COUNT
    4893    set to true to indicate it only needs a count of the number
     4953   set to TRUE to indicate it only needs a count of the number
    48944954   of actual relocations.  */
    48954955
    4896 static boolean
     4956static bfd_boolean
    48974957som_slurp_reloc_table (abfd, section, symbols, just_count)
    48984958     bfd *abfd;
    48994959     asection *section;
    49004960     asymbol **symbols;
    4901      boolean just_count;
     4961     bfd_boolean just_count;
    49024962{
    49034963  char *external_relocs;
     
    49054965  arelent *internal_relocs;
    49064966  unsigned int num_relocs;
     4967  bfd_size_type amt;
    49074968
    49084969  fixup_stream_size = som_section_data (section)->reloc_size;
    49094970  /* If there were no relocations, then there is nothing to do.  */
    49104971  if (section->reloc_count == 0)
    4911     return true;
     4972    return TRUE;
    49124973
    49134974  /* If reloc_count is -1, then the relocation stream has not been
    49144975     parsed.  We must do so now to know how many relocations exist.  */
    4915   if (section->reloc_count == -1)
    4916     {
    4917       external_relocs = (char *) bfd_malloc (fixup_stream_size);
     4976  if (section->reloc_count == (unsigned) -1)
     4977    {
     4978      amt = fixup_stream_size;
     4979      external_relocs = (char *) bfd_malloc (amt);
    49184980      if (external_relocs == (char *) NULL)
    4919         return false;
     4981        return FALSE;
    49204982      /* Read in the external forms.  */
    49214983      if (bfd_seek (abfd,
     
    49234985                    SEEK_SET)
    49244986          != 0)
    4925         return false;
    4926       if (bfd_read (external_relocs, 1, fixup_stream_size, abfd)
    4927           != fixup_stream_size)
    4928         return false;
     4987        return FALSE;
     4988      if (bfd_bread (external_relocs, amt, abfd) != amt)
     4989        return FALSE;
    49294990
    49304991      /* Let callers know how many relocations found.
     
    49334994      section->reloc_count = som_set_reloc_info (external_relocs,
    49344995                                                 fixup_stream_size,
    4935                                                  NULL, NULL, NULL, true);
     4996                                                 NULL, NULL, NULL, TRUE);
    49364997
    49374998      som_section_data (section)->reloc_stream = external_relocs;
     
    49405001  /* If the caller only wanted a count, then return now.  */
    49415002  if (just_count)
    4942     return true;
     5003    return TRUE;
    49435004
    49445005  num_relocs = section->reloc_count;
     
    49465007  /* Return saved information about the relocations if it is available.  */
    49475008  if (section->relocation != (arelent *) NULL)
    4948     return true;
    4949 
    4950   internal_relocs = (arelent *)
    4951     bfd_zalloc (abfd, (num_relocs * sizeof (arelent)));
     5009    return TRUE;
     5010
     5011  amt = num_relocs;
     5012  amt *= sizeof (arelent);
     5013  internal_relocs = (arelent *) bfd_zalloc (abfd, (amt));
    49525014  if (internal_relocs == (arelent *) NULL)
    4953     return false;
     5015    return FALSE;
    49545016
    49555017  /* Process and internalize the relocations.  */
    49565018  som_set_reloc_info (external_relocs, fixup_stream_size,
    4957                       internal_relocs, section, symbols, false);
     5019                      internal_relocs, section, symbols, FALSE);
    49585020
    49595021  /* We're done with the external relocations.  Free them.  */
     
    49635025  /* Save our results and return success.  */
    49645026  section->relocation = internal_relocs;
    4965   return (true);
     5027  return TRUE;
    49665028}
    49675029
     
    49785040  if (asect->flags & SEC_RELOC)
    49795041    {
    4980       if (! som_slurp_reloc_table (abfd, asect, NULL, true))
     5042      if (! som_slurp_reloc_table (abfd, asect, NULL, TRUE))
    49815043        return -1;
    49825044      return (asect->reloc_count + 1) * sizeof (arelent *);
     
    49995061  int count;
    50005062
    5001   if (som_slurp_reloc_table (abfd, section, symbols, false) == false)
     5063  if (! som_slurp_reloc_table (abfd, section, symbols, FALSE))
    50025064    return -1;
    50035065
     
    50165078/* A hook to set up object file dependent section information.  */
    50175079
    5018 static boolean
     5080static bfd_boolean
    50195081som_new_section_hook (abfd, newsect)
    50205082     bfd *abfd;
    50215083     asection *newsect;
    50225084{
    5023   newsect->used_by_bfd =
    5024     (PTR) bfd_zalloc (abfd, sizeof (struct som_section_data_struct));
     5085  bfd_size_type amt = sizeof (struct som_section_data_struct);
     5086  newsect->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
    50255087  if (!newsect->used_by_bfd)
    5026     return false;
     5088    return FALSE;
    50275089  newsect->alignment_power = 3;
    50285090
    50295091  /* We allow more than three sections internally.  */
    5030   return true;
     5092  return TRUE;
    50315093}
    50325094
     
    50345096   to the output symbol.  */
    50355097
    5036 static boolean
     5098static bfd_boolean
    50375099som_bfd_copy_private_symbol_data (ibfd, isymbol, obfd, osymbol)
    50385100     bfd *ibfd;
     
    50475109  if (ibfd->xvec->flavour != bfd_target_som_flavour
    50485110      || obfd->xvec->flavour != bfd_target_som_flavour)
    5049     return false;
     5111    return FALSE;
    50505112
    50515113  /* The only private information we need to copy is the argument relocation
     
    50545116    input_symbol->tc_data.ap.hppa_arg_reloc;
    50555117
    5056   return true;
     5118  return TRUE;
    50575119}
    50585120
     
    50605122   to the output section.  */
    50615123
    5062 static boolean
     5124static bfd_boolean
    50635125som_bfd_copy_private_section_data (ibfd, isection, obfd, osection)
    50645126     bfd *ibfd;
     
    50675129     asection *osection;
    50685130{
     5131  bfd_size_type amt;
     5132
    50695133  /* One day we may try to grok other private data.  */
    50705134  if (ibfd->xvec->flavour != bfd_target_som_flavour
    50715135      || obfd->xvec->flavour != bfd_target_som_flavour
    50725136      || (!som_is_space (isection) && !som_is_subspace (isection)))
    5073     return true;
    5074 
     5137    return TRUE;
     5138
     5139  amt = sizeof (struct som_copyable_section_data_struct);
    50755140  som_section_data (osection)->copy_data =
    5076     (struct som_copyable_section_data_struct *)
    5077     bfd_zalloc (obfd, sizeof (struct som_copyable_section_data_struct));
     5141    (struct som_copyable_section_data_struct *) bfd_zalloc (obfd, amt);
    50785142  if (som_section_data (osection)->copy_data == NULL)
    5079     return false;
     5143    return FALSE;
    50805144
    50815145  memcpy (som_section_data (osection)->copy_data,
     
    50885152      som_section_data (osection)->copy_data->container->output_section;
    50895153
    5090   return true;
     5154  return TRUE;
    50915155}
    50925156
     
    50945158   to the output bfd.  */
    50955159
    5096 static boolean
     5160static bfd_boolean
    50975161som_bfd_copy_private_bfd_data (ibfd, obfd)
    50985162     bfd *ibfd, *obfd;
     
    51015165  if (ibfd->xvec->flavour != bfd_target_som_flavour
    51025166      || obfd->xvec->flavour != bfd_target_som_flavour)
    5103     return true;
     5167    return TRUE;
    51045168
    51055169  /* Allocate some memory to hold the data we need.  */
    51065170  obj_som_exec_data (obfd) = (struct som_exec_data *)
    5107     bfd_zalloc (obfd, sizeof (struct som_exec_data));
     5171    bfd_zalloc (obfd, (bfd_size_type) sizeof (struct som_exec_data));
    51085172  if (obj_som_exec_data (obfd) == NULL)
    5109     return false;
     5173    return FALSE;
    51105174
    51115175  /* Now copy the data.  */
     
    51135177          sizeof (struct som_exec_data));
    51145178
    5115   return true;
     5179  return TRUE;
    51165180}
    51175181
     
    51195183   in the BFD data structures.  */
    51205184
    5121 boolean
     5185bfd_boolean
    51225186bfd_som_set_section_attributes (section, defined, private, sort_key, spnum)
    51235187     asection *section;
     
    51305194  if (som_section_data (section)->copy_data == NULL)
    51315195    {
     5196      bfd_size_type amt = sizeof (struct som_copyable_section_data_struct);
    51325197      som_section_data (section)->copy_data =
    5133         (struct som_copyable_section_data_struct *)
    5134         bfd_zalloc (section->owner,
    5135                     sizeof (struct som_copyable_section_data_struct));
     5198        (struct som_copyable_section_data_struct *) bfd_zalloc (section->owner,
     5199                                                                amt);
    51365200      if (som_section_data (section)->copy_data == NULL)
    5137         return false;
     5201        return FALSE;
    51385202    }
    51395203  som_section_data (section)->copy_data->sort_key = sort_key;
     
    51425206  som_section_data (section)->copy_data->container = section;
    51435207  som_section_data (section)->copy_data->space_number = spnum;
    5144   return true;
     5208  return TRUE;
    51455209}
    51465210
     
    51485212   in the BFD data structures.  */
    51495213
    5150 boolean
     5214bfd_boolean
    51515215bfd_som_set_subsection_attributes (section, container, access,
    51525216                                   sort_key, quadrant)
     
    51605224  if (som_section_data (section)->copy_data == NULL)
    51615225    {
     5226      bfd_size_type amt = sizeof (struct som_copyable_section_data_struct);
    51625227      som_section_data (section)->copy_data =
    5163         (struct som_copyable_section_data_struct *)
    5164         bfd_zalloc (section->owner,
    5165                     sizeof (struct som_copyable_section_data_struct));
     5228        (struct som_copyable_section_data_struct *) bfd_zalloc (section->owner,
     5229                                                                amt);
    51665230      if (som_section_data (section)->copy_data == NULL)
    5167         return false;
     5231        return FALSE;
    51685232    }
    51695233  som_section_data (section)->copy_data->sort_key = sort_key;
     
    51715235  som_section_data (section)->copy_data->quadrant = quadrant;
    51725236  som_section_data (section)->copy_data->container = container;
    5173   return true;
     5237  return TRUE;
    51745238}
    51755239
     
    51915255   written into the object file.  */
    51925256
    5193 boolean
     5257bfd_boolean
    51945258bfd_som_attach_aux_hdr (abfd, type, string)
    51955259     bfd *abfd;
     
    51975261     char *string;
    51985262{
     5263  bfd_size_type amt;
     5264
    51995265  if (type == VERSION_AUX_ID)
    52005266    {
    5201       int len = strlen (string);
     5267      size_t len = strlen (string);
    52025268      int pad = 0;
    52035269
    52045270      if (len % 4)
    52055271        pad = (4 - (len % 4));
    5206       obj_som_version_hdr (abfd) = (struct user_string_aux_hdr *)
    5207         bfd_zalloc (abfd, sizeof (struct aux_id)
    5208                               + sizeof (unsigned int) + len + pad);
     5272      amt = sizeof (struct aux_id) + sizeof (unsigned int) + len + pad;
     5273      obj_som_version_hdr (abfd) =
     5274        (struct user_string_aux_hdr *) bfd_zalloc (abfd, amt);
    52095275      if (!obj_som_version_hdr (abfd))
    5210         return false;
     5276        return FALSE;
    52115277      obj_som_version_hdr (abfd)->header_id.type = VERSION_AUX_ID;
    52125278      obj_som_version_hdr (abfd)->header_id.length = len + pad;
     
    52225288      if (len % 4)
    52235289        pad = (4 - (len % 4));
    5224       obj_som_copyright_hdr (abfd) = (struct copyright_aux_hdr *)
    5225         bfd_zalloc (abfd, sizeof (struct aux_id)
    5226                             + sizeof (unsigned int) + len + pad);
     5290      amt = sizeof (struct aux_id) + sizeof (unsigned int) + len + pad;
     5291      obj_som_copyright_hdr (abfd) =
     5292        (struct copyright_aux_hdr *) bfd_zalloc (abfd, amt);
    52275293      if (!obj_som_copyright_hdr (abfd))
    5228         return false;
     5294        return FALSE;
    52295295      obj_som_copyright_hdr (abfd)->header_id.type = COPYRIGHT_AUX_ID;
    52305296      obj_som_copyright_hdr (abfd)->header_id.length = len + pad;
     
    52335299      strcpy (obj_som_copyright_hdr (abfd)->copyright, string);
    52345300    }
    5235   return true;
    5236 }
    5237 
    5238 /* Attach an compilation unit header to the BFD backend so that it may be
     5301  return TRUE;
     5302}
     5303
     5304/* Attach a compilation unit header to the BFD backend so that it may be
    52395305   written into the object file.  */
    52405306
    5241 boolean
     5307bfd_boolean
    52425308bfd_som_attach_compilation_unit (abfd, name, language_name, product_id,
    52435309                                 version_id)
     
    52485314     const char *version_id;
    52495315{
    5250   COMPUNIT *n = (COMPUNIT *) bfd_zalloc (abfd, COMPUNITSZ);
     5316  COMPUNIT *n = (COMPUNIT *) bfd_zalloc (abfd, (bfd_size_type) COMPUNITSZ);
    52515317  if (n == NULL)
    5252     return false;
     5318    return FALSE;
    52535319
    52545320#define STRDUP(f) \
    52555321  if (f != NULL) \
    52565322    { \
    5257       n->f.n_name = bfd_alloc (abfd, strlen (f) + 1); \
     5323      n->f.n_name = bfd_alloc (abfd, (bfd_size_type) strlen (f) + 1); \
    52585324      if (n->f.n_name == NULL) \
    5259         return false; \
     5325        return FALSE; \
    52605326      strcpy (n->f.n_name, f); \
    52615327    }
     
    52705336  obj_som_compilation_unit (abfd) = n;
    52715337
    5272   return true;
    5273 }
    5274 
    5275 static boolean
     5338  return TRUE;
     5339}
     5340
     5341static bfd_boolean
    52765342som_get_section_contents (abfd, section, location, offset, count)
    52775343     bfd *abfd;
     
    52825348{
    52835349  if (count == 0 || ((section->flags & SEC_HAS_CONTENTS) == 0))
    5284     return true;
     5350    return TRUE;
    52855351  if ((bfd_size_type) (offset+count) > section->_raw_size
    5286       || bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) == -1
    5287       || bfd_read (location, (bfd_size_type) 1, count, abfd) != count)
    5288     return (false); /* on error */
    5289   return (true);
    5290 }
    5291 
    5292 static boolean
     5352      || bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) != 0
     5353      || bfd_bread (location, count, abfd) != count)
     5354    return FALSE; /* On error. */
     5355  return TRUE;
     5356}
     5357
     5358static bfd_boolean
    52935359som_set_section_contents (abfd, section, location, offset, count)
    52945360     bfd *abfd;
     
    52985364     bfd_size_type count;
    52995365{
    5300   if (abfd->output_has_begun == false)
     5366  if (! abfd->output_has_begun)
    53015367    {
    53025368      /* Set up fixed parts of the file, space, and subspace headers.
    53035369         Notify the world that output has begun.  */
    53045370      som_prep_headers (abfd);
    5305       abfd->output_has_begun = true;
     5371      abfd->output_has_begun = TRUE;
    53065372      /* Start writing the object file.  This include all the string
    53075373         tables, fixup streams, and other portions of the object file.  */
     
    53135379  if (!som_is_subspace (section)
    53145380      || ((section->flags & SEC_HAS_CONTENTS) == 0))
    5315     return true;
     5381    return TRUE;
    53165382
    53175383  /* Seek to the proper offset within the object file and write the
    53185384     data.  */
    53195385  offset += som_section_data (section)->subspace_dict->file_loc_init_value;
    5320   if (bfd_seek (abfd, offset, SEEK_SET) == -1)
    5321     return false;
    5322 
    5323   if (bfd_write ((PTR) location, 1, count, abfd) != count)
    5324     return false;
    5325   return true;
    5326 }
    5327 
    5328 static boolean
     5386  if (bfd_seek (abfd, offset, SEEK_SET) != 0)
     5387    return FALSE;
     5388
     5389  if (bfd_bwrite ((PTR) location, count, abfd) != count)
     5390    return FALSE;
     5391  return TRUE;
     5392}
     5393
     5394static bfd_boolean
    53295395som_set_arch_mach (abfd, arch, machine)
    53305396     bfd *abfd;
     
    53365402}
    53375403
    5338 static boolean
     5404static bfd_boolean
    53395405som_find_nearest_line (abfd, section, symbols, offset, filename_ptr,
    53405406                       functionname_ptr, line_ptr)
     
    53435409     asymbol **symbols ATTRIBUTE_UNUSED;
    53445410     bfd_vma offset ATTRIBUTE_UNUSED;
    5345      CONST char **filename_ptr ATTRIBUTE_UNUSED;
    5346      CONST char **functionname_ptr ATTRIBUTE_UNUSED;
     5411     const char **filename_ptr ATTRIBUTE_UNUSED;
     5412     const char **functionname_ptr ATTRIBUTE_UNUSED;
    53475413     unsigned int *line_ptr ATTRIBUTE_UNUSED;
    53485414{
    5349   return (false);
     5415  return FALSE;
    53505416}
    53515417
     
    53535419som_sizeof_headers (abfd, reloc)
    53545420     bfd *abfd ATTRIBUTE_UNUSED;
    5355      boolean reloc ATTRIBUTE_UNUSED;
     5421     bfd_boolean reloc ATTRIBUTE_UNUSED;
    53565422{
    53575423  (*_bfd_error_handler) (_("som_sizeof_headers unimplemented"));
    53585424  fflush (stderr);
    53595425  abort ();
    5360   return (0);
     5426  return 0;
    53615427}
    53625428
     
    54025468    return '?';
    54035469  if (symbol->flags & BSF_GLOBAL)
    5404     c = toupper (c);
     5470    c = TOUPPER (c);
    54055471  return c;
    54065472}
     
    54255491   so that we can allocate space for all the carsyms at once.  */
    54265492
    5427 static boolean
     5493static bfd_boolean
    54285494som_bfd_count_ar_symbols (abfd, lst_header, count)
    54295495     bfd *abfd;
     
    54335499  unsigned int i;
    54345500  unsigned int *hash_table = NULL;
     5501  bfd_size_type amt;
    54355502  file_ptr lst_filepos = bfd_tell (abfd) - sizeof (struct lst_header);
    54365503
    5437   hash_table =
    5438     (unsigned int *) bfd_malloc (lst_header->hash_size
    5439                                  * sizeof (unsigned int));
     5504  amt = lst_header->hash_size;
     5505  amt *= sizeof (unsigned int);
     5506  hash_table = (unsigned int *) bfd_malloc (amt);
    54405507  if (hash_table == NULL && lst_header->hash_size != 0)
    54415508    goto error_return;
     
    54465513  /* Read in the hash table.  The has table is an array of 32bit file offsets
    54475514     which point to the hash chains.  */
    5448   if (bfd_read ((PTR) hash_table, lst_header->hash_size, 4, abfd)
    5449       != lst_header->hash_size * 4)
     5515  if (bfd_bread ((PTR) hash_table, amt, abfd) != amt)
    54505516    goto error_return;
    54515517
     
    54615527
    54625528      /* Seek to the first symbol in this hash chain.  */
    5463       if (bfd_seek (abfd, lst_filepos + hash_table[i], SEEK_SET) < 0)
     5529      if (bfd_seek (abfd, lst_filepos + hash_table[i], SEEK_SET) != 0)
    54645530        goto error_return;
    54655531
    54665532      /* Read in this symbol and update the counter.  */
    5467       if (bfd_read ((PTR) & lst_symbol, 1, sizeof (lst_symbol), abfd)
    5468           != sizeof (lst_symbol))
     5533      amt = sizeof (lst_symbol);
     5534      if (bfd_bread ((PTR) &lst_symbol, amt, abfd) != amt)
    54695535        goto error_return;
    54705536
     
    54775543          /* Seek to the next symbol.  */
    54785544          if (bfd_seek (abfd, lst_filepos + lst_symbol.next_entry, SEEK_SET)
    5479               < 0)
     5545              != 0)
    54805546            goto error_return;
    54815547
    54825548          /* Read the symbol in and update the counter.  */
    5483           if (bfd_read ((PTR) & lst_symbol, 1, sizeof (lst_symbol), abfd)
    5484               != sizeof (lst_symbol))
     5549          amt = sizeof (lst_symbol);
     5550          if (bfd_bread ((PTR) &lst_symbol, amt, abfd) != amt)
    54855551            goto error_return;
    54865552
     
    54905556  if (hash_table != NULL)
    54915557    free (hash_table);
    5492   return true;
     5558  return TRUE;
    54935559
    54945560 error_return:
    54955561  if (hash_table != NULL)
    54965562    free (hash_table);
    5497   return false;
     5563  return FALSE;
    54985564}
    54995565
     
    55015567   by ABFD and LST_HEADER.  */
    55025568
    5503 static boolean
     5569static bfd_boolean
    55045570som_bfd_fill_in_ar_symbols (abfd, lst_header, syms)
    55055571     bfd *abfd;
     
    55115577  unsigned int *hash_table = NULL;
    55125578  struct som_entry *som_dict = NULL;
     5579  bfd_size_type amt;
    55135580  file_ptr lst_filepos = bfd_tell (abfd) - sizeof (struct lst_header);
    55145581
    5515   hash_table =
    5516     (unsigned int *) bfd_malloc (lst_header->hash_size
    5517                                  * sizeof (unsigned int));
     5582  amt = lst_header->hash_size;
     5583  amt *= sizeof (unsigned int);
     5584  hash_table = (unsigned int *) bfd_malloc (amt);
    55185585  if (hash_table == NULL && lst_header->hash_size != 0)
    55195586    goto error_return;
    55205587
    5521   som_dict =
    5522     (struct som_entry *) bfd_malloc (lst_header->module_count
    5523                                      * sizeof (struct som_entry));
     5588  /* Read in the hash table.  The has table is an array of 32bit file offsets
     5589     which point to the hash chains.  */
     5590  if (bfd_bread ((PTR) hash_table, amt, abfd) != amt)
     5591    goto error_return;
     5592
     5593  /* Seek to and read in the SOM dictionary.  We will need this to fill
     5594     in the carsym's filepos field.  */
     5595  if (bfd_seek (abfd, lst_filepos + lst_header->dir_loc, SEEK_SET) != 0)
     5596    goto error_return;
     5597
     5598  amt = lst_header->module_count;
     5599  amt *= sizeof (struct som_entry);
     5600  som_dict = (struct som_entry *) bfd_malloc (amt);
    55245601  if (som_dict == NULL && lst_header->module_count != 0)
    55255602    goto error_return;
    55265603
    5527   /* Read in the hash table.  The has table is an array of 32bit file offsets
    5528      which point to the hash chains.  */
    5529   if (bfd_read ((PTR) hash_table, lst_header->hash_size, 4, abfd)
    5530       != lst_header->hash_size * 4)
    5531     goto error_return;
    5532 
    5533   /* Seek to and read in the SOM dictionary.  We will need this to fill
    5534      in the carsym's filepos field.  */
    5535   if (bfd_seek (abfd, lst_filepos + lst_header->dir_loc, SEEK_SET) < 0)
    5536     goto error_return;
    5537 
    5538   if (bfd_read ((PTR) som_dict, lst_header->module_count,
    5539                 sizeof (struct som_entry), abfd)
    5540       != lst_header->module_count * sizeof (struct som_entry))
     5604  if (bfd_bread ((PTR) som_dict, amt, abfd) != amt)
    55415605    goto error_return;
    55425606
     
    55515615
    55525616      /* Seek to and read the first symbol on the chain.  */
    5553       if (bfd_seek (abfd, lst_filepos + hash_table[i], SEEK_SET) < 0)
     5617      if (bfd_seek (abfd, lst_filepos + hash_table[i], SEEK_SET) != 0)
    55545618        goto error_return;
    55555619
    5556       if (bfd_read ((PTR) & lst_symbol, 1, sizeof (lst_symbol), abfd)
    5557           != sizeof (lst_symbol))
     5620      amt = sizeof (lst_symbol);
     5621      if (bfd_bread ((PTR) &lst_symbol, amt, abfd) != amt)
    55585622        goto error_return;
    55595623
     
    55665630         using the string table would not be safe.  */
    55675631      if (bfd_seek (abfd, lst_filepos + lst_header->string_loc
    5568                             + lst_symbol.name.n_strx - 4, SEEK_SET) < 0)
     5632                            + lst_symbol.name.n_strx - 4, SEEK_SET) != 0)
    55695633        goto error_return;
    55705634
    5571       if (bfd_read (&len, 1, 4, abfd) != 4)
     5635      if (bfd_bread (&len, (bfd_size_type) 4, abfd) != 4)
    55725636        goto error_return;
    55735637
    55745638      /* Allocate space for the name and null terminate it too.  */
    5575       set->name = bfd_zalloc (abfd, len + 1);
     5639      set->name = bfd_zalloc (abfd, (bfd_size_type) len + 1);
    55765640      if (!set->name)
    55775641        goto error_return;
    5578       if (bfd_read (set->name, 1, len, abfd) != len)
     5642      if (bfd_bread (set->name, (bfd_size_type) len, abfd) != len)
    55795643        goto error_return;
    55805644
     
    55935657        {
    55945658          /* Seek to the next symbol and read it in.  */
    5595           if (bfd_seek (abfd, lst_filepos + lst_symbol.next_entry, SEEK_SET) <0)
     5659          if (bfd_seek (abfd, lst_filepos + lst_symbol.next_entry, SEEK_SET)
     5660              != 0)
    55965661            goto error_return;
    55975662
    5598           if (bfd_read ((PTR) & lst_symbol, 1, sizeof (lst_symbol), abfd)
    5599               != sizeof (lst_symbol))
     5663          amt = sizeof (lst_symbol);
     5664          if (bfd_bread ((PTR) &lst_symbol, amt, abfd) != amt)
    56005665            goto error_return;
    56015666
    56025667          /* Seek to the name length & string and read them in.  */
    56035668          if (bfd_seek (abfd, lst_filepos + lst_header->string_loc
    5604                                 + lst_symbol.name.n_strx - 4, SEEK_SET) < 0)
     5669                                + lst_symbol.name.n_strx - 4, SEEK_SET) != 0)
    56055670            goto error_return;
    56065671
    5607           if (bfd_read (&len, 1, 4, abfd) != 4)
     5672          if (bfd_bread (&len, (bfd_size_type) 4, abfd) != 4)
    56085673            goto error_return;
    56095674
    56105675          /* Allocate space for the name and null terminate it too.  */
    5611           set->name = bfd_zalloc (abfd, len + 1);
     5676          set->name = bfd_zalloc (abfd, (bfd_size_type) len + 1);
    56125677          if (!set->name)
    56135678            goto error_return;
    56145679
    5615           if (bfd_read (set->name, 1, len, abfd) != len)
     5680          if (bfd_bread (set->name, (bfd_size_type) len, abfd) != len)
    56165681            goto error_return;
    56175682          set->name[len] = 0;
     
    56325697  if (som_dict != NULL)
    56335698    free (som_dict);
    5634   return true;
     5699  return TRUE;
    56355700
    56365701 error_return:
     
    56395704  if (som_dict != NULL)
    56405705    free (som_dict);
    5641   return false;
     5706  return FALSE;
    56425707}
    56435708
    56445709/* Read in the LST from the archive.  */
    56455710
    5646 static boolean
     5711static bfd_boolean
    56475712som_slurp_armap (abfd)
    56485713     bfd *abfd;
     
    56535718  struct artdata *ardata = bfd_ardata (abfd);
    56545719  char nextname[17];
    5655   int i = bfd_read ((PTR) nextname, 1, 16, abfd);
     5720  bfd_size_type amt = 16;
     5721  int i = bfd_bread ((PTR) nextname, amt, abfd);
    56565722
    56575723  /* Special cases.  */
    56585724  if (i == 0)
    5659     return true;
     5725    return TRUE;
    56605726  if (i != 16)
    5661     return false;
    5662 
    5663   if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) < 0)
    5664     return false;
     5727    return FALSE;
     5728
     5729  if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
     5730    return FALSE;
    56655731
    56665732  /* For archives without .o files there is no symbol table.  */
    56675733  if (strncmp (nextname, "/               ", 16))
    56685734    {
    5669       bfd_has_map (abfd) = false;
    5670       return true;
     5735      bfd_has_map (abfd) = FALSE;
     5736      return TRUE;
    56715737    }
    56725738
    56735739  /* Read in and sanity check the archive header.  */
    5674   if (bfd_read ((PTR) &ar_header, 1, sizeof (struct ar_hdr), abfd)
    5675       != sizeof (struct ar_hdr))
    5676     return false;
     5740  amt = sizeof (struct ar_hdr);
     5741  if (bfd_bread ((PTR) &ar_header, amt, abfd) != amt)
     5742    return FALSE;
    56775743
    56785744  if (strncmp (ar_header.ar_fmag, ARFMAG, 2))
    56795745    {
    56805746      bfd_set_error (bfd_error_malformed_archive);
    5681       return false;
     5747      return FALSE;
    56825748    }
    56835749
     
    56885754    {
    56895755      bfd_set_error (bfd_error_malformed_archive);
    5690       return false;
     5756      return FALSE;
    56915757    }
    56925758
     
    56965762  /* Read in the library symbol table.  We'll make heavy use of this
    56975763     in just a minute.  */
    5698   if (bfd_read ((PTR) & lst_header, 1, sizeof (struct lst_header), abfd)
    5699       != sizeof (struct lst_header))
    5700     return false;
     5764  amt = sizeof (struct lst_header);
     5765  if (bfd_bread ((PTR) &lst_header, amt, abfd) != amt)
     5766    return FALSE;
    57015767
    57025768  /* Sanity check.  */
     
    57045770    {
    57055771      bfd_set_error (bfd_error_malformed_archive);
    5706       return false;
     5772      return FALSE;
    57075773    }
    57085774
    57095775  /* Count the number of symbols in the library symbol table.  */
    5710   if (som_bfd_count_ar_symbols (abfd, &lst_header, &ardata->symdef_count)
    5711       == false)
    5712     return false;
     5776  if (! som_bfd_count_ar_symbols (abfd, &lst_header, &ardata->symdef_count))
     5777    return FALSE;
    57135778
    57145779  /* Get back to the start of the library symbol table.  */
    5715   if (bfd_seek (abfd, ardata->first_file_filepos - parsed_size
    5716                         + sizeof (struct lst_header), SEEK_SET) < 0)
    5717     return false;
     5780  if (bfd_seek (abfd, (ardata->first_file_filepos - parsed_size
     5781                       + sizeof (struct lst_header)), SEEK_SET) != 0)
     5782    return FALSE;
    57185783
    57195784  /* Initializae the cache and allocate space for the library symbols.  */
    57205785  ardata->cache = 0;
    5721   ardata->symdefs = (carsym *) bfd_alloc (abfd,
    5722                                           (ardata->symdef_count
    5723                                            * sizeof (carsym)));
     5786  amt = ardata->symdef_count;
     5787  amt *= sizeof (carsym);
     5788  ardata->symdefs = (carsym *) bfd_alloc (abfd, amt);
    57245789  if (!ardata->symdefs)
    5725     return false;
     5790    return FALSE;
    57265791
    57275792  /* Now fill in the canonical archive symbols.  */
    5728   if (som_bfd_fill_in_ar_symbols (abfd, &lst_header, &ardata->symdefs)
    5729       == false)
    5730     return false;
     5793  if (! som_bfd_fill_in_ar_symbols (abfd, &lst_header, &ardata->symdefs))
     5794    return FALSE;
    57315795
    57325796  /* Seek back to the "first" file in the archive.  Note the "first"
    57335797     file may be the extended name table.  */
    5734   if (bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET) < 0)
    5735     return false;
     5798  if (bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET) != 0)
     5799    return FALSE;
    57365800
    57375801  /* Notify the generic archive code that we have a symbol map.  */
    5738   bfd_has_map (abfd) = true;
    5739   return true;
     5802  bfd_has_map (abfd) = TRUE;
     5803  return TRUE;
    57405804}
    57415805
     
    57455809   and the size of the associated string section.  */
    57465810
    5747 static boolean
     5811static bfd_boolean
    57485812som_bfd_prep_for_ar_write (abfd, num_syms, stringsize)
    57495813     bfd *abfd;
     
    57735837         to it.  It's a little slimey to grab the symbols via obj_som_symtab,
    57745838         but doing so avoids allocating lots of extra memory.  */
    5775       if (som_slurp_symbol_table (curr_bfd) == false)
    5776         return false;
     5839      if (! som_slurp_symbol_table (curr_bfd))
     5840        return FALSE;
    57775841
    57785842      sym = obj_som_symtab (curr_bfd);
     
    58135877      curr_bfd = curr_bfd->next;
    58145878    }
    5815   return true;
     5879  return TRUE;
    58165880}
    58175881
     
    58365900   symbol table.  */
    58375901
    5838 static boolean
     5902static bfd_boolean
    58395903som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength)
    58405904     bfd *abfd;
     
    58515915  struct lst_symbol_record **last_hash_entry = NULL;
    58525916  unsigned int curr_som_offset, som_index = 0;
    5853 
    5854   hash_table =
    5855     (unsigned int *) bfd_malloc (lst.hash_size * sizeof (unsigned int));
     5917  bfd_size_type amt;
     5918
     5919  amt = lst.hash_size;
     5920  amt *= sizeof (unsigned int);
     5921  hash_table = (unsigned int *) bfd_zmalloc (amt);
    58565922  if (hash_table == NULL && lst.hash_size != 0)
    58575923    goto error_return;
    5858   som_dict =
    5859     (struct som_entry *) bfd_malloc (lst.module_count
    5860                                      * sizeof (struct som_entry));
     5924
     5925  amt = lst.module_count;
     5926  amt *= sizeof (struct som_entry);
     5927  som_dict = (struct som_entry *) bfd_zmalloc (amt);
    58615928  if (som_dict == NULL && lst.module_count != 0)
    58625929    goto error_return;
    58635930
    5864   last_hash_entry =
    5865     ((struct lst_symbol_record **)
    5866      bfd_malloc (lst.hash_size * sizeof (struct lst_symbol_record *)));
     5931  amt = lst.hash_size;
     5932  amt *= sizeof (struct lst_symbol_record *);
     5933  last_hash_entry = ((struct lst_symbol_record **) bfd_zmalloc (amt));
    58675934  if (last_hash_entry == NULL && lst.hash_size != 0)
    58685935    goto error_return;
     
    58715938     of the lst record.  So save its location.  */
    58725939  lst_filepos = bfd_tell (abfd) - sizeof (struct lst_header);
    5873 
    5874   /* Some initialization.  */
    5875   memset (hash_table, 0, 4 * lst.hash_size);
    5876   memset (som_dict, 0, lst.module_count * sizeof (struct som_entry));
    5877   memset (last_hash_entry, 0,
    5878           lst.hash_size * sizeof (struct lst_symbol_record *));
    58795940
    58805941  /* Symbols have som_index fields, so we have to keep track of the
     
    59025963
    59035964  /* FIXME should be done with buffers just like everything else...  */
    5904   lst_syms = bfd_malloc (nsyms * sizeof (struct lst_symbol_record));
     5965  amt = nsyms;
     5966  amt *= sizeof (struct lst_symbol_record);
     5967  lst_syms = bfd_malloc (amt);
    59055968  if (lst_syms == NULL && nsyms != 0)
    59065969    goto error_return;
    5907   strings = bfd_malloc (string_size);
     5970  strings = bfd_malloc ((bfd_size_type) string_size);
    59085971  if (strings == NULL && string_size != 0)
    59095972    goto error_return;
     
    59295992         to it.  It's a little slimey to grab the symbols via obj_som_symtab,
    59305993         but doing so avoids allocating lots of extra memory.  */
    5931       if (som_slurp_symbol_table (curr_bfd) == false)
     5994      if (! som_slurp_symbol_table (curr_bfd))
    59325995        goto error_return;
    59335996
     
    60396102         linker requires objects begin on an even boundary.  So round
    60406103         up the current offset as necessary.  */
    6041       curr_som_offset = (curr_som_offset + 0x1) & ~0x1;
     6104      curr_som_offset = (curr_som_offset + 0x1) &~ (unsigned) 1;
    60426105      curr_bfd = curr_bfd->next;
    60436106      som_index++;
     
    60456108
    60466109  /* Now scribble out the hash table.  */
    6047   if (bfd_write ((PTR) hash_table, lst.hash_size, 4, abfd)
    6048       != lst.hash_size * 4)
     6110  amt = lst.hash_size * 4;
     6111  if (bfd_bwrite ((PTR) hash_table, amt, abfd) != amt)
    60496112    goto error_return;
    60506113
    60516114  /* Then the SOM dictionary.  */
    6052   if (bfd_write ((PTR) som_dict, lst.module_count,
    6053                  sizeof (struct som_entry), abfd)
    6054       != lst.module_count * sizeof (struct som_entry))
     6115  amt = lst.module_count * sizeof (struct som_entry);
     6116  if (bfd_bwrite ((PTR) som_dict, amt, abfd) != amt)
    60556117    goto error_return;
    60566118
    60576119  /* The library symbols.  */
    6058   if (bfd_write ((PTR) lst_syms, nsyms, sizeof (struct lst_symbol_record), abfd)
    6059       != nsyms * sizeof (struct lst_symbol_record))
     6120  amt = nsyms * sizeof (struct lst_symbol_record);
     6121  if (bfd_bwrite ((PTR) lst_syms, amt, abfd) != amt)
    60606122    goto error_return;
    60616123
    60626124  /* And finally the strings.  */
    6063   if (bfd_write ((PTR) strings, string_size, 1, abfd) != string_size)
     6125  amt = string_size;
     6126  if (bfd_bwrite ((PTR) strings, amt, abfd) != amt)
    60646127    goto error_return;
    60656128
     
    60746137  if (strings != NULL)
    60756138    free (strings);
    6076   return true;
     6139  return TRUE;
    60776140
    60786141 error_return:
     
    60886151    free (strings);
    60896152
    6090   return false;
     6153  return FALSE;
    60916154}
    60926155
     
    60956158   You'll never believe this is really how armaps are handled in SOM...  */
    60966159
    6097 static boolean
     6160static bfd_boolean
    60986161som_write_armap (abfd, elength, map, orl_count, stridx)
    60996162     bfd *abfd;
     
    61096172  struct lst_header lst;
    61106173  int *p;
     6174  bfd_size_type amt;
    61116175
    61126176  /* We'll use this for the archive's date and mode later.  */
     
    61146178    {
    61156179      bfd_set_error (bfd_error_system_call);
    6116       return false;
     6180      return FALSE;
    61176181    }
    61186182  /* Fudge factor.  */
     
    61646228  /* Count how many symbols we will have on the hash chains and the
    61656229     size of the associated string table.  */
    6166   if (som_bfd_prep_for_ar_write (abfd, &nsyms, &stringsize) == false)
    6167     return false;
     6230  if (! som_bfd_prep_for_ar_write (abfd, &nsyms, &stringsize))
     6231    return FALSE;
    61686232
    61696233  lst_size += sizeof (struct lst_symbol_record) * nsyms;
     
    62016265
    62026266  /* Scribble out the ar header.  */
    6203   if (bfd_write ((PTR) &hdr, 1, sizeof (struct ar_hdr), abfd)
    6204       != sizeof (struct ar_hdr))
    6205     return false;
     6267  amt = sizeof (struct ar_hdr);
     6268  if (bfd_bwrite ((PTR) &hdr, amt, abfd) != amt)
     6269    return FALSE;
    62066270
    62076271  /* Now scribble out the lst header.  */
    6208   if (bfd_write ((PTR) &lst, 1, sizeof (struct lst_header), abfd)
    6209       != sizeof (struct lst_header))
    6210     return false;
     6272  amt = sizeof (struct lst_header);
     6273  if (bfd_bwrite ((PTR) &lst, amt, abfd) != amt)
     6274    return FALSE;
    62116275
    62126276  /* Build and write the armap.  */
    6213   if (som_bfd_ar_write_symbol_stuff (abfd, nsyms, stringsize, lst, elength)
    6214       == false)
    6215     return false;
     6277  if (!som_bfd_ar_write_symbol_stuff (abfd, nsyms, stringsize, lst, elength))
     6278    return FALSE;
    62166279
    62176280  /* Done.  */
    6218   return true;
     6281  return TRUE;
    62196282}
    62206283
     
    62226285   read it again later if we need it.  */
    62236286
    6224 static boolean
     6287static bfd_boolean
    62256288som_bfd_free_cached_info (abfd)
    62266289     bfd *abfd;
     
    62296292
    62306293  if (bfd_get_format (abfd) != bfd_object)
    6231     return true;
     6294    return TRUE;
    62326295
    62336296#define FREE(x) if (x != NULL) { free (x); x = NULL; }
     
    62386301    {
    62396302      /* Free the native relocations.  */
    6240       o->reloc_count = -1;
     6303      o->reloc_count = (unsigned) -1;
    62416304      FREE (som_section_data (o)->reloc_stream);
    62426305      /* Free the generic relocations.  */
     
    62456308#undef FREE
    62466309
    6247   return true;
     6310  return TRUE;
    62486311}
    62496312
     
    62526315/* Linker support functions.  */
    62536316
    6254 static boolean
     6317static bfd_boolean
    62556318som_bfd_link_split_section (abfd, sec)
    62566319     bfd *abfd ATTRIBUTE_UNUSED;
     
    62736336#define som_bfd_print_private_bfd_data  _bfd_generic_bfd_print_private_bfd_data
    62746337
    6275 #define som_get_lineno                  _bfd_nosymbols_get_lineno
     6338#define som_get_lineno                  _bfd_nosymbols_get_lineno
    62766339#define som_bfd_make_debug_symbol       _bfd_nosymbols_bfd_make_debug_symbol
    62776340#define som_read_minisymbols            _bfd_generic_read_minisymbols
     
    62846347#define som_bfd_relax_section bfd_generic_relax_section
    62856348#define som_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
     6349#define som_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
    62866350#define som_bfd_link_add_symbols _bfd_generic_link_add_symbols
     6351#define som_bfd_link_just_syms _bfd_generic_link_just_syms
    62876352#define som_bfd_final_link _bfd_generic_final_link
    62886353
    62896354#define som_bfd_gc_sections             bfd_generic_gc_sections
     6355#define som_bfd_merge_sections          bfd_generic_merge_sections
     6356#define som_bfd_discard_group           bfd_generic_discard_group
    62906357
    62916358const bfd_target som_vec = {
     
    63016368
    63026369/* leading_symbol_char: is the first char of a user symbol
    6303    predictable, and if so what is it */
     6370   predictable, and if so what is it. */
    63046371  0,
    63056372  '/',                          /* ar_pad_char */
Note: See TracChangeset for help on using the changeset viewer.