aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-sh.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-08-11 01:25:29 +0000
committerAlan Modra <amodra@gmail.com>2005-08-11 01:25:29 +0000
commit7be1c4891a2036c31e706908d43f33f7f59ae5a9 (patch)
tree14d7dd4e6c2294b9caad043708967bfc01fdfd8a /gas/config/tc-sh.c
parentf7348dad420052e467f39c9f80cbb396c7b8942e (diff)
downloadfsf-binutils-gdb-7be1c4891a2036c31e706908d43f33f7f59ae5a9.zip
fsf-binutils-gdb-7be1c4891a2036c31e706908d43f33f7f59ae5a9.tar.gz
fsf-binutils-gdb-7be1c4891a2036c31e706908d43f33f7f59ae5a9.tar.bz2
* README-vms: Delete.
* config-gas.com: Delete. * makefile.vms: Delete. * vmsconf.sh: Delete. * config/atof-tahoe.c: Delete. * config/m88k-opcode.h: Delete. * config/obj-bout.c: Delete. * config/obj-bout.h: Delete. * config/obj-hp300.c: Delete. * config/obj-hp300.h: Delete. * config/tc-a29k.c: Delete. * config/tc-a29k.h: Delete. * config/tc-h8500.c: Delete. * config/tc-h8500.h: Delete. * config/tc-m88k.c: Delete. * config/tc-m88k.h: Delete. * config/tc-tahoe.c: Delete. * config/tc-tahoe.h: Delete. * config/tc-tic80.c: Delete. * config/tc-tic80.h: Delete. * config/tc-w65.c: Delete. * config/tc-w65.h: Delete. * config/te-aux.h: Delete. * config/te-delt88.h: Delete. * config/te-delta.h: Delete. * config/te-dpx2.h: Delete. * config/te-hp300.h: Delete. * config/te-ic960.h: Delete. * config/vms-a-conf.h: Delete. * doc/c-a29k.texi: Delete. * doc/c-h8500.texi: Delete. * doc/c-m88k.texi: Delete. * README: Remove obsolete examples, and list of supported targets. * Makefile.am: Remove a29k, h8500, m88k, tahoe, tic80, w65, bout and hp300 support. (DEP_FLAGS): Don't define BFD_ASSEMBLER. * configure.in: Remove --enable-bfd-assembler, need_bfd, primary_bfd_gas. * configure.tgt: Remove a29k, h8300-coff, h8500-*, i960 non-elf, m68k non bfd, m88k, or32-coff, tic80-*, vax non-bfd, w65k-*, *-nindy. * as.c: Remove all non-BFD_ASSEMBLER code, support for above targets. * as.h: Likewise. * dw2gencfi.c: Likewise. * dwarf2dbg.c: Likewise. * ehopt.c: Likewise. * input-file.c: Likewise. * listing.c: Likewise. * literal.c: Likewise. * messages.c: Likewise. * obj.h: Likewise. * output-file.c: Likewise. * read.c: Likewise. * stabs.c: Likewise. * struc-symbol.h: Likewise. * subsegs.c: Likewise. * subsegs.h: Likewise. * symbols.c: Likewise. * symbols.h: Likewise. * tc.h: Likewise. * write.c: Likewise. * write.h: Likewise. * config/aout_gnu.h: Likewise. * config/obj-aout.c: Likewise. * config/obj-aout.h: Likewise. * config/obj-coff.c: Likewise. * config/obj-coff.h: Likewise. * config/obj-evax.h: Likewise. * config/obj-ieee.h: Likewise. * config/tc-arm.c: Likewise. * config/tc-arm.h: Likewise. * config/tc-avr.c: Likewise. * config/tc-avr.h: Likewise. * config/tc-crx.h: Likewise. * config/tc-d10v.h: Likewise. * config/tc-d30v.h: Likewise. * config/tc-dlx.h: Likewise. * config/tc-fr30.h: Likewise. * config/tc-frv.h: Likewise. * config/tc-h8300.c: Likewise. * config/tc-h8300.h: Likewise. * config/tc-hppa.h: Likewise. * config/tc-i370.h: Likewise. * config/tc-i386.c: Likewise. * config/tc-i386.h: Likewise. * config/tc-i860.h: Likewise. * config/tc-i960.c: Likewise. * config/tc-i960.h: Likewise. * config/tc-ip2k.h: Likewise. * config/tc-iq2000.h: Likewise. * config/tc-m32c.h: Likewise. * config/tc-m32r.h: Likewise. * config/tc-m68hc11.h: Likewise. * config/tc-m68k.c: Likewise. * config/tc-m68k.h: Likewise. * config/tc-maxq.c: Likewise. * config/tc-maxq.h: Likewise. * config/tc-mcore.c: Likewise. * config/tc-mcore.h: Likewise. * config/tc-mn10200.h: Likewise. * config/tc-mn10300.c: Likewise. * config/tc-mn10300.h: Likewise. * config/tc-ms1.h: Likewise. * config/tc-msp430.c: Likewise. * config/tc-msp430.h: Likewise. * config/tc-ns32k.c: Likewise. * config/tc-ns32k.h: Likewise. * config/tc-openrisc.h: Likewise. * config/tc-or32.c: Likewise. * config/tc-or32.h: Likewise. * config/tc-ppc.c: Likewise. * config/tc-ppc.h: Likewise. * config/tc-s390.h: Likewise. * config/tc-sh.c: Likewise. * config/tc-sh.h: Likewise. * config/tc-sparc.c: Likewise. * config/tc-tic30.c: Likewise. * config/tc-tic30.h: Likewise. * config/tc-tic4x.c: Likewise. * config/tc-tic4x.h: Likewise. * config/tc-tic54x.c: Likewise. * config/tc-tic54x.h: Likewise. * config/tc-v850.h: Likewise. * config/tc-vax.c: Likewise. * config/tc-vax.h: Likewise. * config/tc-xstormy16.h: Likewise. * config/tc-xtensa.h: Likewise. * config/tc-z8k.c: Likewise. * config/tc-z8k.h: Likewise. * config/vms-a-conf.h * doc/Makefile.am: Likewise. * doc/all.texi: Likewise. * doc/as.texinfo: Likewise. * doc/Makefile.in: Regenerate. * Makefile.in: Regenerate. * configure: Regenerate. * config.in: Regenerate. * po/POTFILES.in: Regenerate.
Diffstat (limited to 'gas/config/tc-sh.c')
-rw-r--r--gas/config/tc-sh.c251
1 files changed, 5 insertions, 246 deletions
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index b8248a1..27ccdee 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -124,8 +124,6 @@ const pseudo_typeS md_pseudo_table[] =
{0, 0, 0}
};
-/*int md_reloc_size; */
-
int sh_relax; /* set if -relax seen */
/* Whether -small was seen. */
@@ -2871,9 +2869,7 @@ md_assemble (char *str)
}
}
-#ifdef BFD_ASSEMBLER
dwarf2_emit_insn (size);
-#endif
}
/* This routine is called each time a label definition is seen. It
@@ -2922,24 +2918,6 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
return 0;
}
-#ifdef OBJ_COFF
-#ifndef BFD_ASSEMBLER
-
-void
-tc_crawl_symbol_chain (object_headers *headers ATTRIBUTE_UNUSED)
-{
- printf (_("call to tc_crawl_symbol_chain \n"));
-}
-
-void
-tc_headers_hook (object_headers *headers ATTRIBUTE_UNUSED)
-{
- printf (_("call to tc_headers_hook \n"));
-}
-
-#endif
-#endif
-
/* Various routines to kill one day. */
/* Equal to MAX_PRECISION in atof-ieee.c. */
#define MAX_LITTLENUMS 6
@@ -3245,8 +3223,7 @@ struct sh_count_relocs
};
/* Count the number of fixups in a section which refer to a particular
- symbol. When using BFD_ASSEMBLER, this is called via
- bfd_map_over_sections. */
+ symbol. This is called via bfd_map_over_sections. */
static void
sh_count_relocs (bfd *abfd ATTRIBUTE_UNUSED, segT sec, void *data)
@@ -3271,8 +3248,8 @@ sh_count_relocs (bfd *abfd ATTRIBUTE_UNUSED, segT sec, void *data)
}
}
-/* Handle the count relocs for a particular section. When using
- BFD_ASSEMBLER, this is called via bfd_map_over_sections. */
+/* Handle the count relocs for a particular section.
+ This is called via bfd_map_over_sections. */
static void
sh_frob_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec,
@@ -3302,9 +3279,6 @@ sh_frob_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec,
|| fix->fx_subsy != NULL
|| fix->fx_addnumber != 0
|| S_GET_SEGMENT (sym) != sec
-#if ! defined (BFD_ASSEMBLER) && defined (OBJ_COFF)
- || S_GET_STORAGE_CLASS (sym) == C_EXT
-#endif
|| S_IS_EXTERNAL (sym))
{
as_warn_where (fix->fx_file, fix->fx_line,
@@ -3344,9 +3318,6 @@ sh_frob_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec,
|| fscan->fx_subsy != NULL
|| fscan->fx_addnumber != 0
|| S_GET_SEGMENT (sym) != sec
-#if ! defined (BFD_ASSEMBLER) && defined (OBJ_COFF)
- || S_GET_STORAGE_CLASS (sym) == C_EXT
-#endif
|| S_IS_EXTERNAL (sym))
{
as_warn_where (fix->fx_file, fix->fx_line,
@@ -3358,16 +3329,7 @@ sh_frob_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec,
counting the number of times we find a reference to sym. */
info.sym = sym;
info.count = 0;
-#ifdef BFD_ASSEMBLER
bfd_map_over_sections (stdoutput, sh_count_relocs, &info);
-#else
- {
- int iscan;
-
- for (iscan = SEG_E0; iscan < SEG_UNKNOWN; iscan++)
- sh_count_relocs ((bfd *) NULL, iscan, &info);
- }
-#endif
if (info.count < 1)
abort ();
@@ -3402,28 +3364,14 @@ sh_frob_file (void)
if (! sh_relax)
return;
-#ifdef BFD_ASSEMBLER
bfd_map_over_sections (stdoutput, sh_frob_section, NULL);
-#else
- {
- int iseg;
-
- for (iseg = SEG_E0; iseg < SEG_UNKNOWN; iseg++)
- sh_frob_section ((bfd *) NULL, iseg, NULL);
- }
-#endif
}
/* Called after relaxing. Set the correct sizes of the fragments, and
create relocs so that md_apply_fix will fill in the correct values. */
void
-#ifdef BFD_ASSEMBLER
md_convert_frag (bfd *headers ATTRIBUTE_UNUSED, segT seg, fragS *fragP)
-#else
-md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, segT seg,
- fragS *fragP)
-#endif
{
int donerelax = 0;
@@ -3496,12 +3444,7 @@ md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, segT seg,
/* Build a relocation to six / four bytes farther on. */
subseg_change (seg, 0);
- fix_new (fragP, fragP->fr_fix, 2,
-#ifdef BFD_ASSEMBLER
- section_symbol (seg),
-#else
- seg_info (seg)->dot,
-#endif
+ fix_new (fragP, fragP->fr_fix, 2, section_symbol (seg),
fragP->fr_address + fragP->fr_fix + (delay ? 4 : 6),
1, BFD_RELOC_SH_PCDISP8BY2);
@@ -3568,17 +3511,12 @@ md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, segT seg,
valueT
md_section_align (segT seg ATTRIBUTE_UNUSED, valueT size)
{
-#ifdef BFD_ASSEMBLER
#ifdef OBJ_ELF
return size;
#else /* ! OBJ_ELF */
return ((size + (1 << bfd_get_section_alignment (stdoutput, seg)) - 1)
& (-1 << bfd_get_section_alignment (stdoutput, seg)));
#endif /* ! OBJ_ELF */
-#else /* ! BFD_ASSEMBLER */
- return ((size + (1 << section_alignment[(int) seg]) - 1)
- & (-1 << section_alignment[(int) seg]));
-#endif /* ! BFD_ASSEMBLER */
}
/* This static variable is set by s_uacons to tell sh_cons_align that
@@ -3803,7 +3741,6 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
long max, min;
int shift;
-#ifdef BFD_ASSEMBLER
/* A difference between two symbols, the second of which is in the
current section, is transformed in a PC-relative relocation to
the other symbol. We have to adjust the relocation type here. */
@@ -3849,24 +3786,9 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
&& fixP->fx_addsy != NULL
&& S_IS_WEAK (fixP->fx_addsy))
val -= S_GET_VALUE (fixP->fx_addsy);
-#endif
-#ifdef BFD_ASSEMBLER
if (SWITCH_TABLE (fixP))
val -= S_GET_VALUE (fixP->fx_subsy);
-#else
- if (fixP->fx_r_type == 0)
- {
- if (fixP->fx_size == 2)
- fixP->fx_r_type = BFD_RELOC_16;
- else if (fixP->fx_size == 4)
- fixP->fx_r_type = BFD_RELOC_32;
- else if (fixP->fx_size == 1)
- fixP->fx_r_type = BFD_RELOC_8;
- else
- abort ();
- }
-#endif
max = min = 0;
shift = 0;
@@ -4207,8 +4129,7 @@ md_number_to_chars (char *ptr, valueT use, int nbytes)
number_to_chars_bigendian (ptr, use, nbytes);
}
-/* This version is used in obj-coff.c when not using BFD_ASSEMBLER.
- eg for the sh-hms target. */
+/* This version is used in obj-coff.c eg. for the sh-hms target. */
long
md_pcrel_from (fixS *fixP)
@@ -4234,167 +4155,6 @@ md_pcrel_from_section (fixS *fixP, segT sec)
return md_pcrel_from (fixP);
}
-#ifdef OBJ_COFF
-
-int
-tc_coff_sizemachdep (fragS *frag)
-{
- return md_relax_table[frag->fr_subtype].rlx_length;
-}
-
-#endif /* OBJ_COFF */
-
-#ifndef BFD_ASSEMBLER
-#ifdef OBJ_COFF
-
-/* Map BFD relocs to SH COFF relocs. */
-
-struct reloc_map
-{
- bfd_reloc_code_real_type bfd_reloc;
- int sh_reloc;
-};
-
-static const struct reloc_map coff_reloc_map[] =
-{
- { BFD_RELOC_32, R_SH_IMM32 },
- { BFD_RELOC_16, R_SH_IMM16 },
- { BFD_RELOC_8, R_SH_IMM8 },
- { BFD_RELOC_SH_PCDISP8BY2, R_SH_PCDISP8BY2 },
- { BFD_RELOC_SH_PCDISP12BY2, R_SH_PCDISP },
- { BFD_RELOC_SH_IMM4, R_SH_IMM4 },
- { BFD_RELOC_SH_IMM4BY2, R_SH_IMM4BY2 },
- { BFD_RELOC_SH_IMM4BY4, R_SH_IMM4BY4 },
- { BFD_RELOC_SH_IMM8, R_SH_IMM8 },
- { BFD_RELOC_SH_IMM8BY2, R_SH_IMM8BY2 },
- { BFD_RELOC_SH_IMM8BY4, R_SH_IMM8BY4 },
- { BFD_RELOC_SH_PCRELIMM8BY2, R_SH_PCRELIMM8BY2 },
- { BFD_RELOC_SH_PCRELIMM8BY4, R_SH_PCRELIMM8BY4 },
- { BFD_RELOC_8_PCREL, R_SH_SWITCH8 },
- { BFD_RELOC_SH_SWITCH16, R_SH_SWITCH16 },
- { BFD_RELOC_SH_SWITCH32, R_SH_SWITCH32 },
- { BFD_RELOC_SH_USES, R_SH_USES },
- { BFD_RELOC_SH_COUNT, R_SH_COUNT },
- { BFD_RELOC_SH_ALIGN, R_SH_ALIGN },
- { BFD_RELOC_SH_CODE, R_SH_CODE },
- { BFD_RELOC_SH_DATA, R_SH_DATA },
- { BFD_RELOC_SH_LABEL, R_SH_LABEL },
- { BFD_RELOC_UNUSED, 0 }
-};
-
-/* Adjust a reloc for the SH. This is similar to the generic code,
- but does some minor tweaking. */
-
-void
-sh_coff_reloc_mangle (segment_info_type *seg, fixS *fix,
- struct internal_reloc *intr, unsigned int paddr)
-{
- symbolS *symbol_ptr = fix->fx_addsy;
- symbolS *dot;
-
- intr->r_vaddr = paddr + fix->fx_frag->fr_address + fix->fx_where;
-
- if (! SWITCH_TABLE (fix))
- {
- const struct reloc_map *rm;
-
- for (rm = coff_reloc_map; rm->bfd_reloc != BFD_RELOC_UNUSED; rm++)
- if (rm->bfd_reloc == (bfd_reloc_code_real_type) fix->fx_r_type)
- break;
- if (rm->bfd_reloc == BFD_RELOC_UNUSED)
- as_bad_where (fix->fx_file, fix->fx_line,
- _("Can not represent %s relocation in this object file format"),
- bfd_get_reloc_code_name (fix->fx_r_type));
- intr->r_type = rm->sh_reloc;
- intr->r_offset = 0;
- }
- else
- {
- know (sh_relax);
-
- if (fix->fx_r_type == BFD_RELOC_16)
- intr->r_type = R_SH_SWITCH16;
- else if (fix->fx_r_type == BFD_RELOC_8)
- intr->r_type = R_SH_SWITCH8;
- else if (fix->fx_r_type == BFD_RELOC_32)
- intr->r_type = R_SH_SWITCH32;
- else
- abort ();
-
- /* For a switch reloc, we set r_offset to the difference between
- the reloc address and the subtrahend. When the linker is
- doing relaxing, it can use the determine the starting and
- ending points of the switch difference expression. */
- intr->r_offset = intr->r_vaddr - S_GET_VALUE (fix->fx_subsy);
- }
-
- /* PC relative relocs are always against the current section. */
- if (symbol_ptr == NULL)
- {
- switch (fix->fx_r_type)
- {
- case BFD_RELOC_SH_PCRELIMM8BY2:
- case BFD_RELOC_SH_PCRELIMM8BY4:
- case BFD_RELOC_SH_PCDISP8BY2:
- case BFD_RELOC_SH_PCDISP12BY2:
- case BFD_RELOC_SH_USES:
- symbol_ptr = seg->dot;
- break;
- default:
- break;
- }
- }
-
- if (fix->fx_r_type == BFD_RELOC_SH_USES)
- {
- /* We can't store the offset in the object file, since this
- reloc does not take up any space, so we store it in r_offset.
- The fx_addnumber field was set in md_apply_fix. */
- intr->r_offset = fix->fx_addnumber;
- }
- else if (fix->fx_r_type == BFD_RELOC_SH_COUNT)
- {
- /* We can't store the count in the object file, since this reloc
- does not take up any space, so we store it in r_offset. The
- fx_offset field was set when the fixup was created in
- sh_coff_frob_file. */
- intr->r_offset = fix->fx_offset;
- /* This reloc is always absolute. */
- symbol_ptr = NULL;
- }
- else if (fix->fx_r_type == BFD_RELOC_SH_ALIGN)
- {
- /* Store the alignment in the r_offset field. */
- intr->r_offset = fix->fx_offset;
- /* This reloc is always absolute. */
- symbol_ptr = NULL;
- }
- else if (fix->fx_r_type == BFD_RELOC_SH_CODE
- || fix->fx_r_type == BFD_RELOC_SH_DATA
- || fix->fx_r_type == BFD_RELOC_SH_LABEL)
- {
- /* These relocs are always absolute. */
- symbol_ptr = NULL;
- }
-
- /* Turn the segment of the symbol into an offset. */
- if (symbol_ptr != NULL)
- {
- dot = segment_info[S_GET_SEGMENT (symbol_ptr)].dot;
- if (dot != NULL)
- intr->r_symndx = dot->sy_number;
- else
- intr->r_symndx = symbol_ptr->sy_number;
- }
- else
- intr->r_symndx = -1;
-}
-
-#endif /* OBJ_COFF */
-#endif /* ! BFD_ASSEMBLER */
-
-#ifdef BFD_ASSEMBLER
-
/* Create a reloc. */
arelent *
@@ -4610,4 +4370,3 @@ sh_regname_to_dw2regnum (const char *regname)
return regnum;
}
#endif /* OBJ_ELF */
-#endif /* BFD_ASSEMBLER */