OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [bfd/] [elf32-mips.c] - Diff between revs 14 and 161

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 14 Rev 161
Line 830... Line 830...
         0x0000ffff,            /* src_mask */
         0x0000ffff,            /* src_mask */
         0x0000ffff,            /* dst_mask */
         0x0000ffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
         FALSE),                /* pcrel_offset */
};
};
 
 
 
static reloc_howto_type elf_micromips_howto_table_rel[] =
 
{
 
  EMPTY_HOWTO (130),
 
  EMPTY_HOWTO (131),
 
  EMPTY_HOWTO (132),
 
 
 
  /* 26 bit jump address.  */
 
  HOWTO (R_MICROMIPS_26_S1,     /* type */
 
         1,                     /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         26,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
                                /* This needs complex overflow
 
                                   detection, because the upper four
 
                                   bits must match the PC.  */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_26_S1",   /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x3ffffff,             /* src_mask */
 
         0x3ffffff,             /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* High 16 bits of symbol value.  */
 
  HOWTO (R_MICROMIPS_HI16,      /* type */
 
         16,                    /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_hi16_reloc, /* special_function */
 
         "R_MICROMIPS_HI16",    /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Low 16 bits of symbol value.  */
 
  HOWTO (R_MICROMIPS_LO16,      /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_lo16_reloc, /* special_function */
 
         "R_MICROMIPS_LO16",    /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* GP relative reference.  */
 
  HOWTO (R_MICROMIPS_GPREL16,   /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf32_gprel16_reloc, /* special_function */
 
         "R_MICROMIPS_GPREL16", /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Reference to literal section.  */
 
  HOWTO (R_MICROMIPS_LITERAL,   /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf32_gprel16_reloc, /* special_function */
 
         "R_MICROMIPS_LITERAL", /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Reference to global offset table.  */
 
  HOWTO (R_MICROMIPS_GOT16,     /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_got16_reloc, /* special_function */
 
         "R_MICROMIPS_GOT16",   /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* This is for microMIPS branches.  */
 
  HOWTO (R_MICROMIPS_PC7_S1,    /* type */
 
         1,                     /* rightshift */
 
         1,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         7,                     /* bitsize */
 
         TRUE,                  /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_PC7_S1",  /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000007f,            /* src_mask */
 
         0x0000007f,            /* dst_mask */
 
         TRUE),                 /* pcrel_offset */
 
 
 
  HOWTO (R_MICROMIPS_PC10_S1,   /* type */
 
         1,                     /* rightshift */
 
         1,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         10,                    /* bitsize */
 
         TRUE,                  /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_PC10_S1", /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x000003ff,            /* src_mask */
 
         0x000003ff,            /* dst_mask */
 
         TRUE),                 /* pcrel_offset */
 
 
 
  HOWTO (R_MICROMIPS_PC16_S1,   /* type */
 
         1,                     /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         TRUE,                  /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_PC16_S1", /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         TRUE),                 /* pcrel_offset */
 
 
 
  /* 16 bit call through global offset table.  */
 
  HOWTO (R_MICROMIPS_CALL16,    /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_CALL16",  /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  EMPTY_HOWTO (143),
 
  EMPTY_HOWTO (144),
 
 
 
  /* Displacement in the global offset table.  */
 
  HOWTO (R_MICROMIPS_GOT_DISP,  /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_GOT_DISP",/* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Displacement to page pointer in the global offset table.  */
 
  HOWTO (R_MICROMIPS_GOT_PAGE,  /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_GOT_PAGE",/* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Offset from page pointer in the global offset table.  */
 
  HOWTO (R_MICROMIPS_GOT_OFST,  /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_GOT_OFST",/* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* High 16 bits of displacement in global offset table.  */
 
  HOWTO (R_MICROMIPS_GOT_HI16,  /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_GOT_HI16",/* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Low 16 bits of displacement in global offset table.  */
 
  HOWTO (R_MICROMIPS_GOT_LO16,  /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_GOT_LO16",/* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* 64 bit subtraction.  Used in the N32 ABI.  */
 
  HOWTO (R_MICROMIPS_SUB,       /* type */
 
         0,                      /* rightshift */
 
         4,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         64,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_SUB",     /* name */
 
         TRUE,                  /* partial_inplace */
 
         MINUS_ONE,             /* src_mask */
 
         MINUS_ONE,             /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Get the higher value of a 64 bit addend.  */
 
  HOWTO (R_MICROMIPS_HIGHER,    /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_HIGHER",  /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Get the highest value of a 64 bit addend.  */
 
  HOWTO (R_MICROMIPS_HIGHEST,   /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_HIGHEST", /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* High 16 bits of displacement in global offset table.  */
 
  HOWTO (R_MICROMIPS_CALL_HI16, /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_CALL_HI16",/* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Low 16 bits of displacement in global offset table.  */
 
  HOWTO (R_MICROMIPS_CALL_LO16, /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_CALL_LO16",/* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Section displacement.  */
 
  HOWTO (R_MICROMIPS_SCN_DISP,  /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         32,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_SCN_DISP",/* name */
 
         TRUE,                  /* partial_inplace */
 
         0xffffffff,            /* src_mask */
 
         0xffffffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Protected jump conversion.  This is an optimization hint.  No
 
     relocation is required for correctness.  */
 
  HOWTO (R_MICROMIPS_JALR,      /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         32,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_JALR",    /* name */
 
         FALSE,                 /* partial_inplace */
 
         0x00000000,            /* src_mask */
 
         0x00000000,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* Low 16 bits of symbol value.  Note that the high 16 bits of symbol values
 
     must be zero.  This is used for relaxation.  */
 
  HOWTO (R_MICROMIPS_HI0_LO16,  /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_dont, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_HI0_LO16",/* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  EMPTY_HOWTO (158),
 
  EMPTY_HOWTO (159),
 
  EMPTY_HOWTO (160),
 
  EMPTY_HOWTO (161),
 
 
 
  /* TLS general dynamic variable reference.  */
 
  HOWTO (R_MICROMIPS_TLS_GD,            /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_TLS_GD",  /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* TLS local dynamic variable reference.  */
 
  HOWTO (R_MICROMIPS_TLS_LDM,   /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_TLS_LDM", /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* TLS local dynamic offset.  */
 
  HOWTO (R_MICROMIPS_TLS_DTPREL_HI16,   /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_TLS_DTPREL_HI16", /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* TLS local dynamic offset.  */
 
  HOWTO (R_MICROMIPS_TLS_DTPREL_LO16,   /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_TLS_DTPREL_LO16", /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* TLS thread pointer offset.  */
 
  HOWTO (R_MICROMIPS_TLS_GOTTPREL,      /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_TLS_GOTTPREL",    /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  EMPTY_HOWTO (167),
 
  EMPTY_HOWTO (168),
 
 
 
  /* TLS thread pointer offset.  */
 
  HOWTO (R_MICROMIPS_TLS_TPREL_HI16,    /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_TLS_TPREL_HI16", /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  /* TLS thread pointer offset.  */
 
  HOWTO (R_MICROMIPS_TLS_TPREL_LO16,    /* type */
 
         0,                      /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         16,                    /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_TLS_TPREL_LO16", /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000ffff,            /* src_mask */
 
         0x0000ffff,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  EMPTY_HOWTO (171),
 
 
 
  /* GP- and PC-relative relocations.  */
 
  HOWTO (R_MICROMIPS_GPREL7_S2, /* type */
 
         2,                     /* rightshift */
 
         1,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         7,                     /* bitsize */
 
         FALSE,                 /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf32_gprel16_reloc, /* special_function */
 
         "R_MICROMIPS_GPREL7_S2",       /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x0000007f,            /* src_mask */
 
         0x0000007f,            /* dst_mask */
 
         FALSE),                /* pcrel_offset */
 
 
 
  HOWTO (R_MICROMIPS_PC23_S2,   /* type */
 
         2,                     /* rightshift */
 
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
 
         23,                    /* bitsize */
 
         TRUE,                  /* pc_relative */
 
         0,                      /* bitpos */
 
         complain_overflow_signed, /* complain_on_overflow */
 
         _bfd_mips_elf_generic_reloc, /* special_function */
 
         "R_MICROMIPS_PC23_S2", /* name */
 
         TRUE,                  /* partial_inplace */
 
         0x007fffff,            /* src_mask */
 
         0x007fffff,            /* dst_mask */
 
         TRUE),                 /* pcrel_offset */
 
};
 
 
/* 16 bit offset for pc-relative branches.  */
/* 16 bit offset for pc-relative branches.  */
static reloc_howto_type elf_mips_gnu_rel16_s2 =
static reloc_howto_type elf_mips_gnu_rel16_s2 =
  HOWTO (R_MIPS_GNU_REL16_S2,   /* type */
  HOWTO (R_MIPS_GNU_REL16_S2,   /* type */
         2,                     /* rightshift */
         2,                     /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
Line 1031... Line 1533...
                               asection *input_section, bfd *output_bfd,
                               asection *input_section, bfd *output_bfd,
                               char **error_message)
                               char **error_message)
{
{
  bfd_boolean relocatable;
  bfd_boolean relocatable;
  bfd_reloc_status_type ret;
  bfd_reloc_status_type ret;
 
  bfd_byte *location;
  bfd_vma gp;
  bfd_vma gp;
 
 
  /* R_MIPS_LITERAL relocations are defined for local symbols only.  */
  /* R_MIPS_LITERAL/R_MICROMIPS_LITERAL relocations are defined for local
  if (reloc_entry->howto->type == R_MIPS_LITERAL
     symbols only.  */
 
  if (literal_reloc_p (reloc_entry->howto->type)
      && output_bfd != NULL
      && output_bfd != NULL
      && (symbol->flags & BSF_SECTION_SYM) == 0
      && (symbol->flags & BSF_SECTION_SYM) == 0
      && (symbol->flags & BSF_LOCAL) != 0)
      && (symbol->flags & BSF_LOCAL) != 0)
    {
    {
      *error_message = (char *)
      *error_message = (char *)
Line 1057... Line 1561...
  ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message,
  ret = mips_elf_final_gp (output_bfd, symbol, relocatable, error_message,
                           &gp);
                           &gp);
  if (ret != bfd_reloc_ok)
  if (ret != bfd_reloc_ok)
    return ret;
    return ret;
 
 
  return _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry,
  location = (bfd_byte *) data + reloc_entry->address;
 
  _bfd_mips_elf_reloc_unshuffle (abfd, reloc_entry->howto->type, FALSE,
 
                                 location);
 
  ret = _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry,
                                        input_section, relocatable,
                                        input_section, relocatable,
                                        data, gp);
                                        data, gp);
 
  _bfd_mips_elf_reloc_shuffle (abfd, reloc_entry->howto->type, !relocatable,
 
                               location);
 
 
 
  return ret;
}
}
 
 
/* Do a R_MIPS_GPREL32 relocation.  This is a 32 bit value which must
/* Do a R_MIPS_GPREL32 relocation.  This is a 32 bit value which must
   become the offset from the gp register.  */
   become the offset from the gp register.  */
 
 
Line 1217... Line 1728...
                           &gp);
                           &gp);
  if (ret != bfd_reloc_ok)
  if (ret != bfd_reloc_ok)
    return ret;
    return ret;
 
 
  location = (bfd_byte *) data + reloc_entry->address;
  location = (bfd_byte *) data + reloc_entry->address;
  _bfd_mips16_elf_reloc_unshuffle (abfd, reloc_entry->howto->type, FALSE,
  _bfd_mips_elf_reloc_unshuffle (abfd, reloc_entry->howto->type, FALSE,
                                   location);
                                   location);
  ret = _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry,
  ret = _bfd_mips_elf_gprel16_with_gp (abfd, symbol, reloc_entry,
                                       input_section, relocatable,
                                       input_section, relocatable,
                                       data, gp);
                                       data, gp);
  _bfd_mips16_elf_reloc_shuffle (abfd, reloc_entry->howto->type, !relocatable,
  _bfd_mips_elf_reloc_shuffle (abfd, reloc_entry->howto->type, !relocatable,
                                 location);
                                 location);
 
 
  return ret;
  return ret;
}
}
 
 
Line 1285... Line 1796...
  { BFD_RELOC_MIPS16_CALL16, R_MIPS16_CALL16 - R_MIPS16_min },
  { BFD_RELOC_MIPS16_CALL16, R_MIPS16_CALL16 - R_MIPS16_min },
  { BFD_RELOC_MIPS16_HI16_S, R_MIPS16_HI16 - R_MIPS16_min },
  { BFD_RELOC_MIPS16_HI16_S, R_MIPS16_HI16 - R_MIPS16_min },
  { BFD_RELOC_MIPS16_LO16, R_MIPS16_LO16 - R_MIPS16_min },
  { BFD_RELOC_MIPS16_LO16, R_MIPS16_LO16 - R_MIPS16_min },
};
};
 
 
 
static const struct elf_reloc_map micromips_reloc_map[] =
 
{
 
  { BFD_RELOC_MICROMIPS_JMP, R_MICROMIPS_26_S1 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_HI16_S, R_MICROMIPS_HI16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_LO16, R_MICROMIPS_LO16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_GPREL16, R_MICROMIPS_GPREL16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_LITERAL, R_MICROMIPS_LITERAL - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_GOT16, R_MICROMIPS_GOT16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_7_PCREL_S1, R_MICROMIPS_PC7_S1 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_10_PCREL_S1, R_MICROMIPS_PC10_S1 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_16_PCREL_S1, R_MICROMIPS_PC16_S1 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_CALL16, R_MICROMIPS_CALL16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_GOT_DISP, R_MICROMIPS_GOT_DISP - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_GOT_PAGE, R_MICROMIPS_GOT_PAGE - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_GOT_OFST, R_MICROMIPS_GOT_OFST - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_GOT_HI16, R_MICROMIPS_GOT_HI16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_GOT_LO16, R_MICROMIPS_GOT_LO16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_SUB, R_MICROMIPS_SUB - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_HIGHER, R_MICROMIPS_HIGHER - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_HIGHEST, R_MICROMIPS_HIGHEST - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_CALL_HI16, R_MICROMIPS_CALL_HI16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_CALL_LO16, R_MICROMIPS_CALL_LO16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_SCN_DISP, R_MICROMIPS_SCN_DISP - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_JALR, R_MICROMIPS_JALR - R_MICROMIPS_min },
 
  /* There is no BFD reloc for R_MICROMIPS_HI0_LO16.  */
 
  { BFD_RELOC_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_GD - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_TLS_LDM, R_MICROMIPS_TLS_LDM - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
 
    R_MICROMIPS_TLS_DTPREL_HI16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
 
    R_MICROMIPS_TLS_DTPREL_LO16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
 
    R_MICROMIPS_TLS_GOTTPREL - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
 
    R_MICROMIPS_TLS_TPREL_HI16 - R_MICROMIPS_min },
 
  { BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
 
    R_MICROMIPS_TLS_TPREL_LO16 - R_MICROMIPS_min },
 
  /* There is no BFD reloc for R_MICROMIPS_GPREL7_S2.  */
 
  /* There is no BFD reloc for R_MICROMIPS_PC23_S2.  */
 
};
 
 
/* Given a BFD reloc type, return a howto structure.  */
/* Given a BFD reloc type, return a howto structure.  */
 
 
static reloc_howto_type *
static reloc_howto_type *
bfd_elf32_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
bfd_elf32_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
{
{
  unsigned int i;
  unsigned int i;
  reloc_howto_type *howto_table = elf_mips_howto_table_rel;
  reloc_howto_type *howto_table = elf_mips_howto_table_rel;
  reloc_howto_type *howto16_table = elf_mips16_howto_table_rel;
  reloc_howto_type *howto16_table = elf_mips16_howto_table_rel;
 
  reloc_howto_type *howto_micromips_table = elf_micromips_howto_table_rel;
 
 
  for (i = 0; i < sizeof (mips_reloc_map) / sizeof (struct elf_reloc_map);
  for (i = 0; i < sizeof (mips_reloc_map) / sizeof (struct elf_reloc_map);
       i++)
       i++)
    {
    {
      if (mips_reloc_map[i].bfd_val == code)
      if (mips_reloc_map[i].bfd_val == code)
Line 1308... Line 1861...
    {
    {
      if (mips16_reloc_map[i].bfd_val == code)
      if (mips16_reloc_map[i].bfd_val == code)
        return &howto16_table[(int) mips16_reloc_map[i].elf_val];
        return &howto16_table[(int) mips16_reloc_map[i].elf_val];
    }
    }
 
 
 
  for (i = 0; i < sizeof (micromips_reloc_map) / sizeof (struct elf_reloc_map);
 
       i++)
 
    {
 
      if (micromips_reloc_map[i].bfd_val == code)
 
        return &howto_micromips_table[(int) micromips_reloc_map[i].elf_val];
 
    }
 
 
  switch (code)
  switch (code)
    {
    {
    default:
    default:
      bfd_set_error (bfd_error_bad_value);
      bfd_set_error (bfd_error_bad_value);
      return NULL;
      return NULL;
Line 1359... Line 1919...
       i++)
       i++)
    if (elf_mips16_howto_table_rel[i].name != NULL
    if (elf_mips16_howto_table_rel[i].name != NULL
        && strcasecmp (elf_mips16_howto_table_rel[i].name, r_name) == 0)
        && strcasecmp (elf_mips16_howto_table_rel[i].name, r_name) == 0)
      return &elf_mips16_howto_table_rel[i];
      return &elf_mips16_howto_table_rel[i];
 
 
 
  for (i = 0;
 
       i < (sizeof (elf_micromips_howto_table_rel)
 
            / sizeof (elf_micromips_howto_table_rel[0]));
 
       i++)
 
    if (elf_micromips_howto_table_rel[i].name != NULL
 
        && strcasecmp (elf_micromips_howto_table_rel[i].name, r_name) == 0)
 
      return &elf_micromips_howto_table_rel[i];
 
 
  if (strcasecmp (elf_mips_gnu_pcrel32.name, r_name) == 0)
  if (strcasecmp (elf_mips_gnu_pcrel32.name, r_name) == 0)
    return &elf_mips_gnu_pcrel32;
    return &elf_mips_gnu_pcrel32;
  if (strcasecmp (elf_mips_gnu_rel16_s2.name, r_name) == 0)
  if (strcasecmp (elf_mips_gnu_rel16_s2.name, r_name) == 0)
    return &elf_mips_gnu_rel16_s2;
    return &elf_mips_gnu_rel16_s2;
  if (strcasecmp (elf_mips_gnu_vtinherit_howto.name, r_name) == 0)
  if (strcasecmp (elf_mips_gnu_vtinherit_howto.name, r_name) == 0)
Line 1396... Line 1964...
    case R_MIPS_COPY:
    case R_MIPS_COPY:
      return &elf_mips_copy_howto;
      return &elf_mips_copy_howto;
    case R_MIPS_JUMP_SLOT:
    case R_MIPS_JUMP_SLOT:
      return &elf_mips_jump_slot_howto;
      return &elf_mips_jump_slot_howto;
    default:
    default:
 
      if (r_type >= R_MICROMIPS_min && r_type < R_MICROMIPS_max)
 
        return &elf_micromips_howto_table_rel[r_type - R_MICROMIPS_min];
      if (r_type >= R_MIPS16_min && r_type < R_MIPS16_max)
      if (r_type >= R_MIPS16_min && r_type < R_MIPS16_max)
        return &elf_mips16_howto_table_rel[r_type - R_MIPS16_min];
        return &elf_mips16_howto_table_rel[r_type - R_MIPS16_min];
      BFD_ASSERT (r_type < (unsigned int) R_MIPS_max);
      BFD_ASSERT (r_type < (unsigned int) R_MIPS_max);
      return &elf_mips_howto_table_rel[r_type];
      return &elf_mips_howto_table_rel[r_type];
    }
    }
Line 1420... Line 1990...
  /* The addend for a GPREL16 or LITERAL relocation comes from the GP
  /* The addend for a GPREL16 or LITERAL relocation comes from the GP
     value for the object file.  We get the addend now, rather than
     value for the object file.  We get the addend now, rather than
     when we do the relocation, because the symbol manipulations done
     when we do the relocation, because the symbol manipulations done
     by the linker may cause us to lose track of the input BFD.  */
     by the linker may cause us to lose track of the input BFD.  */
  if (((*cache_ptr->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0
  if (((*cache_ptr->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0
      && (gprel16_reloc_p (r_type) || r_type == (unsigned int) R_MIPS_LITERAL))
      && (gprel16_reloc_p (r_type) || literal_reloc_p (r_type)))
    cache_ptr->addend = elf_gp (abfd);
    cache_ptr->addend = elf_gp (abfd);
}
}
 
 
/* Given a MIPS Elf_Internal_Rela, fill in an arelent structure.  */
/* Given a MIPS Elf_Internal_Rela, fill in an arelent structure.  */
 
 
Line 1669... Line 2239...
#define elf_backend_write_section       _bfd_mips_elf_write_section
#define elf_backend_write_section       _bfd_mips_elf_write_section
#define elf_backend_mips_irix_compat    elf32_mips_irix_compat
#define elf_backend_mips_irix_compat    elf32_mips_irix_compat
#define elf_backend_mips_rtype_to_howto mips_elf32_rtype_to_howto
#define elf_backend_mips_rtype_to_howto mips_elf32_rtype_to_howto
#define bfd_elf32_bfd_is_local_label_name \
#define bfd_elf32_bfd_is_local_label_name \
                                        mips_elf_is_local_label_name
                                        mips_elf_is_local_label_name
 
#define bfd_elf32_bfd_is_target_special_symbol \
 
                                        _bfd_mips_elf_is_target_special_symbol
#define bfd_elf32_find_nearest_line     _bfd_mips_elf_find_nearest_line
#define bfd_elf32_find_nearest_line     _bfd_mips_elf_find_nearest_line
#define bfd_elf32_find_inliner_info     _bfd_mips_elf_find_inliner_info
#define bfd_elf32_find_inliner_info     _bfd_mips_elf_find_inliner_info
#define bfd_elf32_new_section_hook      _bfd_mips_elf_new_section_hook
#define bfd_elf32_new_section_hook      _bfd_mips_elf_new_section_hook
#define bfd_elf32_set_section_contents  _bfd_mips_elf_set_section_contents
#define bfd_elf32_set_section_contents  _bfd_mips_elf_set_section_contents
#define bfd_elf32_bfd_get_relocated_section_contents \
#define bfd_elf32_bfd_get_relocated_section_contents \
Line 1683... Line 2255...
#define bfd_elf32_bfd_merge_private_bfd_data \
#define bfd_elf32_bfd_merge_private_bfd_data \
                                        _bfd_mips_elf_merge_private_bfd_data
                                        _bfd_mips_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags _bfd_mips_elf_set_private_flags
#define bfd_elf32_bfd_set_private_flags _bfd_mips_elf_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data \
#define bfd_elf32_bfd_print_private_bfd_data \
                                        _bfd_mips_elf_print_private_bfd_data
                                        _bfd_mips_elf_print_private_bfd_data
 
#define bfd_elf32_bfd_relax_section     _bfd_mips_elf_relax_section
 
 
/* Support for SGI-ish mips targets.  */
/* Support for SGI-ish mips targets.  */
#define TARGET_LITTLE_SYM               bfd_elf32_littlemips_vec
#define TARGET_LITTLE_SYM               bfd_elf32_littlemips_vec
#define TARGET_LITTLE_NAME              "elf32-littlemips"
#define TARGET_LITTLE_NAME              "elf32-littlemips"
#define TARGET_BIG_SYM                  bfd_elf32_bigmips_vec
#define TARGET_BIG_SYM                  bfd_elf32_bigmips_vec

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.