X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gas%2Fconfig%2Ftc-openrisc.c;h=b27e022fecd1d66517c7ab0b93f382217ce01044;hb=ebd1c8757cf3f32daffe2615cbb778e495ebe412;hp=726b583d7422a7697cc9ff57a97af79c863361b2;hpb=717acf4b26d931f952cbe49fd428807d6599c73e;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/config/tc-openrisc.c b/gas/config/tc-openrisc.c index 726b583d74..b27e022fec 100644 --- a/gas/config/tc-openrisc.c +++ b/gas/config/tc-openrisc.c @@ -1,5 +1,5 @@ /* tc-openrisc.c -- Assembler for the OpenRISC family. - Copyright 2001, 2002 Free Software Foundation. + Copyright 2001, 2002, 2003, 2005, 2006 Free Software Foundation. Contributed by Johan Rydberg, jrydberg@opencores.org This file is part of GAS, the GNU Assembler. @@ -16,10 +16,9 @@ You should have received a copy of the GNU General Public License along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + the Free Software Foundation, 51 Franklin Street - Fifth Floor, + Boston, MA 02110-1301, USA. */ -#include #include "as.h" #include "subsegs.h" #include "symcat.h" @@ -70,24 +69,18 @@ size_t md_longopts_size = sizeof (md_longopts); unsigned long openrisc_machine = 0; /* default */ int -md_parse_option (c, arg) - int c ATTRIBUTE_UNUSED; - char * arg ATTRIBUTE_UNUSED; +md_parse_option (int c ATTRIBUTE_UNUSED, char * arg ATTRIBUTE_UNUSED) { return 0; } void -md_show_usage (stream) - FILE * stream ATTRIBUTE_UNUSED; +md_show_usage (FILE * stream ATTRIBUTE_UNUSED) { } -static void ignore_pseudo PARAMS ((int)); - static void -ignore_pseudo (val) - int val ATTRIBUTE_UNUSED; +ignore_pseudo (int val ATTRIBUTE_UNUSED) { discard_rest_of_line (); } @@ -106,7 +99,7 @@ const pseudo_typeS md_pseudo_table[] = void -md_begin () +md_begin (void) { /* Initialize the `cgen' interface. */ @@ -122,8 +115,7 @@ md_begin () } void -md_assemble (str) - char * str; +md_assemble (char * str) { static int last_insn_had_delay_slot = 0; openrisc_insn insn; @@ -145,14 +137,6 @@ md_assemble (str) gas_cgen_finish_insn (insn.insn, insn.buffer, CGEN_FIELDS_BITSIZE (& insn.fields), 1, NULL); -#if 0 /* Currently disabled */ - /* Warn about invalid insns in delay slots. */ - if (last_insn_had_delay_slot - && CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_NOT_IN_DELAY_SLOT)) - as_warn (_("Instruction %s not allowed in a delay slot."), - CGEN_INSN_NAME (insn.insn)); -#endif - last_insn_had_delay_slot = CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_DELAY_SLOT); } @@ -162,8 +146,7 @@ md_assemble (str) We just ignore it. */ void -md_operand (expressionP) - expressionS * expressionP; +md_operand (expressionS * expressionP) { if (* input_line_pointer == '#') { @@ -173,17 +156,14 @@ md_operand (expressionP) } valueT -md_section_align (segment, size) - segT segment; - valueT size; +md_section_align (segT segment, valueT size) { int align = bfd_get_section_alignment (stdoutput, segment); return ((size + (1 << align) - 1) & (-1 << align)); } symbolS * -md_undefined_symbol (name) - char * name ATTRIBUTE_UNUSED; +md_undefined_symbol (char * name ATTRIBUTE_UNUSED) { return 0; } @@ -219,49 +199,6 @@ const relax_typeS md_relax_table[] = {0x2000000 - 1 - 2, -0x2000000 - 2, 4, 0 } }; -long -openrisc_relax_frag (segment, fragP, stretch) - segT segment; - fragS * fragP; - long stretch; -{ - /* Address of branch insn. */ - long address = fragP->fr_address + fragP->fr_fix - 2; - long growth = 0; - - /* Keep 32 bit insns aligned on 32 bit boundaries. */ - if (fragP->fr_subtype == 2) - { - if ((address & 3) != 0) - { - fragP->fr_subtype = 3; - growth = 2; - } - } - else if (fragP->fr_subtype == 3) - { - if ((address & 3) == 0) - { - fragP->fr_subtype = 2; - growth = -2; - } - } - else - { - growth = relax_frag (segment, fragP, stretch); - - /* Long jump on odd halfword boundary? */ - if (fragP->fr_subtype == 2 && (address & 3) != 0) - { - fragP->fr_subtype = 3; - growth += 2; - } - } - - return growth; -} - - /* Return an initial guess of the length by which a fragment must grow to hold a branch to reach its destination. Also updates fr_type/fr_subtype as necessary. @@ -274,9 +211,7 @@ openrisc_relax_frag (segment, fragP, stretch) 0 value. */ int -md_estimate_size_before_relax (fragP, segment) - fragS * fragP; - segT segment; +md_estimate_size_before_relax (fragS * fragP, segT segment) { /* The only thing we have to handle here are symbols outside of the current segment. They may be undefined or in a different segment in @@ -304,7 +239,7 @@ md_estimate_size_before_relax (fragP, segment) if ((strcmp (CGEN_INSN_MNEMONIC (insn), CGEN_INSN_MNEMONIC (fragP->fr_cgen.insn)) == 0) - && CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAX)) + && CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAXED)) break; } if (i == 4) @@ -326,10 +261,9 @@ md_estimate_size_before_relax (fragP, segment) fragP->fr_subtype is the subtype of what the address relaxed to. */ void -md_convert_frag (abfd, sec, fragP) - bfd * abfd ATTRIBUTE_UNUSED; - segT sec ATTRIBUTE_UNUSED; - fragS * fragP ATTRIBUTE_UNUSED; +md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, + segT sec ATTRIBUTE_UNUSED, + fragS * fragP ATTRIBUTE_UNUSED) { /* FIXME */ } @@ -341,18 +275,14 @@ md_convert_frag (abfd, sec, fragP) given a PC relative reloc. */ long -md_pcrel_from_section (fixP, sec) - fixS * fixP; - segT sec; +md_pcrel_from_section (fixS * fixP, segT sec) { if (fixP->fx_addsy != (symbolS *) NULL && (! S_IS_DEFINED (fixP->fx_addsy) || S_GET_SEGMENT (fixP->fx_addsy) != sec)) - { - /* The symbol is undefined (or is defined but not in this section). - Let the linker figure it out. */ - return 0; - } + /* The symbol is undefined (or is defined but not in this section). + Let the linker figure it out. */ + return 0; return (fixP->fx_frag->fr_address + fixP->fx_where) & ~1; } @@ -363,10 +293,9 @@ md_pcrel_from_section (fixP, sec) *FIXP may be modified if desired. */ bfd_reloc_code_real_type -md_cgen_lookup_reloc (insn, operand, fixP) - const CGEN_INSN * insn ATTRIBUTE_UNUSED; - const CGEN_OPERAND * operand; - fixS * fixP; +md_cgen_lookup_reloc (const CGEN_INSN * insn ATTRIBUTE_UNUSED, + const CGEN_OPERAND * operand, + fixS * fixP) { bfd_reloc_code_real_type type; @@ -398,31 +327,11 @@ md_cgen_lookup_reloc (insn, operand, fixP) return BFD_RELOC_NONE; } - -/* See whether we need to force a relocation into the output file. - This is used to force out switch and PC relative relocations when - relaxing. */ - -int -openrisc_force_relocation (fix) - fixS * fix ATTRIBUTE_UNUSED; -{ - if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT - || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY) - return 1; - - return S_FORCE_RELOC (fix->fx_addsy); -} - - /* Write a value out to the object file, using the appropriate endianness. */ void -md_number_to_chars (buf, val, n) - char * buf; - valueT val; - int n; +md_number_to_chars (char * buf, valueT val, int n) { number_to_chars_bigendian (buf, val, n); } @@ -436,10 +345,7 @@ md_number_to_chars (buf, val, n) #define MAX_LITTLENUMS 6 char * -md_atof (type, litP, sizeP) - char type; - char * litP; - int * sizeP; +md_atof (int type, char * litP, int * sizeP) { int i; int prec; @@ -485,16 +391,12 @@ md_atof (type, litP, sizeP) } bfd_boolean -openrisc_fix_adjustable (fixP) - fixS * fixP; +openrisc_fix_adjustable (fixS * fixP) { - /* We need the symbol name for the VTABLE entries */ + /* We need the symbol name for the VTABLE entries. */ if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 0; return 1; } - - -