PARAMS ((bfd *));
static bfd_reloc_status_type mcore_coff_unsupported_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static boolean in_reloc_p
- PARAMS ((bfd *, reloc_howto_type *));
static boolean coff_mcore_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
struct internal_reloc *, struct internal_syment *, asection **));
false, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* dont complain_on_overflow */
- 0, /* special_function */
+ NULL, /* special_function */
"ABSOLUTE", /* name */
false, /* partial_inplace */
0x00, /* src_mask */
false, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- 0, /* special_function */
+ NULL, /* special_function */
"ADDR32", /* name */
true, /* partial_inplace */
0xffffffff, /* src_mask */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- mcore_coff_unsupported_reloc, /* special_function */
+ mcore_coff_unsupported_reloc, /* special_function */
"IMM8BY4", /* name */
false, /* partial_inplace */
0, /* src_mask */
true, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- mcore_coff_unsupported_reloc,/* special_function */
+ mcore_coff_unsupported_reloc, /* special_function */
"IMM4BY2", /* name */
false, /* partial_inplace */
0, /* src_mask */
false, /* partial_inplace */
0x0, /* src_mask */
0x7ff, /* dst_mask */
+ true), /* pcrel_offset */
+
+ HOWTO (IMAGE_REL_MCORE_RVA, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ NULL, /* special_function */
+ "MCORE_RVA", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
true) /* pcrel_offset */
};
\f
HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM4BY2, IMAGE_REL_MCORE_PCREL_IMM4BY2);
HOW2MAP (BFD_RELOC_32_PCREL, IMAGE_REL_MCORE_PCREL_32);
HOW2MAP (BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2);
+ HOW2MAP (BFD_RELOC_RVA, IMAGE_REL_MCORE_RVA);
default:
return NULL;
}
return NULL;
howto = mcore_coff_howto_table + rel->r_type;
+
+ if (rel->r_type == IMAGE_REL_MCORE_RVA)
+ * addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase;
if (howto->pc_relative)
{
return howto;
}
\f
-/* Return true if this relocation should
- appear in the output .reloc section. */
-static boolean in_reloc_p (abfd, howto)
- bfd * abfd;
- reloc_howto_type * howto;
-{
- return ! howto->pc_relative;
-}
-
/* The reloc processing routine for the optimized COFF linker. */
static boolean
coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
case IMAGE_REL_MCORE_PCREL_32:
case IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2:
case IMAGE_REL_MCORE_ADDR32:
+ case IMAGE_REL_MCORE_RVA:
rstat = _bfd_relocate_contents (howto, input_bfd, val, loc);
break;
}
0, /* src_mask */
0, /* dst_mask */
false), /* pcrel_offset */
+
+ HOWTO (R_MCORE_RELATIVE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_MCORE_RELATIVE", /* name */
+ true, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ true) /* pcrel_offset */
};
#ifndef NUM_ELEM
case BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2: mcore_reloc = R_MCORE_PCRELJSR_IMM11BY2; break;
case BFD_RELOC_VTABLE_INHERIT: mcore_reloc = R_MCORE_GNU_VTINHERIT; break;
case BFD_RELOC_VTABLE_ENTRY: mcore_reloc = R_MCORE_GNU_VTENTRY; break;
+ case BFD_RELOC_RVA: mcore_reloc = R_MCORE_RELATIVE; break;
default:
return (reloc_howto_type *)NULL;
}
switch (r_type)
{
default:
- case R_MCORE_PCRELIMM8BY4:
- case R_MCORE_PCRELIMM11BY2:
- case R_MCORE_PCRELIMM4BY2:
break;
case R_MCORE_PCRELJSR_IMM11BY2: