aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-arm.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/coff-arm.c')
-rw-r--r--bfd/coff-arm.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index ca08131..1619e67 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -1,6 +1,6 @@
/* BFD back-end for ARM COFF files.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001
+ 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -87,12 +87,16 @@ static bfd_reloc_status_type aoutarm_fix_pcrel_26_done
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_reloc_status_type aoutarm_fix_pcrel_26
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+#ifndef ARM_WINCE
static bfd_reloc_status_type coff_thumb_pcrel_23
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
-static bfd_reloc_status_type coff_thumb_pcrel_12
- PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_reloc_status_type coff_thumb_pcrel_9
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
+static insn32 insert_thumb_branch
+ PARAMS ((insn32, int));
+#endif
+static bfd_reloc_status_type coff_thumb_pcrel_12
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_reloc_status_type coff_arm_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static boolean coff_arm_adjust_symndx
@@ -109,8 +113,6 @@ static const struct reloc_howto_struct * coff_arm_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
static struct bfd_link_hash_table * coff_arm_link_hash_table_create
PARAMS ((bfd *));
-static insn32 insert_thumb_branch
- PARAMS ((insn32, int));
static struct coff_link_hash_entry * find_thumb_glue
PARAMS ((struct bfd_link_info *, const char *, bfd *));
static struct coff_link_hash_entry * find_arm_glue
@@ -118,9 +120,11 @@ static struct coff_link_hash_entry * find_arm_glue
#ifndef COFF_IMAGE_WITH_PE
static void record_arm_to_thumb_glue
PARAMS ((struct bfd_link_info *, struct coff_link_hash_entry *));
+#ifndef ARM_WINCE
static void record_thumb_to_arm_glue
PARAMS ((struct bfd_link_info *, struct coff_link_hash_entry *));
#endif
+#endif
static boolean coff_arm_merge_private_bfd_data
PARAMS ((bfd *, bfd *));
static boolean coff_arm_print_private_bfd_data
@@ -801,6 +805,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section,
return flag;
}
+#ifndef ARM_WINCE
static bfd_reloc_status_type
coff_thumb_pcrel_23 (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message)
@@ -818,7 +823,7 @@ coff_thumb_pcrel_23 (abfd, reloc_entry, symbol, data, input_section,
}
static bfd_reloc_status_type
-coff_thumb_pcrel_12 (abfd, reloc_entry, symbol, data, input_section,
+coff_thumb_pcrel_9 (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message)
bfd *abfd;
arelent *reloc_entry;
@@ -830,11 +835,12 @@ coff_thumb_pcrel_12 (abfd, reloc_entry, symbol, data, input_section,
{
return coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data,
input_section, output_bfd, error_message,
- b12);
+ b9);
}
+#endif /* not ARM_WINCE */
static bfd_reloc_status_type
-coff_thumb_pcrel_9 (abfd, reloc_entry, symbol, data, input_section,
+coff_thumb_pcrel_12 (abfd, reloc_entry, symbol, data, input_section,
output_bfd, error_message)
bfd *abfd;
arelent *reloc_entry;
@@ -846,7 +852,7 @@ coff_thumb_pcrel_9 (abfd, reloc_entry, symbol, data, input_section,
{
return coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data,
input_section, output_bfd, error_message,
- b9);
+ b12);
}
static const struct reloc_howto_struct *
@@ -900,6 +906,13 @@ coff_arm_reloc_type_lookup (abfd, code)
#define BADMAG(x) ARMBADMAG(x)
#define ARM 1 /* Customize coffcode.h */
+#ifndef ARM_WINCE
+/* Make sure that the 'r_offset' field is copied properly
+ so that identical binaries will compare the same. */
+#define SWAP_IN_RELOC_OFFSET H_GET_32
+#define SWAP_OUT_RELOC_OFFSET H_PUT_32
+#endif
+
/* Extend the coff_link_hash_table structure with a few ARM specific fields.
This allows us to store global data here without actually creating any
global variables, which is a no-no in the BFD world. */
@@ -934,14 +947,14 @@ coff_arm_link_hash_table_create (abfd)
struct coff_arm_link_hash_table * ret;
bfd_size_type amt = sizeof (struct coff_arm_link_hash_table);
- ret = (struct coff_arm_link_hash_table *) bfd_alloc (abfd, amt);
+ ret = (struct coff_arm_link_hash_table *) bfd_malloc (amt);
if (ret == (struct coff_arm_link_hash_table *) NULL)
return NULL;
if (! _bfd_coff_link_hash_table_init
(& ret->root, abfd, _bfd_coff_link_hash_newfunc))
{
- bfd_release (abfd, ret);
+ free (ret);
return (struct bfd_link_hash_table *) NULL;
}
@@ -970,6 +983,7 @@ arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset)
}
+#ifndef ARM_WINCE
/* 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
can occur in any order. So given a thumb form of long branch, and an
@@ -1026,6 +1040,7 @@ insert_thumb_branch (br_insn, rel_off)
return br_insn;
}
+
static struct coff_link_hash_entry *
find_thumb_glue (info, name, input_bfd)
@@ -1055,6 +1070,7 @@ find_thumb_glue (info, name, input_bfd)
return myh;
}
+#endif /* not ARM_WINCE */
static struct coff_link_hash_entry *
find_arm_glue (info, name, input_bfd)
@@ -1909,6 +1925,7 @@ record_arm_to_thumb_glue (info, h)
return;
}
+#ifndef ARM_WINCE
static void
record_thumb_to_arm_glue (info, h)
struct bfd_link_info * info;
@@ -1982,6 +1999,7 @@ record_thumb_to_arm_glue (info, h)
return;
}
+#endif /* not ARM_WINCE */
/* Select a BFD to be used to hold the sections used by the glue code.
This function is called from the linker scripts in ld/emultempl/