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/coff-sh.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    1 /* BFD back-end for Hitachi Super-H COFF binaries.
    2    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
     1/* BFD back-end for Renesas Super-H COFF binaries.
     2   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    33   Free Software Foundation, Inc.
    44   Contributed by Cygnus Support.
     
    66   Relaxing code written by Ian Lance Taylor, <ian@cygnus.com>.
    77
    8 This file is part of BFD, the Binary File Descriptor library.
    9 
    10 This program is free software; you can redistribute it and/or modify
    11 it under the terms of the GNU General Public License as published by
    12 the Free Software Foundation; either version 2 of the License, or
    13 (at your option) any later version.
    14 
    15 This program is distributed in the hope that it will be useful,
    16 but WITHOUT ANY WARRANTY; without even the implied warranty of
    17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    18 GNU General Public License for more details.
    19 
    20 You should have received a copy of the GNU General Public License
    21 along with this program; if not, write to the Free Software
    22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     8   This file is part of BFD, the Binary File Descriptor library.
     9
     10   This program is free software; you can redistribute it and/or modify
     11   it under the terms of the GNU General Public License as published by
     12   the Free Software Foundation; either version 2 of the License, or
     13   (at your option) any later version.
     14
     15   This program is distributed in the hope that it will be useful,
     16   but WITHOUT ANY WARRANTY; without even the implied warranty of
     17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18   GNU General Public License for more details.
     19
     20   You should have received a copy of the GNU General Public License
     21   along with this program; if not, write to the Free Software
     22   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    2323
    2424#include "bfd.h"
    2525#include "sysdep.h"
     26#include "libiberty.h"
    2627#include "libbfd.h"
    2728#include "bfdlink.h"
     
    3334
    3435#ifndef COFF_IMAGE_WITH_PE
    35 static boolean sh_align_load_span
     36static bfd_boolean sh_align_load_span
    3637  PARAMS ((bfd *, asection *, bfd_byte *,
    37            boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma),
    38            PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *));
     38           bfd_boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma),
     39           PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *));
    3940
    4041#define _bfd_sh_align_load_span sh_align_load_span
     
    4849  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
    4950static long get_symbol_value PARAMS ((asymbol *));
    50 static boolean sh_relax_section
    51   PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
    52 static boolean sh_relax_delete_bytes
     51static bfd_boolean sh_relax_section
     52  PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
     53static bfd_boolean sh_relax_delete_bytes
    5354  PARAMS ((bfd *, asection *, bfd_vma, int));
    5455#ifndef COFF_IMAGE_WITH_PE
    5556static const struct sh_opcode *sh_insn_info PARAMS ((unsigned int));
    5657#endif
    57 static boolean sh_align_loads
    58   PARAMS ((bfd *, asection *, struct internal_reloc *, bfd_byte *, boolean *));
    59 static boolean sh_swap_insns
     58static bfd_boolean sh_align_loads
     59  PARAMS ((bfd *, asection *, struct internal_reloc *, bfd_byte *,
     60           bfd_boolean *));
     61static bfd_boolean sh_swap_insns
    6062  PARAMS ((bfd *, asection *, PTR, bfd_byte *, bfd_vma));
    61 static boolean sh_relocate_section
     63static bfd_boolean sh_relocate_section
    6264  PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
    6365           struct internal_reloc *, struct internal_syment *, asection **));
    6466static bfd_byte *sh_coff_get_relocated_section_contents
    6567  PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
    66            bfd_byte *, boolean, asymbol **));
     68           bfd_byte *, bfd_boolean, asymbol **));
     69static reloc_howto_type * sh_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
    6770
    6871#ifdef COFF_WITH_PE
     
    8386
    8487#ifdef COFF_WITH_PE
    85 /* Return true if this relocation should
     88static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *));
     89/* Return TRUE if this relocation should
    8690   appear in the output .reloc section.  */
    87 static boolean in_reloc_p (abfd, howto)
     91static bfd_boolean in_reloc_p (abfd, howto)
    8892     bfd * abfd ATTRIBUTE_UNUSED;
    8993     reloc_howto_type * howto;
     
    105109         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    106110         32,                    /* bitsize */
    107          false,                 /* pc_relative */
     111         FALSE,                 /* pc_relative */
    108112         0,                     /* bitpos */
    109113         complain_overflow_bitfield, /* complain_on_overflow */
    110114         sh_reloc,              /* special_function */
    111115         "r_imm32ce",           /* name */
    112          true,                  /* partial_inplace */
     116         TRUE,                  /* partial_inplace */
    113117         0xffffffff,            /* src_mask */
    114118         0xffffffff,            /* dst_mask */
    115          false),                /* pcrel_offset */
     119         FALSE),                /* pcrel_offset */
    116120#else
    117121  EMPTY_HOWTO (2),
     
    129133         1,                     /* size (0 = byte, 1 = short, 2 = long) */
    130134         8,                     /* bitsize */
    131          true,                  /* pc_relative */
     135         TRUE,                  /* pc_relative */
    132136         0,                     /* bitpos */
    133137         complain_overflow_signed, /* complain_on_overflow */
    134138         sh_reloc,              /* special_function */
    135139         "r_pcdisp8by2",        /* name */
    136          true,                  /* partial_inplace */
     140         TRUE,                  /* partial_inplace */
    137141         0xff,                  /* src_mask */
    138142         0xff,                  /* dst_mask */
    139          true),                 /* pcrel_offset */
     143         TRUE),                 /* pcrel_offset */
    140144
    141145  EMPTY_HOWTO (11), /* R_SH_PCDISP8 */
     
    145149         1,                     /* size (0 = byte, 1 = short, 2 = long) */
    146150         12,                    /* bitsize */
    147          true,                  /* pc_relative */
     151         TRUE,                  /* pc_relative */
    148152         0,                     /* bitpos */
    149153         complain_overflow_signed, /* complain_on_overflow */
    150154         sh_reloc,              /* special_function */
    151155         "r_pcdisp12by2",       /* name */
    152          true,                  /* partial_inplace */
     156         TRUE,                  /* partial_inplace */
    153157         0xfff,                 /* src_mask */
    154158         0xfff,                 /* dst_mask */
    155          true),                 /* pcrel_offset */
     159         TRUE),                 /* pcrel_offset */
    156160
    157161  EMPTY_HOWTO (13),
     
    161165         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    162166         32,                    /* bitsize */
    163          false,                 /* pc_relative */
     167         FALSE,                 /* pc_relative */
    164168         0,                     /* bitpos */
    165169         complain_overflow_bitfield, /* complain_on_overflow */
    166170         sh_reloc,              /* special_function */
    167171         "r_imm32",             /* name */
    168          true,                  /* partial_inplace */
     172         TRUE,                  /* partial_inplace */
    169173         0xffffffff,            /* src_mask */
    170174         0xffffffff,            /* dst_mask */
    171          false),                /* pcrel_offset */
     175         FALSE),                /* pcrel_offset */
    172176
    173177  EMPTY_HOWTO (15),
     
    177181         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    178182         32,                    /* bitsize */
    179          false,                 /* pc_relative */
     183         FALSE,                 /* pc_relative */
    180184         0,                     /* bitpos */
    181185         complain_overflow_bitfield, /* complain_on_overflow */
    182186         sh_reloc,              /* special_function */
    183187         "rva32",               /* name */
    184          true,                  /* partial_inplace */
     188         TRUE,                  /* partial_inplace */
    185189         0xffffffff,            /* src_mask */
    186190         0xffffffff,            /* dst_mask */
    187          false),                /* pcrel_offset */
     191         FALSE),                /* pcrel_offset */
    188192#else
    189193  EMPTY_HOWTO (16), /* R_SH_IMM8 */
     
    199203         1,                     /* size (0 = byte, 1 = short, 2 = long) */
    200204         8,                     /* bitsize */
    201          true,                  /* pc_relative */
     205         TRUE,                  /* pc_relative */
    202206         0,                     /* bitpos */
    203207         complain_overflow_unsigned, /* complain_on_overflow */
    204208         sh_reloc,              /* special_function */
    205209         "r_pcrelimm8by2",      /* name */
    206          true,                  /* partial_inplace */
     210         TRUE,                  /* partial_inplace */
    207211         0xff,                  /* src_mask */
    208212         0xff,                  /* dst_mask */
    209          true),                 /* pcrel_offset */
     213         TRUE),                 /* pcrel_offset */
    210214
    211215  HOWTO (R_SH_PCRELIMM8BY4,     /* type */
     
    213217         1,                     /* size (0 = byte, 1 = short, 2 = long) */
    214218         8,                     /* bitsize */
    215          true,                  /* pc_relative */
     219         TRUE,                  /* pc_relative */
    216220         0,                     /* bitpos */
    217221         complain_overflow_unsigned, /* complain_on_overflow */
    218222         sh_reloc,              /* special_function */
    219223         "r_pcrelimm8by4",      /* name */
    220          true,                  /* partial_inplace */
     224         TRUE,                  /* partial_inplace */
    221225         0xff,                  /* src_mask */
    222226         0xff,                  /* dst_mask */
    223          true),                 /* pcrel_offset */
     227         TRUE),                 /* pcrel_offset */
    224228
    225229  HOWTO (R_SH_IMM16,            /* type */
     
    227231         1,                     /* size (0 = byte, 1 = short, 2 = long) */
    228232         16,                    /* bitsize */
    229          false,                 /* pc_relative */
     233         FALSE,                 /* pc_relative */
    230234         0,                     /* bitpos */
    231235         complain_overflow_bitfield, /* complain_on_overflow */
    232236         sh_reloc,              /* special_function */
    233237         "r_imm16",             /* name */
    234          true,                  /* partial_inplace */
     238         TRUE,                  /* partial_inplace */
    235239         0xffff,                /* src_mask */
    236240         0xffff,                /* dst_mask */
    237          false),                /* pcrel_offset */
     241         FALSE),                /* pcrel_offset */
    238242
    239243  HOWTO (R_SH_SWITCH16,         /* type */
     
    241245         1,                     /* size (0 = byte, 1 = short, 2 = long) */
    242246         16,                    /* bitsize */
    243          false,                 /* pc_relative */
     247         FALSE,                 /* pc_relative */
    244248         0,                     /* bitpos */
    245249         complain_overflow_bitfield, /* complain_on_overflow */
    246250         sh_reloc,              /* special_function */
    247251         "r_switch16",          /* name */
    248          true,                  /* partial_inplace */
     252         TRUE,                  /* partial_inplace */
    249253         0xffff,                /* src_mask */
    250254         0xffff,                /* dst_mask */
    251          false),                /* pcrel_offset */
     255         FALSE),                /* pcrel_offset */
    252256
    253257  HOWTO (R_SH_SWITCH32,         /* type */
     
    255259         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    256260         32,                    /* bitsize */
    257          false,                 /* pc_relative */
     261         FALSE,                 /* pc_relative */
    258262         0,                     /* bitpos */
    259263         complain_overflow_bitfield, /* complain_on_overflow */
    260264         sh_reloc,              /* special_function */
    261265         "r_switch32",          /* name */
    262          true,                  /* partial_inplace */
     266         TRUE,                  /* partial_inplace */
    263267         0xffffffff,            /* src_mask */
    264268         0xffffffff,            /* dst_mask */
    265          false),                /* pcrel_offset */
     269         FALSE),                /* pcrel_offset */
    266270
    267271  HOWTO (R_SH_USES,             /* type */
     
    269273         1,                     /* size (0 = byte, 1 = short, 2 = long) */
    270274         16,                    /* bitsize */
    271          false,                 /* pc_relative */
     275         FALSE,                 /* pc_relative */
    272276         0,                     /* bitpos */
    273277         complain_overflow_bitfield, /* complain_on_overflow */
    274278         sh_reloc,              /* special_function */
    275279         "r_uses",              /* name */
    276          true,                  /* partial_inplace */
     280         TRUE,                  /* partial_inplace */
    277281         0xffff,                /* src_mask */
    278282         0xffff,                /* dst_mask */
    279          false),                /* pcrel_offset */
     283         FALSE),                /* pcrel_offset */
    280284
    281285  HOWTO (R_SH_COUNT,            /* type */
     
    283287         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    284288         32,                    /* bitsize */
    285          false,                 /* pc_relative */
     289         FALSE,                 /* pc_relative */
    286290         0,                     /* bitpos */
    287291         complain_overflow_bitfield, /* complain_on_overflow */
    288292         sh_reloc,              /* special_function */
    289293         "r_count",             /* name */
    290          true,                  /* partial_inplace */
     294         TRUE,                  /* partial_inplace */
    291295         0xffffffff,            /* src_mask */
    292296         0xffffffff,            /* dst_mask */
    293          false),                /* pcrel_offset */
     297         FALSE),                /* pcrel_offset */
    294298
    295299  HOWTO (R_SH_ALIGN,            /* type */
     
    297301         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    298302         32,                    /* bitsize */
    299          false,                 /* pc_relative */
     303         FALSE,                 /* pc_relative */
    300304         0,                     /* bitpos */
    301305         complain_overflow_bitfield, /* complain_on_overflow */
    302306         sh_reloc,              /* special_function */
    303307         "r_align",             /* name */
    304          true,                  /* partial_inplace */
     308         TRUE,                  /* partial_inplace */
    305309         0xffffffff,            /* src_mask */
    306310         0xffffffff,            /* dst_mask */
    307          false),                /* pcrel_offset */
     311         FALSE),                /* pcrel_offset */
    308312
    309313  HOWTO (R_SH_CODE,             /* type */
     
    311315         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    312316         32,                    /* bitsize */
    313          false,                 /* pc_relative */
     317         FALSE,                 /* pc_relative */
    314318         0,                     /* bitpos */
    315319         complain_overflow_bitfield, /* complain_on_overflow */
    316320         sh_reloc,              /* special_function */
    317321         "r_code",              /* name */
    318          true,                  /* partial_inplace */
     322         TRUE,                  /* partial_inplace */
    319323         0xffffffff,            /* src_mask */
    320324         0xffffffff,            /* dst_mask */
    321          false),                /* pcrel_offset */
     325         FALSE),                /* pcrel_offset */
    322326
    323327  HOWTO (R_SH_DATA,             /* type */
     
    325329         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    326330         32,                    /* bitsize */
    327          false,                 /* pc_relative */
     331         FALSE,                 /* pc_relative */
    328332         0,                     /* bitpos */
    329333         complain_overflow_bitfield, /* complain_on_overflow */
    330334         sh_reloc,              /* special_function */
    331335         "r_data",              /* name */
    332          true,                  /* partial_inplace */
     336         TRUE,                  /* partial_inplace */
    333337         0xffffffff,            /* src_mask */
    334338         0xffffffff,            /* dst_mask */
    335          false),                /* pcrel_offset */
     339         FALSE),                /* pcrel_offset */
    336340
    337341  HOWTO (R_SH_LABEL,            /* type */
     
    339343         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    340344         32,                    /* bitsize */
    341          false,                 /* pc_relative */
     345         FALSE,                 /* pc_relative */
    342346         0,                     /* bitpos */
    343347         complain_overflow_bitfield, /* complain_on_overflow */
    344348         sh_reloc,              /* special_function */
    345349         "r_label",             /* name */
    346          true,                  /* partial_inplace */
     350         TRUE,                  /* partial_inplace */
    347351         0xffffffff,            /* src_mask */
    348352         0xffffffff,            /* dst_mask */
    349          false),                /* pcrel_offset */
     353         FALSE),                /* pcrel_offset */
    350354
    351355  HOWTO (R_SH_SWITCH8,          /* type */
     
    353357         0,                     /* size (0 = byte, 1 = short, 2 = long) */
    354358         8,                     /* bitsize */
    355          false,                 /* pc_relative */
     359         FALSE,                 /* pc_relative */
    356360         0,                     /* bitpos */
    357361         complain_overflow_bitfield, /* complain_on_overflow */
    358362         sh_reloc,              /* special_function */
    359363         "r_switch8",           /* name */
    360          true,                  /* partial_inplace */
     364         TRUE,                  /* partial_inplace */
    361365         0xff,                  /* src_mask */
    362366         0xff,                  /* dst_mask */
    363          false)                 /* pcrel_offset */
     367         FALSE)                 /* pcrel_offset */
    364368};
    365369
     
    377381#ifndef COFF_WITH_PE
    378382/* Swap the r_offset field in and out.  */
    379 #define SWAP_IN_RELOC_OFFSET  bfd_h_get_32
    380 #define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
     383#define SWAP_IN_RELOC_OFFSET  H_GET_32
     384#define SWAP_OUT_RELOC_OFFSET H_PUT_32
    381385
    382386/* Swap out extra information in the reloc structure.  */
     
    412416   Copied from coff-i386.  */
    413417#define coff_rtype_to_howto coff_sh_rtype_to_howto
     418static reloc_howto_type * coff_sh_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *));
    414419
    415420static reloc_howto_type *
     
    461466}
    462467
     468#endif /* COFF_WITH_PE */
     469
    463470/* This structure is used to map BFD reloc codes to SH PE relocs.  */
    464471struct shcoff_reloc_map
    465472{
    466   unsigned char bfd_reloc_val;
     473  bfd_reloc_code_real_type bfd_reloc_val;
    467474  unsigned char shcoff_reloc_val;
    468475};
    469476
     477#ifdef COFF_WITH_PE
    470478/* An array mapping BFD reloc codes to SH PE relocs.  */
    471479static const struct shcoff_reloc_map sh_reloc_map[] =
     
    475483  { BFD_RELOC_CTOR, R_SH_IMM32CE },
    476484};
     485#else
     486/* An array mapping BFD reloc codes to SH PE relocs.  */
     487static const struct shcoff_reloc_map sh_reloc_map[] =
     488{
     489  { BFD_RELOC_32, R_SH_IMM32 },
     490  { BFD_RELOC_CTOR, R_SH_IMM32 },
     491};
     492#endif
    477493
    478494/* Given a BFD reloc code, return the howto structure for the
     
    487503  unsigned int i;
    488504
    489   for (i = 0; i < sizeof (sh_reloc_map) / sizeof (struct shcoff_reloc_map); i++)
    490     {
    491       if (sh_reloc_map[i].bfd_reloc_val == code)
    492         return &sh_coff_howtos[(int) sh_reloc_map[i].shcoff_reloc_val];
    493     }
     505  for (i = ARRAY_SIZE (sh_reloc_map); i--;)
     506    if (sh_reloc_map[i].bfd_reloc_val == code)
     507      return &sh_coff_howtos[(int) sh_reloc_map[i].shcoff_reloc_val];
    494508
    495509  fprintf (stderr, "SH Error: unknown reloc type %d\n", code);
    496510  return NULL;
    497511}
    498 #endif /* COFF_WITH_PE */
    499512
    500513/* This macro is used in coffcode.h to get the howto corresponding to
     
    587600      insn = bfd_get_32 (abfd, hit_data);
    588601      insn += sym_value + reloc_entry->addend;
    589       bfd_put_32 (abfd, insn, hit_data);
     602      bfd_put_32 (abfd, (bfd_vma) insn, hit_data);
    590603      break;
    591604#ifdef COFF_WITH_PE
    592605    case R_SH_IMAGEBASE:
    593606      insn = bfd_get_32 (abfd, hit_data);
    594       insn += (sym_value + reloc_entry->addend
    595                - pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase);
    596       bfd_put_32 (abfd, insn, hit_data);
     607      insn += sym_value + reloc_entry->addend;
     608      insn -= pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase;
     609      bfd_put_32 (abfd, (bfd_vma) insn, hit_data);
    597610      break;
    598611#endif
     
    608621        sym_value -= 0x1000;
    609622      insn = (insn & 0xf000) | (sym_value & 0xfff);
    610       bfd_put_16 (abfd, insn, hit_data);
     623      bfd_put_16 (abfd, (bfd_vma) insn, hit_data);
    611624      if (sym_value < (bfd_vma) -0x1000 || sym_value >= 0x1000)
    612625        return bfd_reloc_overflow;
     
    679692   can, by swapping them with one of the adjacent instructions.  */
    680693
    681 static boolean
     694static bfd_boolean
    682695sh_relax_section (abfd, sec, link_info, again)
    683696     bfd *abfd;
    684697     asection *sec;
    685698     struct bfd_link_info *link_info;
    686      boolean *again;
     699     bfd_boolean *again;
    687700{
    688701  struct internal_reloc *internal_relocs;
    689702  struct internal_reloc *free_relocs = NULL;
    690   boolean have_code;
     703  bfd_boolean have_code;
    691704  struct internal_reloc *irel, *irelend;
    692705  bfd_byte *contents = NULL;
    693706  bfd_byte *free_contents = NULL;
    694707
    695   *again = false;
     708  *again = FALSE;
    696709
    697710  if (link_info->relocateable
    698711      || (sec->flags & SEC_RELOC) == 0
    699712      || sec->reloc_count == 0)
    700     return true;
     713    return TRUE;
    701714
    702715  /* If this is the first time we have been called for this section,
     
    707720  internal_relocs = (_bfd_coff_read_internal_relocs
    708721                     (abfd, sec, link_info->keep_memory,
    709                       (bfd_byte *) NULL, false,
     722                      (bfd_byte *) NULL, FALSE,
    710723                      (struct internal_reloc *) NULL));
    711724  if (internal_relocs == NULL)
     
    714727    free_relocs = internal_relocs;
    715728
    716   have_code = false;
     729  have_code = FALSE;
    717730
    718731  irelend = internal_relocs + sec->reloc_count;
     
    726739
    727740      if (irel->r_type == R_SH_CODE)
    728         have_code = true;
     741        have_code = TRUE;
    729742
    730743      if (irel->r_type != R_SH_USES)
     
    760773        {
    761774          (*_bfd_error_handler) ("%s: 0x%lx: warning: bad R_SH_USES offset",
    762                                  bfd_get_filename (abfd),
     775                                 bfd_archive_filename (abfd),
    763776                                 (unsigned long) irel->r_vaddr);
    764777          continue;
     
    771784          ((*_bfd_error_handler)
    772785           ("%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x",
    773             bfd_get_filename (abfd), (unsigned long) irel->r_vaddr, insn));
     786            bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr, insn));
    774787          continue;
    775788        }
     
    783796      paddr = insn & 0xff;
    784797      paddr *= 4;
    785       paddr += (laddr + 4) &~ 3;
     798      paddr += (laddr + 4) &~ (bfd_vma) 3;
    786799      if (paddr >= sec->_raw_size)
    787800        {
    788801          ((*_bfd_error_handler)
    789802           ("%s: 0x%lx: warning: bad R_SH_USES load offset",
    790             bfd_get_filename (abfd), (unsigned long) irel->r_vaddr));
     803            bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr));
    791804          continue;
    792805        }
     
    811824          ((*_bfd_error_handler)
    812825           ("%s: 0x%lx: warning: could not find expected reloc",
    813             bfd_get_filename (abfd), (unsigned long) paddr));
     826            bfd_archive_filename (abfd), (unsigned long) paddr));
    814827          continue;
    815828        }
     
    827840          ((*_bfd_error_handler)
    828841           ("%s: 0x%lx: warning: symbol in unexpected section",
    829             bfd_get_filename (abfd), (unsigned long) paddr));
     842            bfd_archive_filename (abfd), (unsigned long) paddr));
    830843          continue;
    831844        }
     
    885898      if (coff_section_data (abfd, sec) == NULL)
    886899        {
    887           sec->used_by_bfd =
    888             ((PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata)));
     900          bfd_size_type amt = sizeof (struct coff_section_tdata);
     901          sec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
    889902          if (sec->used_by_bfd == NULL)
    890903            goto error_return;
     
    892905
    893906      coff_section_data (abfd, sec)->relocs = internal_relocs;
    894       coff_section_data (abfd, sec)->keep_relocs = true;
     907      coff_section_data (abfd, sec)->keep_relocs = TRUE;
    895908      free_relocs = NULL;
    896909
    897910      coff_section_data (abfd, sec)->contents = contents;
    898       coff_section_data (abfd, sec)->keep_contents = true;
     911      coff_section_data (abfd, sec)->keep_contents = TRUE;
    899912      free_contents = NULL;
    900913
    901       obj_coff_keep_syms (abfd) = true;
     914      obj_coff_keep_syms (abfd) = TRUE;
    902915
    903916      /* Replace the jsr with a bsr.  */
     
    913926             relocs.  */
    914927          bfd_put_16 (abfd,
    915                       0xb000 | ((foff >> 1) & 0xfff),
     928                      (bfd_vma) 0xb000 | ((foff >> 1) & 0xfff),
    916929                      contents + irel->r_vaddr - sec->vma);
    917930        }
     
    921934             symbol value may be changed by future relaxing.  We let
    922935             the final link phase handle it.  */
    923           bfd_put_16 (abfd, 0xb000, contents + irel->r_vaddr - sec->vma);
     936          bfd_put_16 (abfd, (bfd_vma) 0xb000,
     937                      contents + irel->r_vaddr - sec->vma);
    924938        }
    925939
     
    954968         other function call to come within range, we should relax
    955969         again.  Note that this is not required, and it may be slow.  */
    956       *again = true;
     970      *again = TRUE;
    957971
    958972      /* Now check whether we got a COUNT reloc.  */
     
    961975          ((*_bfd_error_handler)
    962976           ("%s: 0x%lx: warning: could not find expected COUNT reloc",
    963             bfd_get_filename (abfd), (unsigned long) paddr));
     977            bfd_archive_filename (abfd), (unsigned long) paddr));
    964978          continue;
    965979        }
     
    970984        {
    971985          ((*_bfd_error_handler) ("%s: 0x%lx: warning: bad count",
    972                                   bfd_get_filename (abfd),
     986                                  bfd_archive_filename (abfd),
    973987                                  (unsigned long) paddr));
    974988          continue;
     
    9941008  if (have_code)
    9951009    {
    996       boolean swapped;
     1010      bfd_boolean swapped;
    9971011
    9981012      /* Get the section contents.  */
     
    10221036          if (coff_section_data (abfd, sec) == NULL)
    10231037            {
    1024               sec->used_by_bfd =
    1025                 ((PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata)));
     1038              bfd_size_type amt = sizeof (struct coff_section_tdata);
     1039              sec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
    10261040              if (sec->used_by_bfd == NULL)
    10271041                goto error_return;
     
    10291043
    10301044          coff_section_data (abfd, sec)->relocs = internal_relocs;
    1031           coff_section_data (abfd, sec)->keep_relocs = true;
     1045          coff_section_data (abfd, sec)->keep_relocs = TRUE;
    10321046          free_relocs = NULL;
    10331047
    10341048          coff_section_data (abfd, sec)->contents = contents;
    1035           coff_section_data (abfd, sec)->keep_contents = true;
     1049          coff_section_data (abfd, sec)->keep_contents = TRUE;
    10361050          free_contents = NULL;
    10371051
    1038           obj_coff_keep_syms (abfd) = true;
     1052          obj_coff_keep_syms (abfd) = TRUE;
    10391053        }
    10401054    }
     
    10551069          if (coff_section_data (abfd, sec) == NULL)
    10561070            {
    1057               sec->used_by_bfd =
    1058                 ((PTR) bfd_zalloc (abfd, sizeof (struct coff_section_tdata)));
     1071              bfd_size_type amt = sizeof (struct coff_section_tdata);
     1072              sec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
    10591073              if (sec->used_by_bfd == NULL)
    10601074                goto error_return;
     
    10651079    }
    10661080
    1067   return true;
     1081  return TRUE;
    10681082
    10691083 error_return:
     
    10721086  if (free_contents != NULL)
    10731087    free (free_contents);
    1074   return false;
     1088  return FALSE;
    10751089}
    10761090
    10771091/* Delete some bytes from a section while relaxing.  */
    10781092
    1079 static boolean
     1093static bfd_boolean
    10801094sh_relax_delete_bytes (abfd, sec, addr, count)
    10811095     bfd *abfd;
     
    11161130
    11171131  /* Actually delete the bytes.  */
    1118   memmove (contents + addr, contents + addr + count, toaddr - addr - count);
     1132  memmove (contents + addr, contents + addr + count,
     1133           (size_t) (toaddr - addr - count));
    11191134  if (irelalign == NULL)
    11201135    sec->_cooked_size -= count;
     
    11271142      BFD_ASSERT ((count & 1) == 0);
    11281143      for (i = 0; i < count; i += 2)
    1129         bfd_put_16 (abfd, NOP_OPCODE, contents + toaddr - count + i);
     1144        bfd_put_16 (abfd, (bfd_vma) NOP_OPCODE, contents + toaddr - count + i);
    11301145    }
    11311146
     
    11391154      int off, adjust, oinsn;
    11401155      bfd_signed_vma voff = 0;
    1141       boolean overflow;
     1156      bfd_boolean overflow;
    11421157
    11431158      /* Get the new reloc address.  */
     
    13011316        {
    13021317          oinsn = insn;
    1303           overflow = false;
     1318          overflow = FALSE;
    13041319          switch (irel->r_type)
    13051320            {
     
    13121327              insn += adjust / 2;
    13131328              if ((oinsn & 0xff00) != (insn & 0xff00))
    1314                 overflow = true;
    1315               bfd_put_16 (abfd, insn, contents + nraddr);
     1329                overflow = TRUE;
     1330              bfd_put_16 (abfd, (bfd_vma) insn, contents + nraddr);
    13161331              break;
    13171332
     
    13191334              insn += adjust / 2;
    13201335              if ((oinsn & 0xf000) != (insn & 0xf000))
    1321                 overflow = true;
    1322               bfd_put_16 (abfd, insn, contents + nraddr);
     1336                overflow = TRUE;
     1337              bfd_put_16 (abfd, (bfd_vma) insn, contents + nraddr);
    13231338              break;
    13241339
     
    13331348                }
    13341349              if ((oinsn & 0xff00) != (insn & 0xff00))
    1335                 overflow = true;
    1336               bfd_put_16 (abfd, insn, contents + nraddr);
     1350                overflow = TRUE;
     1351              bfd_put_16 (abfd, (bfd_vma) insn, contents + nraddr);
    13371352              break;
    13381353
     
    13401355              voff += adjust;
    13411356              if (voff < 0 || voff >= 0xff)
    1342                 overflow = true;
    1343               bfd_put_8 (abfd, voff, contents + nraddr);
     1357                overflow = TRUE;
     1358              bfd_put_8 (abfd, (bfd_vma) voff, contents + nraddr);
    13441359              break;
    13451360
     
    13471362              voff += adjust;
    13481363              if (voff < - 0x8000 || voff >= 0x8000)
    1349                 overflow = true;
    1350               bfd_put_signed_16 (abfd, voff, contents + nraddr);
     1364                overflow = TRUE;
     1365              bfd_put_signed_16 (abfd, (bfd_vma) voff, contents + nraddr);
    13511366              break;
    13521367
    13531368            case R_SH_SWITCH32:
    13541369              voff += adjust;
    1355               bfd_put_signed_32 (abfd, voff, contents + nraddr);
     1370              bfd_put_signed_32 (abfd, (bfd_vma) voff, contents + nraddr);
    13561371              break;
    13571372
     
    13651380              ((*_bfd_error_handler)
    13661381               ("%s: 0x%lx: fatal: reloc overflow while relaxing",
    1367                 bfd_get_filename (abfd), (unsigned long) irel->r_vaddr));
     1382                bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr));
    13681383              bfd_set_error (bfd_error_bad_value);
    1369               return false;
     1384              return FALSE;
    13701385            }
    13711386        }
     
    13891404
    13901405      /* We always cache the relocs.  Perhaps, if info->keep_memory is
    1391          false, we should free them, if we are permitted to, when we
     1406         FALSE, we should free them, if we are permitted to, when we
    13921407         leave sh_coff_relax_section.  */
    13931408      internal_relocs = (_bfd_coff_read_internal_relocs
    1394                          (abfd, o, true, (bfd_byte *) NULL, false,
     1409                         (abfd, o, TRUE, (bfd_byte *) NULL, FALSE,
    13951410                          (struct internal_reloc *) NULL));
    13961411      if (internal_relocs == NULL)
    1397         return false;
     1412        return FALSE;
    13981413
    13991414      ocontents = NULL;
     
    14311446                    {
    14321447                      /* We always cache the section contents.
    1433                          Perhaps, if info->keep_memory is false, we
     1448                         Perhaps, if info->keep_memory is FALSE, we
    14341449                         should free them, if we are permitted to,
    14351450                         when we leave sh_coff_relax_section.  */
    14361451                      ocontents = (bfd_byte *) bfd_malloc (o->_raw_size);
    14371452                      if (ocontents == NULL)
    1438                         return false;
     1453                        return FALSE;
    14391454                      if (! bfd_get_section_contents (abfd, o, ocontents,
    14401455                                                      (file_ptr) 0,
    14411456                                                      o->_raw_size))
    1442                         return false;
     1457                        return FALSE;
    14431458                      coff_section_data (abfd, o)->contents = ocontents;
    14441459                    }
     
    14511466                            ocontents + irelscan->r_vaddr - o->vma);
    14521467
    1453               coff_section_data (abfd, o)->keep_contents = true;
     1468              coff_section_data (abfd, o)->keep_contents = TRUE;
    14541469            }
    14551470        }
     
    14651480      ((*_bfd_error_handler)
    14661481       ("%s: fatal: generic symbols retrieved before relaxing",
    1467         bfd_get_filename (abfd)));
     1482        bfd_archive_filename (abfd)));
    14681483      bfd_set_error (bfd_error_invalid_operation);
    1469       return false;
     1484      return FALSE;
    14701485    }
    14711486
     
    15161531          /* Tail recursion.  */
    15171532          return sh_relax_delete_bytes (abfd, sec, alignaddr,
    1518                                         alignto - alignaddr);
     1533                                        (int) (alignto - alignaddr));
    15191534        }
    15201535    }
    15211536
    1522   return true;
     1537  return TRUE;
    15231538}
    15241539
     
    16361651
    16371652#ifndef COFF_IMAGE_WITH_PE
    1638 static boolean sh_insn_uses_reg
     1653static bfd_boolean sh_insn_uses_reg
    16391654  PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
    1640 static boolean sh_insn_sets_reg
     1655static bfd_boolean sh_insn_sets_reg
    16411656  PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
    1642 static boolean sh_insn_uses_or_sets_reg
     1657static bfd_boolean sh_insn_uses_or_sets_reg
    16431658  PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
    1644 static boolean sh_insn_uses_freg
     1659static bfd_boolean sh_insn_uses_freg
    16451660  PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
    1646 static boolean sh_insn_sets_freg
     1661static bfd_boolean sh_insn_sets_freg
    16471662  PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
    1648 static boolean sh_insn_uses_or_sets_freg
     1663static bfd_boolean sh_insn_uses_or_sets_freg
    16491664  PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
    1650 static boolean sh_insns_conflict
     1665static bfd_boolean sh_insns_conflict
    16511666  PARAMS ((unsigned int, const struct sh_opcode *, unsigned int,
    16521667           const struct sh_opcode *));
    1653 static boolean sh_load_use
     1668static bfd_boolean sh_load_use
    16541669  PARAMS ((unsigned int, const struct sh_opcode *, unsigned int,
    16551670           const struct sh_opcode *));
     
    20772092};
    20782093
     2094#ifndef COFF_IMAGE_WITH_PE
    20792095static struct sh_major_opcode sh_opcodes[] =
    20802096{
     
    20962112  { MAP (sh_opcodef) }
    20972113};
     2114#endif
    20982115
    20992116/* The double data transfer / parallel processing insns are not
     
    21532170/* See whether an instruction uses or sets a general purpose register */
    21542171
    2155 static boolean
     2172static bfd_boolean
    21562173sh_insn_uses_or_sets_reg (insn, op, reg)
    21572174     unsigned int insn;
     
    21602177{
    21612178  if (sh_insn_uses_reg (insn, op, reg))
    2162     return true;
     2179    return TRUE;
    21632180
    21642181  return sh_insn_sets_reg (insn, op, reg);
     
    21672184/* See whether an instruction uses a general purpose register.  */
    21682185
    2169 static boolean
     2186static bfd_boolean
    21702187sh_insn_uses_reg (insn, op, reg)
    21712188     unsigned int insn;
     
    21792196  if ((f & USES1) != 0
    21802197      && USES1_REG (insn) == reg)
    2181     return true;
     2198    return TRUE;
    21822199  if ((f & USES2) != 0
    21832200      && USES2_REG (insn) == reg)
    2184     return true;
     2201    return TRUE;
    21852202  if ((f & USESR0) != 0
    21862203      && reg == 0)
    2187     return true;
     2204    return TRUE;
    21882205  if ((f & USESAS) && reg == USESAS_REG (insn))
    2189     return true;
     2206    return TRUE;
    21902207  if ((f & USESR8) && reg == 8)
    2191     return true;
    2192 
    2193   return false;
     2208    return TRUE;
     2209
     2210  return FALSE;
    21942211}
    21952212
    21962213/* See whether an instruction sets a general purpose register.  */
    21972214
    2198 static boolean
     2215static bfd_boolean
    21992216sh_insn_sets_reg (insn, op, reg)
    22002217     unsigned int insn;
     
    22082225  if ((f & SETS1) != 0
    22092226      && SETS1_REG (insn) == reg)
    2210     return true;
     2227    return TRUE;
    22112228  if ((f & SETS2) != 0
    22122229      && SETS2_REG (insn) == reg)
    2213     return true;
     2230    return TRUE;
    22142231  if ((f & SETSR0) != 0
    22152232      && reg == 0)
    2216     return true;
     2233    return TRUE;
    22172234  if ((f & SETSAS) && reg == SETSAS_REG (insn))
    2218     return true;
    2219 
    2220   return false;
     2235    return TRUE;
     2236
     2237  return FALSE;
    22212238}
    22222239
    22232240/* See whether an instruction uses or sets a floating point register */
    22242241
    2225 static boolean
     2242static bfd_boolean
    22262243sh_insn_uses_or_sets_freg (insn, op, reg)
    22272244     unsigned int insn;
     
    22302247{
    22312248  if (sh_insn_uses_freg (insn, op, reg))
    2232     return true;
     2249    return TRUE;
    22332250
    22342251  return sh_insn_sets_freg (insn, op, reg);
     
    22372254/* See whether an instruction uses a floating point register.  */
    22382255
    2239 static boolean
     2256static bfd_boolean
    22402257sh_insn_uses_freg (insn, op, freg)
    22412258     unsigned int insn;
     
    22582275  if ((f & USESF1) != 0
    22592276      && (USESF1_REG (insn) & 0xe) == (freg & 0xe))
    2260     return true;
     2277    return TRUE;
    22612278  if ((f & USESF2) != 0
    22622279      && (USESF2_REG (insn) & 0xe) == (freg & 0xe))
    2263     return true;
     2280    return TRUE;
    22642281  if ((f & USESF0) != 0
    22652282      && freg == 0)
    2266     return true;
    2267 
    2268   return false;
     2283    return TRUE;
     2284
     2285  return FALSE;
    22692286}
    22702287
    22712288/* See whether an instruction sets a floating point register.  */
    22722289
    2273 static boolean
     2290static bfd_boolean
    22742291sh_insn_sets_freg (insn, op, freg)
    22752292     unsigned int insn;
     
    22922309  if ((f & SETSF1) != 0
    22932310      && (SETSF1_REG (insn) & 0xe) == (freg & 0xe))
    2294     return true;
    2295 
    2296   return false;
     2311    return TRUE;
     2312
     2313  return FALSE;
    22972314}
    22982315
    22992316/* See whether instructions I1 and I2 conflict, assuming I1 comes
    23002317   before I2.  OP1 and OP2 are the corresponding sh_opcode structures.
    2301    This should return true if there is a conflict, or false if the
     2318   This should return TRUE if there is a conflict, or FALSE if the
    23022319   instructions can be swapped safely.  */
    23032320
    2304 static boolean
     2321static bfd_boolean
    23052322sh_insns_conflict (i1, op1, i2, op2)
    23062323     unsigned int i1;
     
    23182335  if (((i1 & 0xf0ff) == 0x4066 && (i2 & 0xf000) == 0xf000)
    23192336      || ((i2 & 0xf0ff) == 0x4066 && (i1 & 0xf000) == 0xf000))
    2320     return true;
     2337    return TRUE;
    23212338
    23222339  if ((f1 & (BRANCH | DELAY)) != 0
    23232340      || (f2 & (BRANCH | DELAY)) != 0)
    2324     return true;
     2341    return TRUE;
    23252342
    23262343  if (((f1 | f2) & SETSSP)
    23272344      && (f1 & (SETSSP | USESSP))
    23282345      && (f2 & (SETSSP | USESSP)))
    2329     return true;
     2346    return TRUE;
    23302347
    23312348  if ((f1 & SETS1) != 0
    23322349      && sh_insn_uses_or_sets_reg (i2, op2, SETS1_REG (i1)))
    2333     return true;
     2350    return TRUE;
    23342351  if ((f1 & SETS2) != 0
    23352352      && sh_insn_uses_or_sets_reg (i2, op2, SETS2_REG (i1)))
    2336     return true;
     2353    return TRUE;
    23372354  if ((f1 & SETSR0) != 0
    23382355      && sh_insn_uses_or_sets_reg (i2, op2, 0))
    2339     return true;
     2356    return TRUE;
    23402357  if ((f1 & SETSAS)
    23412358      && sh_insn_uses_or_sets_reg (i2, op2, SETSAS_REG (i1)))
    2342     return true;
     2359    return TRUE;
    23432360  if ((f1 & SETSF1) != 0
    23442361      && sh_insn_uses_or_sets_freg (i2, op2, SETSF1_REG (i1)))
    2345     return true;
     2362    return TRUE;
    23462363
    23472364  if ((f2 & SETS1) != 0
    23482365      && sh_insn_uses_or_sets_reg (i1, op1, SETS1_REG (i2)))
    2349     return true;
     2366    return TRUE;
    23502367  if ((f2 & SETS2) != 0
    23512368      && sh_insn_uses_or_sets_reg (i1, op1, SETS2_REG (i2)))
    2352     return true;
     2369    return TRUE;
    23532370  if ((f2 & SETSR0) != 0
    23542371      && sh_insn_uses_or_sets_reg (i1, op1, 0))
    2355     return true;
     2372    return TRUE;
    23562373  if ((f2 & SETSAS)
    23572374      && sh_insn_uses_or_sets_reg (i1, op1, SETSAS_REG (i2)))
    2358     return true;
     2375    return TRUE;
    23592376  if ((f2 & SETSF1) != 0
    23602377      && sh_insn_uses_or_sets_freg (i1, op1, SETSF1_REG (i2)))
    2361     return true;
     2378    return TRUE;
    23622379
    23632380  /* The instructions do not conflict.  */
    2364   return false;
     2381  return FALSE;
    23652382}
    23662383
    23672384/* I1 is a load instruction, and I2 is some other instruction.  Return
    2368    true if I1 loads a register which I2 uses.  */
    2369 
    2370 static boolean
     2385   TRUE if I1 loads a register which I2 uses.  */
     2386
     2387static bfd_boolean
    23712388sh_load_use (i1, op1, i2, op2)
    23722389     unsigned int i1;
     
    23802397
    23812398  if ((f1 & LOAD) == 0)
    2382     return false;
     2399    return FALSE;
    23832400
    23842401  /* If both SETS1 and SETSSP are set, that means a load to a special
     
    23882405      && (f1 & SETSSP) == 0
    23892406      && sh_insn_uses_reg (i2, op2, (i1 & 0x0f00) >> 8))
    2390     return true;
     2407    return TRUE;
    23912408
    23922409  if ((f1 & SETSR0) != 0
    23932410      && sh_insn_uses_reg (i2, op2, 0))
    2394     return true;
     2411    return TRUE;
    23952412
    23962413  if ((f1 & SETSF1) != 0
    23972414      && sh_insn_uses_freg (i2, op2, (i1 & 0x0f00) >> 8))
    2398     return true;
    2399 
    2400   return false;
     2415    return TRUE;
     2416
     2417  return FALSE;
    24012418}
    24022419
     
    24092426   sorted list of labels; LABEL_END is the end of the list.  START and
    24102427   STOP are the range of memory to examine.  If a swap is made,
    2411    *PSWAPPED is set to true.  */
     2428   *PSWAPPED is set to TRUE.  */
    24122429
    24132430#ifdef COFF_WITH_PE
    24142431static
    24152432#endif
    2416 boolean
     2433bfd_boolean
    24172434_bfd_sh_align_load_span (abfd, sec, contents, swap, relocs,
    24182435                         plabel, label_end, start, stop, pswapped)
     
    24202437     asection *sec;
    24212438     bfd_byte *contents;
    2422      boolean (*swap) PARAMS ((bfd *, asection *, PTR, bfd_byte *, bfd_vma));
     2439     bfd_boolean (*swap) PARAMS ((bfd *, asection *, PTR, bfd_byte *, bfd_vma));
    24232440     PTR relocs;
    24242441     bfd_vma **plabel;
     
    24262443     bfd_vma start;
    24272444     bfd_vma stop;
    2428      boolean *pswapped;
     2445     bfd_boolean *pswapped;
    24292446{
    24302447  int dsp = (abfd->arch_info->mach == bfd_mach_sh_dsp
     
    24362453     with the schedules generated by the compiler.  */
    24372454  if (abfd->arch_info->mach == bfd_mach_sh4)
    2438     return true;
     2455    return TRUE;
    24392456
    24402457  /* If we are linking sh[3]-dsp code, swap the FPU instructions for DSP
     
    25102527          && ! sh_insns_conflict (prev_insn, prev_op, insn, op))
    25112528        {
    2512           boolean ok;
     2529          bfd_boolean ok;
    25132530
    25142531          /* The load/store instruction does not have a label, and
     
    25172534             INSN do not conflict.  */
    25182535
    2519           ok = true;
     2536          ok = TRUE;
    25202537
    25212538          if (i >= start + 4)
     
    25322549              if (prev2_op == NULL
    25332550                  || (prev2_op->flags & DELAY) != 0)
    2534                 ok = false;
     2551                ok = FALSE;
    25352552
    25362553              /* If the instruction before PREV_INSN is a load,
     
    25422559                  && (prev2_op->flags & LOAD) != 0
    25432560                  && sh_load_use (prev2_insn, prev2_op, insn, op))
    2544                 ok = false;
     2561                ok = FALSE;
    25452562            }
    25462563
     
    25482565            {
    25492566              if (! (*swap) (abfd, sec, relocs, contents, i - 2))
    2550                 return false;
    2551               *pswapped = true;
     2567                return FALSE;
     2568              *pswapped = TRUE;
    25522569              continue;
    25532570            }
     
    25712588              && ! sh_insns_conflict (insn, op, next_insn, next_op))
    25722589            {
    2573               boolean ok;
     2590              bfd_boolean ok;
    25742591
    25752592              /* NEXT_INSN is not itself a load/store instruction,
    25762593                 and it does not conflict with INSN.  */
    25772594
    2578               ok = true;
     2595              ok = TRUE;
    25792596
    25802597              /* If PREV_INSN is a load, and it sets a register
     
    25852602                  && (prev_op->flags & LOAD) != 0
    25862603                  && sh_load_use (prev_insn, prev_op, next_insn, next_op))
    2587                 ok = false;
     2604                ok = FALSE;
    25882605
    25892606              /* If INSN is a load, and it sets a register which
     
    26072624                  if ((next2_op->flags & (LOAD | STORE)) == 0
    26082625                      && sh_load_use (insn, op, next2_insn, next2_op))
    2609                     ok = false;
     2626                    ok = FALSE;
    26102627                }
    26112628
     
    26132630                {
    26142631                  if (! (*swap) (abfd, sec, relocs, contents, i))
    2615                     return false;
    2616                   *pswapped = true;
     2632                    return FALSE;
     2633                  *pswapped = TRUE;
    26172634                  continue;
    26182635                }
     
    26212638    }
    26222639
    2623   return true;
     2640  return TRUE;
    26242641}
    26252642#endif /* not COFF_IMAGE_WITH_PE */
     
    26302647   swapped.  */
    26312648
    2632 static boolean
     2649static bfd_boolean
    26332650sh_align_loads (abfd, sec, internal_relocs, contents, pswapped)
    26342651     bfd *abfd;
     
    26362653     struct internal_reloc *internal_relocs;
    26372654     bfd_byte *contents;
    2638      boolean *pswapped;
     2655     bfd_boolean *pswapped;
    26392656{
    26402657  struct internal_reloc *irel, *irelend;
    26412658  bfd_vma *labels = NULL;
    26422659  bfd_vma *label, *label_end;
    2643 
    2644   *pswapped = false;
     2660  bfd_size_type amt;
     2661
     2662  *pswapped = FALSE;
    26452663
    26462664  irelend = internal_relocs + sec->reloc_count;
    26472665
    26482666  /* Get all the addresses with labels on them.  */
    2649   labels = (bfd_vma *) bfd_malloc (sec->reloc_count * sizeof (bfd_vma));
     2667  amt = (bfd_size_type) sec->reloc_count * sizeof (bfd_vma);
     2668  labels = (bfd_vma *) bfd_malloc (amt);
    26502669  if (labels == NULL)
    26512670    goto error_return;
     
    26912710  free (labels);
    26922711
    2693   return true;
     2712  return TRUE;
    26942713
    26952714 error_return:
    26962715  if (labels != NULL)
    26972716    free (labels);
    2698   return false;
     2717  return FALSE;
    26992718}
    27002719
    27012720/* Swap two SH instructions.  */
    27022721
    2703 static boolean
     2722static bfd_boolean
    27042723sh_swap_insns (abfd, sec, relocs, contents, addr)
    27052724     bfd *abfd;
     
    27162735  i1 = bfd_get_16 (abfd, contents + addr);
    27172736  i2 = bfd_get_16 (abfd, contents + addr + 2);
    2718   bfd_put_16 (abfd, i2, contents + addr);
    2719   bfd_put_16 (abfd, i1, contents + addr + 2);
     2737  bfd_put_16 (abfd, (bfd_vma) i2, contents + addr);
     2738  bfd_put_16 (abfd, (bfd_vma) i1, contents + addr + 2);
    27202739
    27212740  /* Adjust all reloc addresses.  */
     
    27692788          bfd_byte *loc;
    27702789          unsigned short insn, oinsn;
    2771           boolean overflow;
     2790          bfd_boolean overflow;
    27722791
    27732792          loc = contents + irel->r_vaddr - sec->vma;
    2774           overflow = false;
     2793          overflow = FALSE;
    27752794          switch (type)
    27762795            {
     
    27842803              insn += add / 2;
    27852804              if ((oinsn & 0xff00) != (insn & 0xff00))
    2786                 overflow = true;
    2787               bfd_put_16 (abfd, insn, loc);
     2805                overflow = TRUE;
     2806              bfd_put_16 (abfd, (bfd_vma) insn, loc);
    27882807              break;
    27892808
     
    27932812              insn += add / 2;
    27942813              if ((oinsn & 0xf000) != (insn & 0xf000))
    2795                 overflow = true;
    2796               bfd_put_16 (abfd, insn, loc);
     2814                overflow = TRUE;
     2815              bfd_put_16 (abfd, (bfd_vma) insn, loc);
    27972816              break;
    27982817
     
    28102829                  insn += add / 2;
    28112830                  if ((oinsn & 0xff00) != (insn & 0xff00))
    2812                     overflow = true;
    2813                   bfd_put_16 (abfd, insn, loc);
     2831                    overflow = TRUE;
     2832                  bfd_put_16 (abfd, (bfd_vma) insn, loc);
    28142833                }
    28152834
     
    28212840              ((*_bfd_error_handler)
    28222841               ("%s: 0x%lx: fatal: reloc overflow while relaxing",
    2823                 bfd_get_filename (abfd), (unsigned long) irel->r_vaddr));
     2842                bfd_archive_filename (abfd), (unsigned long) irel->r_vaddr));
    28242843              bfd_set_error (bfd_error_bad_value);
    2825               return false;
     2844              return FALSE;
    28262845            }
    28272846        }
    28282847    }
    28292848
    2830   return true;
     2849  return TRUE;
    28312850}
    28322851
     
    28352854   will handle SH relaxing.  */
    28362855
    2837 static boolean
     2856static bfd_boolean
    28382857sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
    28392858                     relocs, syms, sections)
     
    28862905              (*_bfd_error_handler)
    28872906                ("%s: illegal symbol index %ld in relocs",
    2888                  bfd_get_filename (input_bfd), symndx);
     2907                 bfd_archive_filename (input_bfd), symndx);
    28892908              bfd_set_error (bfd_error_bad_value);
    2890               return false;
     2909              return FALSE;
    28912910            }
    28922911          h = obj_coff_sym_hashes (input_bfd)[symndx];
     
    29102929        {
    29112930          bfd_set_error (bfd_error_bad_value);
    2912           return false;
     2931          return FALSE;
    29132932        }
    29142933
     
    29582977              if (! ((*info->callbacks->undefined_symbol)
    29592978                     (info, h->root.root.string, input_bfd, input_section,
    2960                       rel->r_vaddr - input_section->vma, true)))
    2961                 return false;
     2979                      rel->r_vaddr - input_section->vma, TRUE)))
     2980                return FALSE;
    29622981            }
    29632982        }
     
    29963015                   (info, name, howto->name, (bfd_vma) 0, input_bfd,
    29973016                    input_section, rel->r_vaddr - input_section->vma)))
    2998               return false;
     3017              return FALSE;
    29993018          }
    30003019        }
    30013020    }
    30023021
    3003   return true;
     3022  return TRUE;
    30043023}
    30053024
     
    30143033     struct bfd_link_order *link_order;
    30153034     bfd_byte *data;
    3016      boolean relocateable;
     3035     bfd_boolean relocateable;
    30173036     asymbol **symbols;
    30183037{
     
    30343053
    30353054  memcpy (data, coff_section_data (input_bfd, input_section)->contents,
    3036           input_section->_raw_size);
     3055          (size_t) input_section->_raw_size);
    30373056
    30383057  if ((input_section->flags & SEC_RELOC) != 0
     
    30433062      struct internal_syment *isymp;
    30443063      asection **secpp;
     3064      bfd_size_type amt;
    30453065
    30463066      if (! _bfd_coff_get_external_symbols (input_bfd))
     
    30483068
    30493069      internal_relocs = (_bfd_coff_read_internal_relocs
    3050                          (input_bfd, input_section, false, (bfd_byte *) NULL,
    3051                           false, (struct internal_reloc *) NULL));
     3070                         (input_bfd, input_section, FALSE, (bfd_byte *) NULL,
     3071                          FALSE, (struct internal_reloc *) NULL));
    30523072      if (internal_relocs == NULL)
    30533073        goto error_return;
    30543074
    3055       internal_syms = ((struct internal_syment *)
    3056                        bfd_malloc (obj_raw_syment_count (input_bfd)
    3057                                    * sizeof (struct internal_syment)));
     3075      amt = obj_raw_syment_count (input_bfd);
     3076      amt *= sizeof (struct internal_syment);
     3077      internal_syms = (struct internal_syment *) bfd_malloc (amt);
    30583078      if (internal_syms == NULL)
    30593079        goto error_return;
    30603080
    3061       sections = (asection **) bfd_malloc (obj_raw_syment_count (input_bfd)
    3062                                            * sizeof (asection *));
     3081      amt = obj_raw_syment_count (input_bfd);
     3082      amt *= sizeof (asection *);
     3083      sections = (asection **) bfd_malloc (amt);
    30633084      if (sections == NULL)
    30643085        goto error_return;
     
    31373158
    31383159#ifndef TARGET_SHL_SYM
     3160static const bfd_target * coff_small_object_p PARAMS ((bfd *));
     3161static bfd_boolean coff_small_new_section_hook PARAMS ((bfd *, asection *));
    31393162/* Some people want versions of the SH COFF target which do not align
    31403163   to 16 byte boundaries.  We implement that by adding a couple of new
     
    31653188/* Set the section alignment for the small versions.  */
    31663189
    3167 static boolean
     3190static bfd_boolean
    31683191coff_small_new_section_hook (abfd, section)
    31693192     bfd *abfd;
     
    31713194{
    31723195  if (! coff_new_section_hook (abfd, section))
    3173     return false;
     3196    return FALSE;
    31743197
    31753198  /* We must align to at least a four byte boundary, because longword
     
    31783201    section->alignment_power = 2;
    31793202
    3180   return true;
     3203  return TRUE;
    31813204}
    31823205
     
    31933216  FILHSZ, AOUTSZ, SCNHSZ, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN,
    31943217#ifdef COFF_LONG_FILENAMES
    3195   true,
     3218  TRUE,
    31963219#else
    3197   false,
     3220  FALSE,
    31983221#endif
    31993222#ifdef COFF_LONG_SECTION_NAMES
    3200   true,
     3223  TRUE,
    32013224#else
    3202   false,
     3225  FALSE,
    32033226#endif
    32043227  2,
    32053228#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS
    3206   true,
     3229  TRUE,
    32073230#else
    3208   false,
     3231  FALSE,
    32093232#endif
    32103233#ifdef COFF_DEBUG_STRING_WIDE_PREFIX
Note: See TracChangeset for help on using the changeset viewer.