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-i960.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* BFD back-end for Intel 960 COFF files.
    2    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000
    3    Free Software Foundation, Inc.
     2   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
     3   2002 Free Software Foundation, Inc.
    44   Written by Cygnus Support.
    55
     
    3030#include "libcoff.h"            /* to allow easier abstraction-breaking */
    3131
    32 static boolean coff_i960_is_local_label_name PARAMS ((bfd *, const char *));
     32static bfd_boolean coff_i960_is_local_label_name
     33  PARAMS ((bfd *, const char *));
    3334static bfd_reloc_status_type optcall_callback
    3435  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
     
    3738static reloc_howto_type *coff_i960_reloc_type_lookup
    3839  PARAMS ((bfd *, bfd_reloc_code_real_type));
    39 static boolean coff_i960_start_final_link
     40static bfd_boolean coff_i960_start_final_link
    4041  PARAMS ((bfd *, struct bfd_link_info *));
    41 static boolean coff_i960_relocate_section
     42static bfd_boolean coff_i960_relocate_section
    4243  PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
    4344           struct internal_reloc *, struct internal_syment *, asection **));
    44 static boolean coff_i960_adjust_symndx
     45static bfd_boolean coff_i960_adjust_symndx
    4546  PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *,
    46            struct internal_reloc *, boolean *));
     47           struct internal_reloc *, bfd_boolean *));
    4748
    4849#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3)
    4950#define COFF_ALIGN_IN_SECTION_HEADER 1
    5051
    51 #define GET_SCNHDR_ALIGN bfd_h_get_32
    52 #define PUT_SCNHDR_ALIGN bfd_h_put_32
     52#define GET_SCNHDR_ALIGN H_GET_32
     53#define PUT_SCNHDR_ALIGN H_PUT_32
    5354
    5455/* The i960 does not support an MMU, so COFF_PAGE_SIZE can be
     
    6061/* This set of local label names is taken from gas.  */
    6162
    62 static boolean
     63static bfd_boolean
    6364coff_i960_is_local_label_name (abfd, name)
    6465     bfd *abfd ATTRIBUTE_UNUSED;
     
    157158             is the offset of the bal entry point.  */
    158159          word = ((word +  olf)  & BAL_MASK) | BAL;
    159           bfd_put_32 (abfd, word, (bfd_byte *) data + reloc_entry->address);
     160          bfd_put_32 (abfd, (bfd_vma) word,
     161                      (bfd_byte *) data + reloc_entry->address);
    160162        }
    161163        result = bfd_reloc_ok;
     
    252254      if (coff_section_data (output_bfd, osec) == NULL)
    253255        {
    254           osec->used_by_bfd =
    255             ((PTR) bfd_zalloc (abfd,
    256                                sizeof (struct coff_section_tdata)));
     256          bfd_size_type amt = sizeof (struct coff_section_tdata);
     257          osec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
    257258          if (osec->used_by_bfd == NULL)
    258259            return bfd_reloc_overflow;
     
    267268
    268269static reloc_howto_type howto_rellong =
    269   HOWTO ((unsigned int) R_RELLONG, 0, 2, 32,false, 0,
    270          complain_overflow_bitfield, coff_i960_relocate,"rellong", true,
     270  HOWTO ((unsigned int) R_RELLONG, 0, 2, 32,FALSE, 0,
     271         complain_overflow_bitfield, coff_i960_relocate,"rellong", TRUE,
    271272         0xffffffff, 0xffffffff, 0);
    272273static reloc_howto_type howto_iprmed =
    273   HOWTO (R_IPRMED, 0, 2, 24,true,0, complain_overflow_signed,
    274          coff_i960_relocate, "iprmed ", true, 0x00ffffff, 0x00ffffff, 0);
     274  HOWTO (R_IPRMED, 0, 2, 24,TRUE,0, complain_overflow_signed,
     275         coff_i960_relocate, "iprmed ", TRUE, 0x00ffffff, 0x00ffffff, 0);
    275276static reloc_howto_type howto_optcall =
    276   HOWTO (R_OPTCALL, 0,2,24,true,0, complain_overflow_signed,
    277          optcall_callback, "optcall", true, 0x00ffffff, 0x00ffffff, 0);
     277  HOWTO (R_OPTCALL, 0,2,24,TRUE,0, complain_overflow_signed,
     278         optcall_callback, "optcall", TRUE, 0x00ffffff, 0x00ffffff, 0);
    278279
    279280static reloc_howto_type *
     
    319320   necessary symbols.  */
    320321
    321 static boolean
     322static bfd_boolean
    322323coff_i960_start_final_link (abfd, info)
    323324     bfd *abfd;
     
    329330
    330331  if (! info->relocateable)
    331     return true;
     332    return TRUE;
    332333
    333334  esym = (bfd_byte *) bfd_malloc (symesz);
    334335  if (esym == NULL)
    335     return false;
     336    return FALSE;
    336337
    337338  if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0)
    338     return false;
     339    return FALSE;
    339340
    340341  for (o = abfd->sections; o != NULL; o = o->next)
     
    351352      bfd_coff_swap_sym_out (abfd, (PTR) &isym, (PTR) esym);
    352353
    353       if (bfd_write (esym, symesz, 1, abfd) != symesz)
     354      if (bfd_bwrite (esym, symesz, abfd) != symesz)
    354355        {
    355356          free (esym);
    356           return false;
     357          return FALSE;
    357358        }
    358359
     
    362363  free (esym);
    363364
    364   return true;
     365  return TRUE;
    365366}
    366367
    367368/* The reloc processing routine for the optimized COFF linker.  */
    368369
    369 static boolean
     370static bfd_boolean
    370371coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
    371372                            contents, relocs, syms, sections)
     
    393394      reloc_howto_type *howto;
    394395      bfd_reloc_status_type rstat = bfd_reloc_ok;
    395       boolean done;
     396      bfd_boolean done;
    396397
    397398      symndx = rel->r_symndx;
     
    420421        default:
    421422          bfd_set_error (bfd_error_bad_value);
    422           return false;
     423          return FALSE;
    423424        }
    424425
     
    459460              if (! ((*info->callbacks->undefined_symbol)
    460461                     (info, h->root.root.string, input_bfd, input_section,
    461                       rel->r_vaddr - input_section->vma, true)))
    462                 return false;
     462                      rel->r_vaddr - input_section->vma, TRUE)))
     463                return FALSE;
    463464            }
    464465        }
    465466
    466       done = false;
     467      done = FALSE;
    467468
    468469      if (howto->type == R_OPTCALL && ! info->relocateable && symndx != -1)
     
    486487                      input_bfd, input_section,
    487488                      rel->r_vaddr - input_section->vma)))
    488                 return false;
     489                return FALSE;
    489490              break;
    490491            case C_LEAFSTAT:
     
    520521                word = ((word + olf - val) & BAL_MASK) | BAL;
    521522                bfd_put_32 (input_bfd,
    522                             word,
    523                             (contents
    524                              + (rel->r_vaddr - input_section->vma)));
    525                 done = true;
     523                            (bfd_vma) word,
     524                            contents + (rel->r_vaddr - input_section->vma));
     525                done = TRUE;
    526526              }
    527527              break;
     
    561561                name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
    562562                if (name == NULL)
    563                   return false;
     563                  return FALSE;
    564564              }
    565565
     
    567567                   (info, name, howto->name, (bfd_vma) 0, input_bfd,
    568568                    input_section, rel->r_vaddr - input_section->vma)))
    569               return false;
     569              return FALSE;
    570570          }
    571571        }
    572572    }
    573573
    574   return true;
     574  return TRUE;
    575575}
    576576
     
    579579   for the section.  */
    580580
    581 static boolean
     581static bfd_boolean
    582582coff_i960_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
    583583     bfd *obfd ATTRIBUTE_UNUSED;
     
    586586     asection *sec ATTRIBUTE_UNUSED;
    587587     struct internal_reloc *irel;
    588      boolean *adjustedp;
     588     bfd_boolean *adjustedp;
    589589{
    590590  struct coff_link_hash_entry *h;
    591591
    592   *adjustedp = false;
     592  *adjustedp = FALSE;
    593593
    594594  h = obj_coff_sym_hashes (ibfd)[irel->r_symndx];
     
    596596      || (h->root.type != bfd_link_hash_defined
    597597          && h->root.type != bfd_link_hash_defweak))
    598     return true;
     598    return TRUE;
    599599
    600600  irel->r_symndx = h->root.u.def.section->output_section->target_index - 1;
    601   *adjustedp = true;
    602 
    603   return true;
     601  *adjustedp = TRUE;
     602
     603  return TRUE;
    604604}
    605605
Note: See TracChangeset for help on using the changeset viewer.