Files
MSYS2-packages/mingw-w64-cross-binutils-git/0002-Continue-on-it.patch

134 lines
4.3 KiB
Diff

From 12a49124614ce5af0d6ef364a04813528e112619 Mon Sep 17 00:00:00 2001
From: Kai Tietz <ktietz@daphne.(none)>
Date: Fri, 26 Sep 2014 02:23:26 -0700
Subject: [PATCH 2/3] Continue on it ...
---
bfd/coff-arm.c | 4 +++-
bfd/coffcode.h | 20 +++++++++++++++-----
gas/config/tc-arm.c | 7 +++++++
3 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index 4435490..14c0fe8 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -676,7 +676,7 @@ coff_arm_reloc_type_lookup (bfd * abfd, bfd_reloc_code_real_type code)
#ifdef ARM_WINCE
ASTD (BFD_RELOC_32, ARM_32);
ASTD (BFD_RELOC_RVA, ARM_RVA32);
- ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26);
+ ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_BLX23T);
ASTD (BFD_RELOC_THUMB_PCREL_BRANCH12, ARM_THUMB12);
ASTD (BFD_RELOC_32_SECREL, ARM_SECREL);
ASTD (BFD_RELOC_THUMB_PCREL_BRANCH23, ARM_BLX23T);
@@ -1105,11 +1105,13 @@ coff_arm_relocate_section (bfd *output_bfd,
}
#ifdef ARM_WINCE
+#if 0
/* MS ARM-CE makes the reloc relative to the opcode's pc, not
the next opcode's pc, so is off by one. */
if (howto->pc_relative && !info->relocatable)
addend -= 8;
#endif
+#endif
/* If we are doing a relocatable link, then we can just ignore
a PC relative reloc that is pcrel_offset. It will already
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 04a352a..24b00a4 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -2129,6 +2129,9 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr)
machine = bfd_arm_get_mach_from_notes (abfd, ARM_NOTE_SECTION);
if (machine == bfd_mach_arm_unknown)
{
+#ifdef ARMV7_WIN
+ machine = bfd_mach_arm_XScale;
+#else
switch (internal_f->f_flags & F_ARM_ARCHITECTURE_MASK)
{
case F_ARM_2: machine = bfd_mach_arm_2; break;
@@ -2145,6 +2148,7 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr)
currently the XScale. */
case F_ARM_5: machine = bfd_mach_arm_XScale; break;
}
+#endif
}
break;
#endif
@@ -2900,6 +2904,7 @@ coff_set_flags (bfd * abfd,
* magicp = ARMMAGIC;
#endif
* flagsp = 0;
+#ifndef ARMV7_WIN
if (APCS_SET (abfd))
{
if (APCS_26_FLAG (abfd))
@@ -2913,6 +2918,7 @@ coff_set_flags (bfd * abfd,
}
if (INTERWORK_SET (abfd) && INTERWORK_FLAG (abfd))
* flagsp |= F_INTERWORK;
+
switch (bfd_get_mach (abfd))
{
case bfd_mach_arm_2: * flagsp |= F_ARM_2; break;
@@ -2924,10 +2930,11 @@ coff_set_flags (bfd * abfd,
case bfd_mach_arm_5: * flagsp |= F_ARM_5; break;
/* FIXME: we do not have F_ARM vaues greater than F_ARM_5.
See also the comment in coff_set_arch_mach_hook(). */
- case bfd_mach_arm_5T: * flagsp |= F_ARM_3M; break;
- case bfd_mach_arm_5TE: * flagsp |= F_ARM_3M; break;
- case bfd_mach_arm_XScale: * flagsp |= F_ARM_3M; break;
+ case bfd_mach_arm_5T: * flagsp |= F_ARM_5; break;
+ case bfd_mach_arm_5TE: * flagsp |= F_ARM_5; break;
+ case bfd_mach_arm_XScale: * flagsp |= F_ARM_5; break;
}
+#endif
return TRUE;
#endif
@@ -3139,8 +3146,7 @@ coff_compute_section_file_positions (bfd * abfd)
#ifdef COFF_IMAGE_WITH_PE
int page_size;
- if (coff_data (abfd)->link_info
- || (pe_data (abfd) && pe_data (abfd)->pe_opthdr.FileAlignment))
+ if (coff_data (abfd)->link_info)
{
page_size = pe_data (abfd)->pe_opthdr.FileAlignment;
@@ -5361,6 +5367,10 @@ dummy_reloc16_extra_cases (bfd *abfd ATTRIBUTE_UNUSED,
}
#endif
+#ifndef coff_bfd_link_hash_table_free
+#define coff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
+#endif
+
/* If coff_relocate_section is defined, we can use the optimized COFF
backend linker. Otherwise we must continue to use the old linker. */
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 0f173b0..2e3206f 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -21492,6 +21492,13 @@ md_pcrel_from_section (fixS * fixP, segT seg)
return base + 4;
case BFD_RELOC_THUMB_PCREL_BRANCH23:
+#ifdef TE_WINCE
+ if (fixP->fx_pcrel
+ && fixP->fx_addsy != NULL
+ && (S_GET_SEGMENT (fixP->fx_addsy) == seg)
+ && (!S_IS_EXTERNAL (fixP->fx_addsy)))
+ return base + 4;
+#endif
if (fixP->fx_addsy
&& (S_GET_SEGMENT (fixP->fx_addsy) == seg)
&& !S_FORCE_RELOC (fixP->fx_addsy, TRUE)
--
2.1.2