/* These are the only relocation types we care about. */
if ( r_type != R_ARM_PC24
&& r_type != R_ARM_PLT32
-#ifndef OLD_ARM_ABI
&& r_type != R_ARM_CALL
&& r_type != R_ARM_JUMP24
-#endif
&& r_type != R_ARM_THM_CALL)
continue;
{
case R_ARM_PC24:
case R_ARM_PLT32:
-#ifndef OLD_ARM_ABI
case R_ARM_CALL:
case R_ARM_JUMP24:
-#endif
/* This one is a call from arm code. We need to look up
the target of the call. If it is a thumb target, we
insert glue. */
#endif
-#ifndef OLD_ARM_ABI
/* Set target relocation values needed during linking. */
void
globals->fix_v4bx = fix_v4bx;
globals->use_blx |= use_blx;
}
-#endif
/* The thumb form of a long branch is a bit finicky, because the offset
encoding is split over two fields, each in it's own instruction. They
return TRUE;
}
-
-#ifndef OLD_ARM_ABI
/* Some relocations map to different relocations depending on the
target. Return the real relocation. */
static int
return r_type;
}
}
-#endif /* OLD_ARM_ABI */
-
/* Return the base VMA address which should be subtracted from real addresses
when resolving @dtpoff relocation.
globals = elf32_arm_hash_table (info);
-#ifndef OLD_ARM_ABI
/* Some relocation type map to different relocations depending on the
target. We pick the right one here. */
r_type = arm_real_reloc_type (globals, r_type);
if (r_type != howto->type)
howto = elf32_arm_howto_from_type (r_type);
-#endif /* OLD_ARM_ABI */
/* If the start address has been set, then set the EF_ARM_HASENTRY
flag. Setting this more than once is redundant, but the cost is
case R_ARM_PC24:
case R_ARM_ABS32:
case R_ARM_REL32:
-#ifndef OLD_ARM_ABI
case R_ARM_CALL:
case R_ARM_JUMP24:
case R_ARM_XPC25:
case R_ARM_PREL31:
-#endif
case R_ARM_PLT32:
/* r_symndx will be zero only for relocs against symbols
from removed linkonce sections, or sections discarded by
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak)
&& r_type != R_ARM_PC24
-#ifndef OLD_ARM_ABI
&& r_type != R_ARM_CALL
&& r_type != R_ARM_JUMP24
&& r_type != R_ARM_PREL31
-#endif
&& r_type != R_ARM_PLT32)
{
Elf_Internal_Rela outrel;
}
else switch (r_type)
{
-#ifndef OLD_ARM_ABI
case R_ARM_XPC25: /* Arm BLX instruction. */
case R_ARM_CALL:
case R_ARM_JUMP24:
-#endif
case R_ARM_PC24: /* Arm B/BL instruction */
case R_ARM_PLT32:
-#ifndef OLD_ARM_ABI
if (r_type == R_ARM_XPC25)
{
/* Check for Arm calling Arm function. */
h ? h->root.root.string : "(local)");
}
else
-#endif
{
/* Check for Arm calling Thumb function. */
if (sym_flags == STT_ARM_TFUNC)
return bfd_reloc_overflow;
}
-#ifndef OLD_ARM_ABI
/* If necessary set the H bit in the BLX instruction. */
if (r_type == R_ARM_XPC25 && ((value & 2) == 2))
value = (signed_addend & howto->dst_mask)
| (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask))
| (1 << 24);
else
-#endif
value = (signed_addend & howto->dst_mask)
| (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask));
break;
value += addend;
break;
-#ifndef OLD_ARM_ABI
case R_ARM_PREL31:
value -= (input_section->output_section->vma
+ input_section->output_offset + rel->r_offset);
if (sym_flags == STT_ARM_TFUNC)
value |= 1;
break;
-#endif
}
bfd_put_32 (input_bfd, value, hit_data);
bfd_put_16 (input_bfd, value, hit_data);
return bfd_reloc_ok;
-#ifndef OLD_ARM_ABI
case R_ARM_THM_XPC22:
-#endif
case R_ARM_THM_CALL:
/* Thumb BL (branch long instruction). */
{
addend = (upper << 12) | (lower << 1);
signed_addend = addend;
}
-#ifndef OLD_ARM_ABI
+
if (r_type == R_ARM_THM_XPC22)
{
/* Check for Thumb to Thumb call. */
h ? h->root.root.string : "(local)");
}
else
-#endif
{
/* If it is not a call to Thumb, assume call to Arm.
If it is a call relative to a section name, then it is not a
if (signed_check > reloc_signed_max || signed_check < reloc_signed_min)
overflow = TRUE;
-#ifndef OLD_ARM_ABI
if ((r_type == R_ARM_THM_XPC22
&& ((lower_insn & 0x1800) == 0x0800))
|| thumb_plt_call)
which specifies that bit 1 of the target address will come from bit
1 of the base address. */
relocation = (relocation + 2) & ~ 3;
-#endif
+
/* Put RELOCATION back into the insn. */
upper_insn = (upper_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 12) & 0x7ff);
lower_insn = (lower_insn & ~(bfd_vma) 0x7ff) | ((relocation >> 1) & 0x7ff);
return bfd_reloc_ok;
}
-#ifndef OLD_ARM_ABI
case R_ARM_ALU_PCREL7_0:
case R_ARM_ALU_PCREL15_8:
case R_ARM_ALU_PCREL23_15:
bfd_put_32 (input_bfd, value, hit_data);
}
return bfd_reloc_ok;
-#endif
case R_ARM_GNU_VTINHERIT:
case R_ARM_GNU_VTENTRY:
(bfd_vma) 0);
case R_ARM_GOT32:
-#ifndef OLD_ARM_ABI
case R_ARM_GOT_PREL:
-#endif
/* Relocation is to the entry for this symbol in the
global offset table. */
if (sgot == NULL)
case R_ARM_PC24:
case R_ARM_PLT32:
-#ifndef OLD_ARM_ABI
case R_ARM_CALL:
case R_ARM_JUMP24:
-#endif
addend <<= howto->size;
addend += increment;
}
r_type = ELF32_R_TYPE (rel->r_info);
-#ifndef OLD_ARM_ABI
r_type = arm_real_reloc_type (globals, r_type);
-#endif
switch (r_type)
{
case R_ARM_GOT32:
-#ifndef OLD_ARM_ABI
case R_ARM_GOT_PREL:
-#endif
case R_ARM_TLS_GD32:
case R_ARM_TLS_IE32:
if (h != NULL)
case R_ARM_REL32:
case R_ARM_PC24:
case R_ARM_PLT32:
-#ifndef OLD_ARM_ABI
case R_ARM_CALL:
case R_ARM_JUMP24:
case R_ARM_PREL31:
-#endif
case R_ARM_THM_CALL:
/* Should the interworking branches be here also? */
r_symndx = ELF32_R_SYM (rel->r_info);
r_type = ELF32_R_TYPE (rel->r_info);
-#ifndef OLD_ARM_ABI
r_type = arm_real_reloc_type (htab, r_type);
-#endif
if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{
switch (r_type)
{
case R_ARM_GOT32:
-#ifndef OLD_ARM_ABI
case R_ARM_GOT_PREL:
-#endif
case R_ARM_TLS_GD32:
case R_ARM_TLS_IE32:
/* This symbol requires a global offset table entry. */
case R_ARM_REL32:
case R_ARM_PC24:
case R_ARM_PLT32:
-#ifndef OLD_ARM_ABI
case R_ARM_CALL:
case R_ARM_JUMP24:
case R_ARM_PREL31:
-#endif
case R_ARM_THM_CALL:
/* Should the interworking branches be listed here? */
if (h != NULL)
sure yet, because something later might force the
symbol local. */
if (r_type == R_ARM_PC24
-#ifndef OLD_ARM_ABI
|| r_type == R_ARM_CALL
|| r_type == R_ARM_JUMP24
|| r_type == R_ARM_PREL31
-#endif
|| r_type == R_ARM_PLT32
|| r_type == R_ARM_THM_CALL)
h->needs_plt = 1;
RELOC_NUMBER (R_ARM_PC24, 1) /* deprecated */
RELOC_NUMBER (R_ARM_ABS32, 2)
RELOC_NUMBER (R_ARM_REL32, 3)
-#ifndef OLD_ARM_ABI
RELOC_NUMBER (R_ARM_LDR_PC_G0, 4)
RELOC_NUMBER (R_ARM_ABS16, 5)
RELOC_NUMBER (R_ARM_ABS12, 6)
RELOC_NUMBER (R_ARM_BREL_ADJ, 12)
RELOC_NUMBER (R_ARM_SWI24, 13) /* obsolete */
RELOC_NUMBER (R_ARM_THM_SWI8, 14) /* obsolete */
-#else
- RELOC_NUMBER (R_ARM_ABS8, 4)
- RELOC_NUMBER (R_ARM_ABS16, 5)
- RELOC_NUMBER (R_ARM_ABS12, 6)
- RELOC_NUMBER (R_ARM_THM_ABS5, 7)
- RELOC_NUMBER (R_ARM_THM_CALL, 8)
- RELOC_NUMBER (R_ARM_SBREL32, 9)
- RELOC_NUMBER (R_ARM_BREL_ADJ, 10)
- RELOC_NUMBER (R_ARM_THM_JUMP11, 11)
- RELOC_NUMBER (R_ARM_THM_JUMP8, 12)
- RELOC_NUMBER (R_ARM_GNU_VTINHERIT, 13)
- RELOC_NUMBER (R_ARM_GNU_VTENTRY, 14)
-#endif
RELOC_NUMBER (R_ARM_XPC25, 15) /* obsolete */
RELOC_NUMBER (R_ARM_THM_XPC22, 16) /* obsolete */
RELOC_NUMBER (R_ARM_TLS_DTPMOD32, 17)
RELOC_NUMBER (R_ARM_GOT_BREL12, 97)
RELOC_NUMBER (R_ARM_GOTOFF12, 98)
RELOC_NUMBER (R_ARM_GOTRELAX, 99)
-#ifndef OLD_ARM_ABI
RELOC_NUMBER (R_ARM_GNU_VTENTRY, 100) /* deprecated - old C++ abi */
RELOC_NUMBER (R_ARM_GNU_VTINHERIT, 101) /* deprecated - old C++ abi */
RELOC_NUMBER (R_ARM_THM_JUMP11, 102)
RELOC_NUMBER (R_ARM_THM_JUMP8, 103)
-#endif
RELOC_NUMBER (R_ARM_TLS_GD32, 104)
RELOC_NUMBER (R_ARM_TLS_LDM32, 105)
RELOC_NUMBER (R_ARM_TLS_LDO32, 106)
FAKE_RELOC (R_ARM_GOT32, R_ARM_GOT_BREL) /* 32 bit GOT entry. */
FAKE_RELOC (R_ARM_ROSEGREL32, R_ARM_SBREL31) /* ??? */
FAKE_RELOC (R_ARM_AMP_VCALL9, R_ARM_BREL_ADJ) /* Thumb-something. Not used. */
-#ifndef OLD_ARM_ABI
FAKE_RELOC (R_ARM_PC13, R_ARM_LDR_PC_G0) /* Unclear whether meaning is different. */
-#endif
END_RELOC_NUMBERS (R_ARM_max)
/* The name of the note section used to identify arm variants. */