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

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* BFD back-end for TMS320C30 coff binaries.
    2    Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
     2   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
    33   Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
    44
     
    2828#include "libcoff.h"
    2929
     30static int  coff_tic30_select_reloc PARAMS ((reloc_howto_type *));
     31static void rtype2howto PARAMS ((arelent *, struct internal_reloc *));
     32static void reloc_processing PARAMS ((arelent *, struct internal_reloc *, asymbol **, bfd *, asection *));
     33
     34reloc_howto_type * tic30_coff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
     35
    3036#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1)
    3137
    3238reloc_howto_type tic30_coff_howto_table[] =
    33 {
    34   HOWTO (R_TIC30_ABS16, 2, 1, 16, false, 0, 0, NULL,
    35          "16", false, 0x0000FFFF, 0x0000FFFF, false),
    36   HOWTO (R_TIC30_ABS24, 2, 2, 24, false, 8, complain_overflow_bitfield, NULL,
    37          "24", false, 0xFFFFFF00, 0xFFFFFF00, false),
    38   HOWTO (R_TIC30_LDP, 18, 0, 24, false, 0, complain_overflow_bitfield, NULL,
    39          "LDP", false, 0x00FF0000, 0x000000FF, false),
    40   HOWTO (R_TIC30_ABS32, 2, 2, 32, false, 0, complain_overflow_bitfield, NULL,
    41          "32", false, 0xFFFFFFFF, 0xFFFFFFFF, false),
    42   HOWTO (R_TIC30_PC16, 2, 1, 16, true, 0, complain_overflow_signed, NULL,
    43          "PCREL", false, 0x0000FFFF, 0x0000FFFF, false),
    44   EMPTY_HOWTO (-1)
    45 };
     39  {
     40    HOWTO (R_TIC30_ABS16, 2, 1, 16, FALSE, 0, 0, NULL,
     41           "16", FALSE, 0x0000FFFF, 0x0000FFFF, FALSE),
     42    HOWTO (R_TIC30_ABS24, 2, 2, 24, FALSE, 8, complain_overflow_bitfield, NULL,
     43           "24", FALSE, 0xFFFFFF00, 0xFFFFFF00, FALSE),
     44    HOWTO (R_TIC30_LDP, 18, 0, 24, FALSE, 0, complain_overflow_bitfield, NULL,
     45           "LDP", FALSE, 0x00FF0000, 0x000000FF, FALSE),
     46    HOWTO (R_TIC30_ABS32, 2, 2, 32, FALSE, 0, complain_overflow_bitfield, NULL,
     47           "32", FALSE, 0xFFFFFFFF, 0xFFFFFFFF, FALSE),
     48    HOWTO (R_TIC30_PC16, 2, 1, 16, TRUE, 0, complain_overflow_signed, NULL,
     49           "PCREL", FALSE, 0x0000FFFF, 0x0000FFFF, FALSE),
     50    EMPTY_HOWTO (-1)
     51  };
    4652
    4753#ifndef coff_bfd_reloc_type_lookup
     
    5157   map to the howto table entries that match those in both the aout
    5258   and coff implementations.  */
     59
    5360reloc_howto_type *
    5461tic30_coff_reloc_type_lookup (abfd, code)
     
    7683#endif
    7784
    78 /* Turn a howto into a reloc number */
     85/* Turn a howto into a reloc number. */
    7986
    8087static int
     
    9299
    93100/* Code to swap in the reloc */
    94 #define SWAP_IN_RELOC_OFFSET  bfd_h_get_32
    95 #define SWAP_OUT_RELOC_OFFSET bfd_h_put_32
     101#define SWAP_IN_RELOC_OFFSET  H_GET_32
     102#define SWAP_OUT_RELOC_OFFSET H_PUT_32
    96103#define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) dst->r_stuff[0] = 'S'; \
    97104dst->r_stuff[1] = 'C';
     
    127134}
    128135
    129 #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
     136#define RTYPE2HOWTO(internal, relocentry) rtype2howto (internal, relocentry)
    130137
    131138/* Perform any necessary magic to the addend in a reloc entry */
     
    149156
    150157  if (reloc->r_symndx > 0)
    151     {
    152       relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
    153     }
     158    relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx];
    154159  else
    155     {
    156       relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
    157     }
     160    relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
     161
    158162  relent->addend = reloc->r_offset;
    159163  relent->address -= section->vma;
Note: See TracChangeset for help on using the changeset viewer.