summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/bfd/coff-sh.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-11-02 20:45:59 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-11-02 20:45:59 +0000
commit56301d46413bee335c617ed8e6e32080e4ffaba7 (patch)
tree6a4c4eeffd92f1d9f6394e2d5fa08301fa0b79b1 /gnu/usr.bin/binutils/bfd/coff-sh.c
parent21ca5604689b35171671ce1ed04c5faccc82e0cd (diff)
Merge conflicts, bringing our changes back in:
- extra $(SHELL) and sugar for make (so that files not mode +x still work) - safer temp file handling - our W^X binary layout changes in ld - OpenBSD policy for library file selection in ld - arm and m88k changes which were not merged in time for official 2.15 - bfd core file handling - a couple typos New for 2.15: - ld(1) and as(1) manpages now generated at build time - binutils/stabs.c reverted to use our in-tree libiberty for now - we still use our VIA C3 crypto code over stock binutils, as it recognizes more instructions - new emulations for OpenBSD on mips64 machines, to help OpenBSD/sgi - relaxed %f# handling in gas on OpenBSD/sparc64 (same as was in 2.14) Tested on all platforms by various people; special thanks to sturm@ and otto@.
Diffstat (limited to 'gnu/usr.bin/binutils/bfd/coff-sh.c')
-rw-r--r--gnu/usr.bin/binutils/bfd/coff-sh.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/gnu/usr.bin/binutils/bfd/coff-sh.c b/gnu/usr.bin/binutils/bfd/coff-sh.c
index bcf059d299e..d78cc16d681 100644
--- a/gnu/usr.bin/binutils/bfd/coff-sh.c
+++ b/gnu/usr.bin/binutils/bfd/coff-sh.c
@@ -706,7 +706,7 @@ sh_relax_section (abfd, sec, link_info, again)
*again = FALSE;
- if (link_info->relocateable
+ if (link_info->relocatable
|| (sec->flags & SEC_RELOC) == 0
|| sec->reloc_count == 0)
return TRUE;
@@ -1647,6 +1647,8 @@ struct sh_opcode
#define SETSAS (0x40000)
#define SETSAS_REG(x) USESAS_REG (x)
+#define MAP(a) a, sizeof a / sizeof a[0]
+
#ifndef COFF_IMAGE_WITH_PE
static bfd_boolean sh_insn_uses_reg
PARAMS ((unsigned int, const struct sh_opcode *, unsigned int));
@@ -1666,10 +1668,8 @@ static bfd_boolean sh_insns_conflict
static bfd_boolean sh_load_use
PARAMS ((unsigned int, const struct sh_opcode *, unsigned int,
const struct sh_opcode *));
-#endif
-/* The opcode maps. */
-#define MAP(a) a, sizeof a / sizeof a[0]
+/* The opcode maps. */
static const struct sh_opcode sh_opcode00[] =
{
@@ -2089,7 +2089,6 @@ static const struct sh_minor_opcode sh_opcodef[] =
{ MAP (sh_opcodef1), 0xf0ff }
};
-#ifndef COFF_IMAGE_WITH_PE
static struct sh_major_opcode sh_opcodes[] =
{
{ MAP (sh_opcode0) },
@@ -2109,7 +2108,6 @@ static struct sh_major_opcode sh_opcodes[] =
{ MAP (sh_opcodee) },
{ MAP (sh_opcodef) }
};
-#endif
/* The double data transfer / parallel processing insns are not
described here. This will cause sh_align_load_span to leave them alone. */
@@ -2131,7 +2129,6 @@ static const struct sh_minor_opcode sh_dsp_opcodef[] =
{ MAP (sh_dsp_opcodef0), 0xfc0d }
};
-#ifndef COFF_IMAGE_WITH_PE
/* Given an instruction, return a pointer to the corresponding
sh_opcode structure. Return NULL if the instruction is not
recognized. */
@@ -2969,7 +2966,7 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
+ sec->output_section->vma
+ sec->output_offset);
}
- else if (! info->relocateable)
+ else if (! info->relocatable)
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
@@ -3024,12 +3021,12 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
static bfd_byte *
sh_coff_get_relocated_section_contents (output_bfd, link_info, link_order,
- data, relocateable, symbols)
+ data, relocatable, symbols)
bfd *output_bfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
- bfd_boolean relocateable;
+ bfd_boolean relocatable;
asymbol **symbols;
{
asection *input_section = link_order->u.indirect.section;
@@ -3040,12 +3037,12 @@ sh_coff_get_relocated_section_contents (output_bfd, link_info, link_order,
/* We only need to handle the case of relaxing, or of having a
particular set of section contents, specially. */
- if (relocateable
+ if (relocatable
|| coff_section_data (input_bfd, input_section) == NULL
|| coff_section_data (input_bfd, input_section)->contents == NULL)
return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
link_order, data,
- relocateable,
+ relocatable,
symbols);
memcpy (data, coff_section_data (input_bfd, input_section)->contents,
@@ -3132,7 +3129,7 @@ sh_coff_get_relocated_section_contents (output_bfd, link_info, link_order,
/* The target vectors. */
#ifndef TARGET_SHL_SYM
-CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NULL)
+CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NULL, COFF_SWAP_TABLE)
#endif
#ifdef TARGET_SHL_SYM
@@ -3147,10 +3144,10 @@ CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NUL
#ifdef COFF_WITH_PE
CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE,
- SEC_CODE | SEC_DATA, '_', NULL);
+ SEC_CODE | SEC_DATA, '_', NULL, COFF_SWAP_TABLE);
#else
CREATE_LITTLE_COFF_TARGET_VEC (TARGET_SYM, TARGET_SHL_NAME, BFD_IS_RELAXABLE,
- 0, '_', NULL)
+ 0, '_', NULL, COFF_SWAP_TABLE)
#endif
#ifndef TARGET_SHL_SYM