forked from Imagelibrary/binutils-gdb
* bfd.c (bfd_get_sign_extend_vma): Add cases for pe-arm-little and pei-arm-little.
* coff-arm.c (coff_arm_rtype_to_howto) [COFF_WITH_PE]: Handle ARM_SECREL. (coff_arm_reloc_type_lookup): Map BFD_RELOC_32_SECREL to ARM_SECREL. * pe-arm.c [COFF_SECTION_ALIGNMENT_ENTRIES]: Define. * pei-arm.c [TARGET_UNDERSCORE]: Define for ARM_WINCE like in pe-arm.c. [COFF_SECTION_ALIGNMENT_ENTRIES]: Define. * config/tc-arm.c: Move "dwarf2dbg.h" inclusion out of OBJ_ELF only block. (pe_directive_secrel) [TE_PE]: New function. (md_pseudo_table) [!OBJ_ELF]: Handle 2byte, 4byte, 8byte, file, loc, loc_mark_labels. [TE_PE]: Handle secrel32. (output_relax_insn): Remove OBJ_ELF around dwarf2_emit_insn call. (output_inst): Remove OBJ_ELF around dwarf2_emit_insn call. (arm_frob_label): Remove OBJ_ELF around dwarf2_emit_label call. (md_section_align): Only round section sizes here for AOUT targets. (tc_arm_regname_to_dw2regnum): Move out for OBJ_ELF only block. (tc_pe_dwarf2_emit_offset): New function. (md_apply_fix) [TE_PE]: Handle BFD_RELOC_32_SECREL. (cons_fix_new_arm): Handle O_secrel. * config/tc-arm.h : Move DWARF2_LINE_MIN_INSN_LENGTH, DWARF2_DEFAULT_RETURN_COLUMN and DWARF2_CIE_DATA_ALIGNMENT out of OBJ_ELF only block. [TE_PE]: Define O_secrel, TC_DWARF2_EMIT_OFFSET, and declare tc_pe_dwarf2_emit_offset. * ld-pe/pe.exp: Enable tests on arm-wince-pe. * ld-pe/secrel.d: Adjust test to work on arm-wince-pe too.
This commit is contained in:
@@ -539,6 +539,32 @@ coff_arm_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
if (rel->r_type == ARM_RVA32)
|
||||
*addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase;
|
||||
|
||||
#ifdef COFF_WITH_PE
|
||||
if (rel->r_type == ARM_SECREL)
|
||||
{
|
||||
bfd_vma osect_vma;
|
||||
|
||||
if (h && (h->type == bfd_link_hash_defined
|
||||
|| h->type == bfd_link_hash_defweak))
|
||||
osect_vma = h->root.u.def.section->output_section->vma;
|
||||
else
|
||||
{
|
||||
asection *sec;
|
||||
int i;
|
||||
|
||||
/* Sigh, the only way to get the section to offset against
|
||||
is to find it the hard way. */
|
||||
|
||||
for (sec = abfd->sections, i = 1; i < sym->n_scnum; i++)
|
||||
sec = sec->next;
|
||||
|
||||
osect_vma = sec->output_section->vma;
|
||||
}
|
||||
|
||||
*addendp -= osect_vma;
|
||||
}
|
||||
#endif
|
||||
|
||||
return howto;
|
||||
}
|
||||
|
||||
@@ -808,6 +834,7 @@ coff_arm_reloc_type_lookup (bfd * abfd, bfd_reloc_code_real_type code)
|
||||
ASTD (BFD_RELOC_RVA, ARM_RVA32);
|
||||
ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26);
|
||||
ASTD (BFD_RELOC_THUMB_PCREL_BRANCH12, ARM_THUMB12);
|
||||
ASTD (BFD_RELOC_32_SECREL, ARM_SECREL);
|
||||
#else
|
||||
ASTD (BFD_RELOC_8, ARM_8);
|
||||
ASTD (BFD_RELOC_16, ARM_16);
|
||||
|
||||
Reference in New Issue
Block a user