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

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* BFD back-end for ALPHA Extended-Coff files.
    2    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
     2   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
    33   Free Software Foundation, Inc.
    44   Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and
     
    3737/* Prototypes for static functions.  */
    3838
    39 static const bfd_target *alpha_ecoff_object_p PARAMS ((bfd *));
    40 static boolean alpha_ecoff_bad_format_hook PARAMS ((bfd *abfd, PTR filehdr));
    41 static PTR alpha_ecoff_mkobject_hook PARAMS ((bfd *, PTR filehdr, PTR aouthdr));
    42 static void alpha_ecoff_swap_reloc_in PARAMS ((bfd *, PTR,
    43                                               struct internal_reloc *));
    44 static void alpha_ecoff_swap_reloc_out PARAMS ((bfd *,
    45                                                const struct internal_reloc *,
    46                                                PTR));
    47 static void alpha_adjust_reloc_in PARAMS ((bfd *,
    48                                            const struct internal_reloc *,
    49                                            arelent *));
    50 static void alpha_adjust_reloc_out PARAMS ((bfd *, const arelent *,
    51                                             struct internal_reloc *));
     39static const bfd_target *alpha_ecoff_object_p
     40  PARAMS ((bfd *));
     41static bfd_boolean alpha_ecoff_bad_format_hook
     42  PARAMS ((bfd *abfd, PTR filehdr));
     43static PTR alpha_ecoff_mkobject_hook
     44  PARAMS ((bfd *, PTR filehdr, PTR aouthdr));
     45static void alpha_ecoff_swap_reloc_in
     46  PARAMS ((bfd *, PTR, struct internal_reloc *));
     47static void alpha_ecoff_swap_reloc_out
     48  PARAMS ((bfd *, const struct internal_reloc *, PTR));
     49static void alpha_adjust_reloc_in
     50  PARAMS ((bfd *, const struct internal_reloc *, arelent *));
     51static void alpha_adjust_reloc_out
     52  PARAMS ((bfd *, const arelent *, struct internal_reloc *));
    5253static reloc_howto_type *alpha_bfd_reloc_type_lookup
    53  PARAMS ((bfd *, bfd_reloc_code_real_type));
     54  PARAMS ((bfd *, bfd_reloc_code_real_type));
    5455static bfd_byte *alpha_ecoff_get_relocated_section_contents
    5556  PARAMS ((bfd *abfd, struct bfd_link_info *, struct bfd_link_order *,
    56            bfd_byte *data, boolean relocateable, asymbol **symbols));
     57           bfd_byte *data, bfd_boolean relocateable, asymbol **symbols));
    5758static bfd_vma alpha_convert_external_reloc
    5859  PARAMS ((bfd *, struct bfd_link_info *, bfd *, struct external_reloc *,
    5960           struct ecoff_link_hash_entry *));
    60 static boolean alpha_relocate_section PARAMS ((bfd *, struct bfd_link_info *,
    61                                                bfd *, asection *,
    62                                                bfd_byte *, PTR));
    63 static boolean alpha_adjust_headers
     61static bfd_boolean alpha_relocate_section
     62  PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PTR));
     63static bfd_boolean alpha_adjust_headers
    6464  PARAMS ((bfd *, struct internal_filehdr *, struct internal_aouthdr *));
    65 static PTR alpha_ecoff_read_ar_hdr PARAMS ((bfd *));
    66 static bfd *alpha_ecoff_get_elt_at_filepos PARAMS ((bfd *, file_ptr));
    67 static bfd *alpha_ecoff_openr_next_archived_file PARAMS ((bfd *, bfd *));
    68 static bfd *alpha_ecoff_get_elt_at_index PARAMS ((bfd *, symindex));
     65static PTR alpha_ecoff_read_ar_hdr
     66  PARAMS ((bfd *));
     67static bfd *alpha_ecoff_get_elt_at_filepos
     68  PARAMS ((bfd *, file_ptr));
     69static bfd *alpha_ecoff_openr_next_archived_file
     70  PARAMS ((bfd *, bfd *));
     71static bfd *alpha_ecoff_get_elt_at_index
     72  PARAMS ((bfd *, symindex));
    6973
    7074
     
    7983   accessor macros for the large sizes used for Alpha ECOFF.  */
    8084
    81 #define GET_FILEHDR_SYMPTR bfd_h_get_64
    82 #define PUT_FILEHDR_SYMPTR bfd_h_put_64
    83 #define GET_AOUTHDR_TSIZE bfd_h_get_64
    84 #define PUT_AOUTHDR_TSIZE bfd_h_put_64
    85 #define GET_AOUTHDR_DSIZE bfd_h_get_64
    86 #define PUT_AOUTHDR_DSIZE bfd_h_put_64
    87 #define GET_AOUTHDR_BSIZE bfd_h_get_64
    88 #define PUT_AOUTHDR_BSIZE bfd_h_put_64
    89 #define GET_AOUTHDR_ENTRY bfd_h_get_64
    90 #define PUT_AOUTHDR_ENTRY bfd_h_put_64
    91 #define GET_AOUTHDR_TEXT_START bfd_h_get_64
    92 #define PUT_AOUTHDR_TEXT_START bfd_h_put_64
    93 #define GET_AOUTHDR_DATA_START bfd_h_get_64
    94 #define PUT_AOUTHDR_DATA_START bfd_h_put_64
    95 #define GET_SCNHDR_PADDR bfd_h_get_64
    96 #define PUT_SCNHDR_PADDR bfd_h_put_64
    97 #define GET_SCNHDR_VADDR bfd_h_get_64
    98 #define PUT_SCNHDR_VADDR bfd_h_put_64
    99 #define GET_SCNHDR_SIZE bfd_h_get_64
    100 #define PUT_SCNHDR_SIZE bfd_h_put_64
    101 #define GET_SCNHDR_SCNPTR bfd_h_get_64
    102 #define PUT_SCNHDR_SCNPTR bfd_h_put_64
    103 #define GET_SCNHDR_RELPTR bfd_h_get_64
    104 #define PUT_SCNHDR_RELPTR bfd_h_put_64
    105 #define GET_SCNHDR_LNNOPTR bfd_h_get_64
    106 #define PUT_SCNHDR_LNNOPTR bfd_h_put_64
     85#define GET_FILEHDR_SYMPTR H_GET_64
     86#define PUT_FILEHDR_SYMPTR H_PUT_64
     87#define GET_AOUTHDR_TSIZE H_GET_64
     88#define PUT_AOUTHDR_TSIZE H_PUT_64
     89#define GET_AOUTHDR_DSIZE H_GET_64
     90#define PUT_AOUTHDR_DSIZE H_PUT_64
     91#define GET_AOUTHDR_BSIZE H_GET_64
     92#define PUT_AOUTHDR_BSIZE H_PUT_64
     93#define GET_AOUTHDR_ENTRY H_GET_64
     94#define PUT_AOUTHDR_ENTRY H_PUT_64
     95#define GET_AOUTHDR_TEXT_START H_GET_64
     96#define PUT_AOUTHDR_TEXT_START H_PUT_64
     97#define GET_AOUTHDR_DATA_START H_GET_64
     98#define PUT_AOUTHDR_DATA_START H_PUT_64
     99#define GET_SCNHDR_PADDR H_GET_64
     100#define PUT_SCNHDR_PADDR H_PUT_64
     101#define GET_SCNHDR_VADDR H_GET_64
     102#define PUT_SCNHDR_VADDR H_PUT_64
     103#define GET_SCNHDR_SIZE H_GET_64
     104#define PUT_SCNHDR_SIZE H_PUT_64
     105#define GET_SCNHDR_SCNPTR H_GET_64
     106#define PUT_SCNHDR_SCNPTR H_PUT_64
     107#define GET_SCNHDR_RELPTR H_GET_64
     108#define PUT_SCNHDR_RELPTR H_PUT_64
     109#define GET_SCNHDR_LNNOPTR H_GET_64
     110#define PUT_SCNHDR_LNNOPTR H_PUT_64
    107111
    108112#define ALPHAECOFF
     
    126130/* How to process the various reloc types.  */
    127131
    128 static bfd_reloc_status_type
    129 reloc_nil PARAMS ((bfd *, arelent *, asymbol *, PTR,
    130                    asection *, bfd *, char **));
     132static bfd_reloc_status_type reloc_nil
     133  PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
    131134
    132135static bfd_reloc_status_type
     
    156159         0,                     /* size (0 = byte, 1 = short, 2 = long) */
    157160         8,                     /* bitsize */
    158          true,                  /* pc_relative */
     161         TRUE,                  /* pc_relative */
    159162         0,                     /* bitpos */
    160163         complain_overflow_dont, /* complain_on_overflow */
    161164         reloc_nil,             /* special_function */
    162165         "IGNORE",              /* name */
    163          true,                  /* partial_inplace */
     166         TRUE,                  /* partial_inplace */
    164167         0,                     /* src_mask */
    165168         0,                     /* dst_mask */
    166          true),                 /* pcrel_offset */
     169         TRUE),                 /* pcrel_offset */
    167170
    168171  /* A 32 bit reference to a symbol.  */
     
    171174         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    172175         32,                    /* bitsize */
    173          false,                 /* pc_relative */
     176         FALSE,                 /* pc_relative */
    174177         0,                     /* bitpos */
    175178         complain_overflow_bitfield, /* complain_on_overflow */
    176179         0,                     /* special_function */
    177180         "REFLONG",             /* name */
    178          true,                  /* partial_inplace */
     181         TRUE,                  /* partial_inplace */
    179182         0xffffffff,            /* src_mask */
    180183         0xffffffff,            /* dst_mask */
    181          false),                /* pcrel_offset */
     184         FALSE),                /* pcrel_offset */
    182185
    183186  /* A 64 bit reference to a symbol.  */
     
    186189         4,                     /* size (0 = byte, 1 = short, 2 = long) */
    187190         64,                    /* bitsize */
    188          false,                 /* pc_relative */
     191         FALSE,                 /* pc_relative */
    189192         0,                     /* bitpos */
    190193         complain_overflow_bitfield, /* complain_on_overflow */
    191194         0,                     /* special_function */
    192195         "REFQUAD",             /* name */
    193          true,                  /* partial_inplace */
     196         TRUE,                  /* partial_inplace */
    194197         MINUS_ONE,             /* src_mask */
    195198         MINUS_ONE,             /* dst_mask */
    196          false),                /* pcrel_offset */
     199         FALSE),                /* pcrel_offset */
    197200
    198201  /* A 32 bit GP relative offset.  This is just like REFLONG except
     
    203206         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    204207         32,                    /* bitsize */
    205          false,                 /* pc_relative */
     208         FALSE,                 /* pc_relative */
    206209         0,                     /* bitpos */
    207210         complain_overflow_bitfield, /* complain_on_overflow */
    208211         0,                     /* special_function */
    209212         "GPREL32",             /* name */
    210          true,                  /* partial_inplace */
     213         TRUE,                  /* partial_inplace */
    211214         0xffffffff,            /* src_mask */
    212215         0xffffffff,            /* dst_mask */
    213          false),                /* pcrel_offset */
     216         FALSE),                /* pcrel_offset */
    214217
    215218  /* Used for an instruction that refers to memory off the GP
     
    220223         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    221224         16,                    /* bitsize */
    222          false,                 /* pc_relative */
     225         FALSE,                 /* pc_relative */
    223226         0,                     /* bitpos */
    224227         complain_overflow_signed, /* complain_on_overflow */
    225228         0,                     /* special_function */
    226229         "LITERAL",             /* name */
    227          true,                  /* partial_inplace */
     230         TRUE,                  /* partial_inplace */
    228231         0xffff,                /* src_mask */
    229232         0xffff,                /* dst_mask */
    230          false),                /* pcrel_offset */
     233         FALSE),                /* pcrel_offset */
    231234
    232235  /* This reloc only appears immediately following a LITERAL reloc.
     
    243246         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    244247         32,                    /* bitsize */
    245          false,                 /* pc_relative */
     248         FALSE,                 /* pc_relative */
    246249         0,                     /* bitpos */
    247250         complain_overflow_dont, /* complain_on_overflow */
    248251         reloc_nil,             /* special_function */
    249252         "LITUSE",              /* name */
    250          false,                 /* partial_inplace */
     253         FALSE,                 /* partial_inplace */
    251254         0,                     /* src_mask */
    252255         0,                     /* dst_mask */
    253          false),                /* pcrel_offset */
     256         FALSE),                /* pcrel_offset */
    254257
    255258  /* Load the gp register.  This is always used for a ldah instruction
     
    268271         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    269272         16,                    /* bitsize */
    270          true,                  /* pc_relative */
     273         TRUE,                  /* pc_relative */
    271274         0,                     /* bitpos */
    272275         complain_overflow_dont, /* complain_on_overflow */
    273276         reloc_nil,             /* special_function */
    274277         "GPDISP",              /* name */
    275          true,                  /* partial_inplace */
     278         TRUE,                  /* partial_inplace */
    276279         0xffff,                /* src_mask */
    277280         0xffff,                /* dst_mask */
    278          true),                 /* pcrel_offset */
     281         TRUE),                 /* pcrel_offset */
    279282
    280283  /* A 21 bit branch.  The native assembler generates these for
     
    285288         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    286289         21,                    /* bitsize */
    287          true,                  /* pc_relative */
     290         TRUE,                  /* pc_relative */
    288291         0,                     /* bitpos */
    289292         complain_overflow_signed, /* complain_on_overflow */
    290293         0,                     /* special_function */
    291294         "BRADDR",              /* name */
    292          true,                  /* partial_inplace */
     295         TRUE,                  /* partial_inplace */
    293296         0x1fffff,              /* src_mask */
    294297         0x1fffff,              /* dst_mask */
    295          false),                /* pcrel_offset */
     298         FALSE),                /* pcrel_offset */
    296299
    297300  /* A hint for a jump to a register.  */
     
    300303         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    301304         14,                    /* bitsize */
    302          true,                  /* pc_relative */
     305         TRUE,                  /* pc_relative */
    303306         0,                     /* bitpos */
    304307         complain_overflow_dont, /* complain_on_overflow */
    305308         0,                     /* special_function */
    306309         "HINT",                /* name */
    307          true,                  /* partial_inplace */
     310         TRUE,                  /* partial_inplace */
    308311         0x3fff,                /* src_mask */
    309312         0x3fff,                /* dst_mask */
    310          false),                /* pcrel_offset */
     313         FALSE),                /* pcrel_offset */
    311314
    312315  /* 16 bit PC relative offset.  */
     
    315318         1,                     /* size (0 = byte, 1 = short, 2 = long) */
    316319         16,                    /* bitsize */
    317          true,                  /* pc_relative */
     320         TRUE,                  /* pc_relative */
    318321         0,                     /* bitpos */
    319322         complain_overflow_signed, /* complain_on_overflow */
    320323         0,                     /* special_function */
    321324         "SREL16",              /* name */
    322          true,                  /* partial_inplace */
     325         TRUE,                  /* partial_inplace */
    323326         0xffff,                /* src_mask */
    324327         0xffff,                /* dst_mask */
    325          false),                /* pcrel_offset */
     328         FALSE),                /* pcrel_offset */
    326329
    327330  /* 32 bit PC relative offset.  */
     
    330333         2,                     /* size (0 = byte, 1 = short, 2 = long) */
    331334         32,                    /* bitsize */
    332          true,                  /* pc_relative */
     335         TRUE,                  /* pc_relative */
    333336         0,                     /* bitpos */
    334337         complain_overflow_signed, /* complain_on_overflow */
    335338         0,                     /* special_function */
    336339         "SREL32",              /* name */
    337          true,                  /* partial_inplace */
     340         TRUE,                  /* partial_inplace */
    338341         0xffffffff,            /* src_mask */
    339342         0xffffffff,            /* dst_mask */
    340          false),                /* pcrel_offset */
     343         FALSE),                /* pcrel_offset */
    341344
    342345  /* A 64 bit PC relative offset.  */
     
    345348         4,                     /* size (0 = byte, 1 = short, 2 = long) */
    346349         64,                    /* bitsize */
    347          true,                  /* pc_relative */
     350         TRUE,                  /* pc_relative */
    348351         0,                     /* bitpos */
    349352         complain_overflow_signed, /* complain_on_overflow */
    350353         0,                     /* special_function */
    351354         "SREL64",              /* name */
    352          true,                  /* partial_inplace */
     355         TRUE,                  /* partial_inplace */
    353356         MINUS_ONE,             /* src_mask */
    354357         MINUS_ONE,             /* dst_mask */
    355          false),                /* pcrel_offset */
     358         FALSE),                /* pcrel_offset */
    356359
    357360  /* Push a value on the reloc evaluation stack.  */
     
    360363         0,                     /* size (0 = byte, 1 = short, 2 = long) */
    361364         0,                     /* bitsize */
    362          false,                 /* pc_relative */
     365         FALSE,                 /* pc_relative */
    363366         0,                     /* bitpos */
    364367         complain_overflow_dont, /* complain_on_overflow */
    365368         0,                     /* special_function */
    366369         "OP_PUSH",             /* name */
    367          false,                 /* partial_inplace */
     370         FALSE,                 /* partial_inplace */
    368371         0,                     /* src_mask */
    369372         0,                     /* dst_mask */
    370          false),                /* pcrel_offset */
     373         FALSE),                /* pcrel_offset */
    371374
    372375  /* Store the value from the stack at the given address.  Store it in
     
    376379         4,                     /* size (0 = byte, 1 = short, 2 = long) */
    377380         64,                    /* bitsize */
    378          false,                 /* pc_relative */
     381         FALSE,                 /* pc_relative */
    379382         0,                     /* bitpos */
    380383         complain_overflow_dont, /* complain_on_overflow */
    381384         0,                     /* special_function */
    382385         "OP_STORE",            /* name */
    383          false,                 /* partial_inplace */
     386         FALSE,                 /* partial_inplace */
    384387         0,                     /* src_mask */
    385388         MINUS_ONE,             /* dst_mask */
    386          false),                /* pcrel_offset */
     389         FALSE),                /* pcrel_offset */
    387390
    388391  /* Subtract the reloc address from the value on the top of the
     
    392395         0,                     /* size (0 = byte, 1 = short, 2 = long) */
    393396         0,                     /* bitsize */
    394          false,                 /* pc_relative */
     397         FALSE,                 /* pc_relative */
    395398         0,                     /* bitpos */
    396399         complain_overflow_dont, /* complain_on_overflow */
    397400         0,                     /* special_function */
    398401         "OP_PSUB",             /* name */
    399          false,                 /* partial_inplace */
     402         FALSE,                 /* partial_inplace */
    400403         0,                     /* src_mask */
    401404         0,                     /* dst_mask */
    402          false),                /* pcrel_offset */
     405         FALSE),                /* pcrel_offset */
    403406
    404407  /* Shift the value on the top of the relocation stack right by the
     
    408411         0,                     /* size (0 = byte, 1 = short, 2 = long) */
    409412         0,                     /* bitsize */
    410          false,                 /* pc_relative */
     413         FALSE,                 /* pc_relative */
    411414         0,                     /* bitpos */
    412415         complain_overflow_dont, /* complain_on_overflow */
    413416         0,                     /* special_function */
    414417         "OP_PRSHIFT",          /* name */
    415          false,                 /* partial_inplace */
     418         FALSE,                 /* partial_inplace */
    416419         0,                     /* src_mask */
    417420         0,                     /* dst_mask */
    418          false),                /* pcrel_offset */
     421         FALSE),                /* pcrel_offset */
    419422
    420423  /* Adjust the GP value for a new range in the object file.  */
     
    423426         0,                     /* size (0 = byte, 1 = short, 2 = long) */
    424427         0,                     /* bitsize */
    425          false,                 /* pc_relative */
     428         FALSE,                 /* pc_relative */
    426429         0,                     /* bitpos */
    427430         complain_overflow_dont, /* complain_on_overflow */
    428431         0,                     /* special_function */
    429432         "GPVALUE",             /* name */
    430          false,                 /* partial_inplace */
     433         FALSE,                 /* partial_inplace */
    431434         0,                     /* src_mask */
    432435         0,                     /* dst_mask */
    433          false)                 /* pcrel_offset */
     436         FALSE)                 /* pcrel_offset */
    434437};
    435438
     
    476479/* See whether the magic number matches.  */
    477480
    478 static boolean
     481static bfd_boolean
    479482alpha_ecoff_bad_format_hook (abfd, filehdr)
    480483     bfd *abfd ATTRIBUTE_UNUSED;
     
    484487
    485488  if (ALPHA_ECOFF_BADMAG (*internal_f))
    486     return false;
    487 
    488   return true;
     489    return FALSE;
     490
     491  return TRUE;
    489492}
    490493
     
    536539  const RELOC *ext = (RELOC *) ext_ptr;
    537540
    538   intern->r_vaddr = bfd_h_get_64 (abfd, (bfd_byte *) ext->r_vaddr);
    539   intern->r_symndx = bfd_h_get_32 (abfd, (bfd_byte *) ext->r_symndx);
     541  intern->r_vaddr = H_GET_64 (abfd, ext->r_vaddr);
     542  intern->r_symndx = H_GET_32 (abfd, ext->r_symndx);
    540543
    541544  BFD_ASSERT (bfd_header_little_endian (abfd));
     
    609612              || (intern->r_symndx >= 0 && intern->r_symndx <= 14));
    610613
    611   bfd_h_put_64 (abfd, intern->r_vaddr, (bfd_byte *) ext->r_vaddr);
    612   bfd_h_put_32 (abfd, symndx, (bfd_byte *) ext->r_symndx);
     614  H_PUT_64 (abfd, intern->r_vaddr, ext->r_vaddr);
     615  H_PUT_32 (abfd, symndx, ext->r_symndx);
    613616
    614617  BFD_ASSERT (bfd_header_little_endian (abfd));
     
    761764     struct bfd_link_order *link_order;
    762765     bfd_byte *data;
    763      boolean relocateable;
     766     bfd_boolean relocateable;
    764767     asymbol **symbols;
    765768{
     
    771774  bfd *output_bfd = relocateable ? abfd : (bfd *) NULL;
    772775  bfd_vma gp;
    773   boolean gp_undefined;
     776  bfd_boolean gp_undefined;
    774777  bfd_vma stack[RELOC_STACKSIZE];
    775778  int tos = 0;
     
    777780  if (reloc_size < 0)
    778781    goto error_return;
    779   reloc_vector = (arelent **) bfd_malloc (reloc_size);
     782  reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
    780783  if (reloc_vector == NULL && reloc_size != 0)
    781784    goto error_return;
     
    787790  /* The section size is not going to change.  */
    788791  input_section->_cooked_size = input_section->_raw_size;
    789   input_section->reloc_done = true;
     792  input_section->reloc_done = TRUE;
    790793
    791794  reloc_count = bfd_canonicalize_reloc (input_bfd, input_section,
     
    797800
    798801  /* Get the GP value for the output BFD.  */
    799   gp_undefined = false;
     802  gp_undefined = FALSE;
    800803  gp = _bfd_get_gp_value (abfd);
    801804  if (gp == 0)
    802805    {
    803       if (relocateable != false)
     806      if (relocateable)
    804807        {
    805808          asection *sec;
     
    825828          struct bfd_link_hash_entry *h;
    826829
    827           h = bfd_link_hash_lookup (link_info->hash, "_gp", false, false,
    828                                     true);
     830          h = bfd_link_hash_lookup (link_info->hash, "_gp", FALSE, FALSE,
     831                                    TRUE);
    829832          if (h == (struct bfd_link_hash_entry *) NULL
    830833              || h->type != bfd_link_hash_defined)
    831             gp_undefined = true;
     834            gp_undefined = TRUE;
    832835          else
    833836            {
     
    11171120          /* I really don't know if this does the right thing.  */
    11181121          gp = rel->addend;
    1119           gp_undefined = false;
     1122          gp_undefined = FALSE;
    11201123          break;
    11211124
     
    11401143              if (! ((*link_info->callbacks->undefined_symbol)
    11411144                     (link_info, bfd_asymbol_name (*rel->sym_ptr_ptr),
    1142                       input_bfd, input_section, rel->address, true)))
     1145                      input_bfd, input_section, rel->address, TRUE)))
    11431146                goto error_return;
    11441147              break;
     
    12841287      name = bfd_get_section_name (output_bfd, hsec->output_section);
    12851288
    1286       r_symndx = -1;
     1289      r_symndx = (unsigned long) -1;
    12871290      switch (name[1])
    12881291        {
     
    13411344        }
    13421345
    1343       if (r_symndx == -1)
     1346      if (r_symndx == (unsigned long) -1)
    13441347        abort ();
    13451348
     
    13541357         the output BFD.  */
    13551358      r_symndx = h->indx;
    1356       if (r_symndx == -1)
     1359      if (r_symndx == (unsigned long) -1)
    13571360        {
    13581361          /* Caller must give an error.  */
     
    13631366
    13641367  /* Write out the new r_symndx value.  */
    1365   bfd_h_put_32 (input_bfd, (bfd_vma) r_symndx,
    1366                 (bfd_byte *) ext_rel->r_symndx);
     1368  H_PUT_32 (input_bfd, r_symndx, ext_rel->r_symndx);
    13671369
    13681370  return relocation;
     
    13731375   could be combined somehow.  */
    13741376
    1375 static boolean
     1377static bfd_boolean
    13761378alpha_relocate_section (output_bfd, info, input_bfd, input_section,
    13771379                        contents, external_relocs)
     
    13861388  struct ecoff_link_hash_entry **sym_hashes;
    13871389  bfd_vma gp;
    1388   boolean gp_undefined;
     1390  bfd_boolean gp_undefined;
    13891391  bfd_vma stack[RELOC_STACKSIZE];
    13901392  int tos = 0;
    13911393  struct external_reloc *ext_rel;
    13921394  struct external_reloc *ext_rel_end;
     1395  bfd_size_type amt;
    13931396
    13941397  /* We keep a table mapping the symndx found in an internal reloc to
     
    13981401  if (symndx_to_section == (asection **) NULL)
    13991402    {
    1400       symndx_to_section = ((asection **)
    1401                            bfd_alloc (input_bfd,
    1402                                       (NUM_RELOC_SECTIONS
    1403                                        * sizeof (asection *))));
     1403      amt = NUM_RELOC_SECTIONS * sizeof (asection *);
     1404      symndx_to_section = (asection **) bfd_alloc (input_bfd, amt);
    14041405      if (!symndx_to_section)
    1405         return false;
     1406        return FALSE;
    14061407
    14071408      symndx_to_section[RELOC_SECTION_NONE] = NULL;
     
    14581459      if (lita_sec_data == NULL)
    14591460        {
     1461          amt = sizeof (struct ecoff_section_tdata);
    14601462          lita_sec_data = ((struct ecoff_section_tdata *)
    1461                            bfd_zalloc (input_bfd,
    1462                                        sizeof (struct ecoff_section_tdata)));
     1463                           bfd_zalloc (input_bfd, amt));
    14631464          ecoff_section_data (input_bfd, lita_sec) = lita_sec_data;
    14641465        }
     
    14941495                                               (char *) NULL, output_bfd,
    14951496                                               (asection *) NULL, (bfd_vma) 0);
    1496                   ecoff_data (output_bfd)->issued_multiple_gp_warning = true;
     1497                  ecoff_data (output_bfd)->issued_multiple_gp_warning = TRUE;
    14971498                }
    14981499              if (lita_vma < gp - 0x8000)
     
    15241525      int r_offset;
    15251526      int r_size;
    1526       boolean relocatep;
    1527       boolean adjust_addrp;
    1528       boolean gp_usedp;
     1527      bfd_boolean relocatep;
     1528      bfd_boolean adjust_addrp;
     1529      bfd_boolean gp_usedp;
    15291530      bfd_vma addend;
    15301531
    1531       r_vaddr = bfd_h_get_64 (input_bfd, (bfd_byte *) ext_rel->r_vaddr);
    1532       r_symndx = bfd_h_get_32 (input_bfd, (bfd_byte *) ext_rel->r_symndx);
     1532      r_vaddr = H_GET_64 (input_bfd, ext_rel->r_vaddr);
     1533      r_symndx = H_GET_32 (input_bfd, ext_rel->r_symndx);
    15331534
    15341535      r_type = ((ext_rel->r_bits[0] & RELOC_BITS0_TYPE_LITTLE)
     
    15411542                >> RELOC_BITS3_SIZE_SH_LITTLE);
    15421543
    1543       relocatep = false;
    1544       adjust_addrp = true;
    1545       gp_usedp = false;
     1544      relocatep = FALSE;
     1545      adjust_addrp = TRUE;
     1546      gp_usedp = FALSE;
    15461547      addend = 0;
    15471548
     
    15591560             section VMA, unlike the other relocation types.  */
    15601561          if (info->relocateable)
    1561             bfd_h_put_64 (input_bfd,
    1562                           input_section->output_offset + r_vaddr,
    1563                           (bfd_byte *) ext_rel->r_vaddr);
    1564           adjust_addrp = false;
     1562            H_PUT_64 (input_bfd, input_section->output_offset + r_vaddr,
     1563                      ext_rel->r_vaddr);
     1564          adjust_addrp = FALSE;
    15651565          break;
    15661566
     
    15681568        case ALPHA_R_REFQUAD:
    15691569        case ALPHA_R_HINT:
    1570           relocatep = true;
     1570          relocatep = TRUE;
    15711571          break;
    15721572
     
    15771577          if (r_extern)
    15781578            addend += - (r_vaddr + 4);
    1579           relocatep = true;
     1579          relocatep = TRUE;
    15801580          break;
    15811581
     
    15851585             by the different between the original GP value and the
    15861586             current GP value.  */
    1587           relocatep = true;
     1587          relocatep = TRUE;
    15881588          addend = ecoff_data (input_bfd)->gp - gp;
    1589           gp_usedp = true;
     1589          gp_usedp = TRUE;
    15901590          break;
    15911591
     
    16181618          }
    16191619
    1620           relocatep = true;
     1620          relocatep = TRUE;
    16211621          addend = ecoff_data (input_bfd)->gp - gp;
    1622           gp_usedp = true;
     1622          gp_usedp = TRUE;
    16231623          break;
    16241624
     
    16841684                        contents + r_vaddr - input_section->vma + r_symndx);
    16851685
    1686             gp_usedp = true;
     1686            gp_usedp = TRUE;
    16871687          }
    16881688          break;
     
    17271727                      if (! ((*info->callbacks->undefined_symbol)
    17281728                             (info, h->root.root.string, input_bfd,
    1729                               input_section, (bfd_vma) 0, true)))
    1730                         return false;
     1729                              input_section, (bfd_vma) 0, TRUE)))
     1730                        return FALSE;
    17311731                      addend = 0;
    17321732                    }
     
    17441744                             (info, h->root.root.string, input_bfd,
    17451745                              input_section, (bfd_vma) 0)))
    1746                         return false;
     1746                        return FALSE;
    17471747                    }
    17481748
     
    17581758            {
    17591759              /* Adjust r_vaddr by the addend.  */
    1760               bfd_h_put_64 (input_bfd, addend,
    1761                             (bfd_byte *) ext_rel->r_vaddr);
     1760              H_PUT_64 (input_bfd, addend, ext_rel->r_vaddr);
    17621761            }
    17631762          else
     
    17851784            }
    17861785
    1787           adjust_addrp = false;
     1786          adjust_addrp = FALSE;
    17881787          break;
    17891788
     
    18221821          /* I really don't know if this does the right thing.  */
    18231822          gp = ecoff_data (input_bfd)->gp + r_symndx;
    1824           gp_undefined = false;
     1823          gp_undefined = FALSE;
    18251824          break;
    18261825        }
     
    18721871                             (info, h->root.root.string, input_bfd,
    18731872                              input_section, r_vaddr - input_section->vma)))
    1874                         return false;
     1873                        return FALSE;
    18751874                    }
    18761875
     
    19291928                             (info, h->root.root.string, input_bfd,
    19301929                              input_section,
    1931                               r_vaddr - input_section->vma, true)))
    1932                         return false;
     1930                              r_vaddr - input_section->vma, TRUE)))
     1931                        return FALSE;
    19331932                      relocation = 0;
    19341933                    }
     
    19761975                            (bfd_vma) 0, input_bfd, input_section,
    19771976                            r_vaddr - input_section->vma)))
    1978                       return false;
     1977                      return FALSE;
    19791978                  }
    19801979                  break;
     
    19861985        {
    19871986          /* Change the address of the relocation.  */
    1988           bfd_h_put_64 (input_bfd,
    1989                         (input_section->output_section->vma
    1990                         + input_section->output_offset
    1991                         - input_section->vma
    1992                         + r_vaddr),
    1993                         (bfd_byte *) ext_rel->r_vaddr);
     1987          H_PUT_64 (input_bfd,
     1988                    (input_section->output_section->vma
     1989                    + input_section->output_offset
     1990                    - input_section->vma
     1991                    + r_vaddr),
     1992                    ext_rel->r_vaddr);
    19941993        }
    19951994
     
    19971996        {
    19981997          if (! ((*info->callbacks->reloc_dangerous)
    1999                  (info, _("GP relative relocation when GP not defined"),
     1998                 (info, _("GP relative relocation used when GP not defined"),
    20001999                  input_bfd, input_section, r_vaddr - input_section->vma)))
    2001             return false;
     2000            return FALSE;
    20022001          /* Only give the error once per link.  */
    20032002          gp = 4;
    20042003          _bfd_set_gp_value (output_bfd, gp);
    2005           gp_undefined = false;
     2004          gp_undefined = FALSE;
    20062005        }
    20072006    }
     
    20102009    abort ();
    20112010
    2012   return true;
     2011  return TRUE;
    20132012}
    20142013
     
    20172016   sets the dynamic bits in the file header.  */
    20182017
    2019 static boolean
     2018static bfd_boolean
    20202019alpha_adjust_headers (abfd, fhdr, ahdr)
    20212020     bfd *abfd;
     
    20272026  else if ((abfd->flags & DYNAMIC) != 0)
    20282027    fhdr->f_flags |= F_ALPHA_SHARABLE;
    2029   return true;
     2028  return TRUE;
    20302029}
    20312030
     
    20712070      /* This is a compressed file.  We must set the size correctly.
    20722071         The size is the eight bytes after the dummy file header.  */
    2073       if (bfd_seek (abfd, FILHSZ, SEEK_CUR) != 0
    2074           || bfd_read (ab, 1, 8, abfd) != 8
    2075           || bfd_seek (abfd, - (FILHSZ + 8), SEEK_CUR) != 0)
     2072      if (bfd_seek (abfd, (file_ptr) FILHSZ, SEEK_CUR) != 0
     2073          || bfd_bread (ab, (bfd_size_type) 8, abfd) != 8
     2074          || bfd_seek (abfd, (file_ptr) (- (FILHSZ + 8)), SEEK_CUR) != 0)
    20762075        return NULL;
    20772076
    2078       ret->parsed_size = bfd_h_get_64 (abfd, ab);
     2077      ret->parsed_size = H_GET_64 (abfd, ab);
    20792078    }
    20802079
     
    21142113
    21152114  /* We must uncompress this element.  We do this by copying it into a
    2116      memory buffer, and making bfd_read and bfd_seek use that buffer.
     2115     memory buffer, and making bfd_bread and bfd_seek use that buffer.
    21172116     This can use a lot of memory, but it's simpler than getting a
    21182117     temporary file, making that work with the file descriptor caching
     
    21212120
    21222121  /* The compressed file starts with a dummy ECOFF file header.  */
    2123   if (bfd_seek (nbfd, FILHSZ, SEEK_SET) != 0)
     2122  if (bfd_seek (nbfd, (file_ptr) FILHSZ, SEEK_SET) != 0)
    21242123    goto error_return;
    21252124
    21262125  /* The next eight bytes are the real file size.  */
    2127   if (bfd_read (ab, 1, 8, nbfd) != 8)
     2126  if (bfd_bread (ab, (bfd_size_type) 8, nbfd) != 8)
    21282127    goto error_return;
    2129   size = bfd_h_get_64 (nbfd, ab);
     2128  size = H_GET_64 (nbfd, ab);
    21302129
    21312130  if (size == 0)
     
    21462145
    21472146      /* I don't know what the next eight bytes are for.  */
    2148       if (bfd_read (ab, 1, 8, nbfd) != 8)
     2147      if (bfd_bread (ab, (bfd_size_type) 8, nbfd) != 8)
    21492148        goto error_return;
    21502149
     
    21572156      memset (dict, 0, sizeof dict);
    21582157      h = 0;
    2159       while (bfd_read (&b, 1, 1, nbfd) == 1)
     2158      while (bfd_bread (&b, (bfd_size_type) 1, nbfd) == 1)
    21602159        {
    21612160          unsigned int i;
     
    21692168              else
    21702169                {
    2171                   if (! bfd_read (&n, 1, 1, nbfd))
     2170                  if (! bfd_bread (&n, (bfd_size_type) 1, nbfd))
    21722171                    goto error_return;
    21732172                  dict[h] = n;
     
    21922191  /* Now the uncompressed file contents are in buf.  */
    21932192  bim = ((struct bfd_in_memory *)
    2194          bfd_alloc (nbfd, sizeof (struct bfd_in_memory)));
     2193         bfd_alloc (nbfd, (bfd_size_type) sizeof (struct bfd_in_memory)));
    21952194  if (bim == NULL)
    21962195    goto error_return;
     
    21982197  bim->buffer = buf;
    21992198
    2200   nbfd->mtime_set = true;
     2199  nbfd->mtime_set = TRUE;
    22012200  nbfd->mtime = strtol (hdr->ar_date, (char **) NULL, 10);
    22022201
     
    22762275    alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out,
    22772276    alpha_ecoff_swap_scnhdr_out,
    2278     FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, false, 2,
     2277    FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, FALSE, 4, FALSE, 2,
    22792278    alpha_ecoff_swap_filehdr_in, alpha_ecoff_swap_aouthdr_in,
    22802279    alpha_ecoff_swap_scnhdr_in, NULL,
     
    22922291     executable file.  E.g., 0x1000.  */
    22932292  0x2000,
    2294   /* True if the .rdata section is part of the text segment, as on the
    2295      Alpha.  False if .rdata is part of the data segment, as on the
     2293  /* TRUE if the .rdata section is part of the text segment, as on the
     2294     Alpha.  FALSE if .rdata is part of the data segment, as on the
    22962295     MIPS.  */
    2297   true,
     2296  TRUE,
    22982297  /* Bitsize of constructor entries.  */
    22992298  64,
     
    23692368#define _bfd_ecoff_bfd_relax_section bfd_generic_relax_section
    23702369#define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections
     2370#define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections
     2371#define _bfd_ecoff_bfd_discard_group bfd_generic_discard_group
    23712372
    23722373const bfd_target ecoffalpha_little_vec =
Note: See TracChangeset for help on using the changeset viewer.