summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-08-06 15:04:23 +0000
committerNick Clifton <nickc@redhat.com>2006-08-06 15:04:23 +0000
commitdb76ad261e2fdc749971d3046d9de5040304c48b (patch)
treeee61a2518a9dd27182aa2f9b54c3db03173a8d95 /bfd
parent3ec14b720196bf8b3ffe12cb69c6a68ad1d0b4fe (diff)
downloadbinutils-redhat-db76ad261e2fdc749971d3046d9de5040304c48b.tar.gz
* 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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog13
-rw-r--r--bfd/bfd.c4
-rw-r--r--bfd/coff-arm.c27
-rw-r--r--bfd/pe-arm.c18
-rw-r--r--bfd/pei-arm.c22
5 files changed, 83 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 0ba154dfd8..253b7c00a4 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,16 @@
+2006-08-05 Pedro Alves <pedro_alves@portugalmail.pt>
+
+ * 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.
+
2006-08-04 Marcelo Tosatti <marcelo@kvack.org>
* elflink.c (elf_gc_sweep): If info.print_gc_sections is true,
diff --git a/bfd/bfd.c b/bfd/bfd.c
index a2d4ae90b6..cc0f73efc6 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -883,7 +883,9 @@ bfd_get_sign_extend_vma (bfd *abfd)
a place will have to be found. Until then, this hack will do. */
if (strncmp (name, "coff-go32", sizeof ("coff-go32") - 1) == 0
|| strcmp (name, "pe-i386") == 0
- || strcmp (name, "pei-i386") == 0)
+ || strcmp (name, "pei-i386") == 0
+ || strcmp (name, "pe-arm-little") == 0
+ || strcmp (name, "pei-arm-little") == 0)
return 1;
bfd_set_error (bfd_error_wrong_format);
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index ff4b239452..91b2634f54 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -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);
diff --git a/bfd/pe-arm.c b/bfd/pe-arm.c
index dba9c1b40e..41c7ba9996 100644
--- a/bfd/pe-arm.c
+++ b/bfd/pe-arm.c
@@ -44,4 +44,22 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#define TARGET_UNDERSCORE 0
#endif
+#define COFF_SECTION_ALIGNMENT_ENTRIES \
+{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }
+
#include "coff-arm.c"
diff --git a/bfd/pei-arm.c b/bfd/pei-arm.c
index 38d3367cef..cba19ded43 100644
--- a/bfd/pei-arm.c
+++ b/bfd/pei-arm.c
@@ -32,4 +32,26 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#define PCRELOFFSET TRUE
#define COFF_LONG_SECTION_NAMES
+#ifdef ARM_WINCE
+# define TARGET_UNDERSCORE 0
+#endif
+
+#define COFF_SECTION_ALIGNMENT_ENTRIES \
+{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".data"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".text"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \
+ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }
+
#include "coff-arm.c"