0, /* dst_mask */
FALSE), /* pcrel_offset */
- EMPTY_HOWTO (45),
+ /* A 32 bit PC relative relocation. */
+ HOWTO (R_M32R_REL32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc,/* special_function */
+ "R_M32R_REL32", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
EMPTY_HOWTO (46),
EMPTY_HOWTO (47),
{ BFD_RELOC_M32R_SDA16, R_M32R_SDA16_RELA },
{ BFD_RELOC_VTABLE_INHERIT, R_M32R_RELA_GNU_VTINHERIT },
{ BFD_RELOC_VTABLE_ENTRY, R_M32R_RELA_GNU_VTENTRY },
+ { BFD_RELOC_32_PCREL, R_M32R_REL32 },
{ BFD_RELOC_M32R_GOT24, R_M32R_GOT24 },
{ BFD_RELOC_M32R_26_PLTREL, R_M32R_26_PLTREL },
|| r_type == R_M32R_HI16_SLO_RELA
|| r_type == R_M32R_LO16_RELA)
&& !h->forced_local)
+ || r_type == R_M32R_REL32
|| r_type == R_M32R_10_PCREL_RELA
|| r_type == R_M32R_18_PCREL_RELA
|| r_type == R_M32R_26_PCREL_RELA)
case R_M32R_16_RELA:
case R_M32R_24_RELA:
case R_M32R_32_RELA:
+ case R_M32R_REL32:
case R_M32R_18_PCREL_RELA:
case R_M32R_26_PCREL_RELA:
case R_M32R_HI16_ULO_RELA:
&& r_symndx != 0
&& (input_section->flags & SEC_ALLOC) != 0
&& ((r_type != R_M32R_18_PCREL_RELA
- && r_type != R_M32R_26_PCREL_RELA)
+ && r_type != R_M32R_26_PCREL_RELA
+ && r_type != R_M32R_REL32)
|| (h != NULL
&& h->dynindx != -1
&& (! info->symbolic
if (skip)
memset (&outrel, 0, sizeof outrel);
else if (r_type == R_M32R_18_PCREL_RELA
- || r_type == R_M32R_26_PCREL_RELA)
+ || r_type == R_M32R_26_PCREL_RELA
+ || r_type == R_M32R_REL32)
{
BFD_ASSERT (h != NULL && h->dynindx != -1);
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
case R_M32R_16_RELA:
case R_M32R_24_RELA:
case R_M32R_32_RELA:
+ case R_M32R_REL32:
case R_M32R_HI16_ULO_RELA:
case R_M32R_HI16_SLO_RELA:
case R_M32R_LO16_RELA:
if (p->sec == sec)
{
if (ELF32_R_TYPE (rel->r_info) == R_M32R_26_PCREL_RELA
- || ELF32_R_TYPE (rel->r_info) == R_M32R_26_PCREL_RELA)
+ || ELF32_R_TYPE (rel->r_info) == R_M32R_26_PCREL_RELA
+ || ELF32_R_TYPE (rel->r_info) == R_M32R_REL32)
p->pc_count -= 1;
p->count -= 1;
if (p->count == 0)
case R_M32R_16_RELA:
case R_M32R_24_RELA:
case R_M32R_32_RELA:
+ case R_M32R_REL32:
case R_M32R_HI16_ULO_RELA:
case R_M32R_HI16_SLO_RELA:
case R_M32R_LO16_RELA:
if ((info->shared
&& (sec->flags & SEC_ALLOC) != 0
&& ((r_type != R_M32R_26_PCREL_RELA
- && r_type != R_M32R_18_PCREL_RELA)
+ && r_type != R_M32R_18_PCREL_RELA
+ && r_type != R_M32R_REL32)
|| (h != NULL
&& (! info->symbolic
|| h->root.type == bfd_link_hash_defweak
reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
+
+ if (fixP->fx_pcrel)
+ {
+ if (fixP->fx_r_type == BFD_RELOC_32)
+ fixP->fx_r_type = BFD_RELOC_32_PCREL;
+ else if (fixP->fx_r_type == BFD_RELOC_16)
+ {
+ fixP->fx_r_type = BFD_RELOC_16_PCREL;
+ bfd_set_error (bfd_error_bad_value);
+ }
+ }
code = fixP->fx_r_type;
if (pic_code)
/* Use fx_offset for these cases. */
if ( fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY
- || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT)
+ || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
+ || fixP->fx_r_type == BFD_RELOC_32_PCREL)
reloc->addend = fixP->fx_offset;
else if ((!pic_code
&& code != BFD_RELOC_M32R_26_PLTREL)
RELOC_NUMBER (R_M32R_SDA16_RELA, 42)
RELOC_NUMBER (R_M32R_RELA_GNU_VTINHERIT, 43)
RELOC_NUMBER (R_M32R_RELA_GNU_VTENTRY, 44)
+
+ RELOC_NUMBER (R_M32R_REL32, 45)
RELOC_NUMBER (R_M32R_GOT24, 48)
RELOC_NUMBER (R_M32R_26_PLTREL, 49)
RELOC_NUMBER (R_M32R_GOTOFF_HI_ULO, 62)
RELOC_NUMBER (R_M32R_GOTOFF_HI_SLO, 63)
RELOC_NUMBER (R_M32R_GOTOFF_LO, 64)
+
END_RELOC_NUMBERS (R_M32R_max)
/* Processor specific section indices. These sections do not actually