diff options
author | obrien <obrien@FreeBSD.org> | 2001-06-26 16:57:43 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2001-06-26 16:57:43 +0000 |
commit | 60b05d1eadb3b7cb0cf980a058ea2b990809b562 (patch) | |
tree | d65d88745b7aa83ec7685d68feda6a9d22444856 /contrib/binutils/gas/config | |
parent | fe0162ddb333a821c9b9a30185eef37b46a06bc5 (diff) | |
parent | bc13a0c5958e501561da1e6b4a3ca1fadda52059 (diff) | |
download | FreeBSD-src-60b05d1eadb3b7cb0cf980a058ea2b990809b562.zip FreeBSD-src-60b05d1eadb3b7cb0cf980a058ea2b990809b562.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r78828,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/binutils/gas/config')
34 files changed, 434 insertions, 204 deletions
diff --git a/contrib/binutils/gas/config/aout_gnu.h b/contrib/binutils/gas/config/aout_gnu.h index 52ea70d..82d744b 100644 --- a/contrib/binutils/gas/config/aout_gnu.h +++ b/contrib/binutils/gas/config/aout_gnu.h @@ -1,6 +1,7 @@ /* This file is aout_gnu.h - Copyright (C) 1987-1992 Free Software Foundation, Inc. + Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 2000 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/atof-ieee.c b/contrib/binutils/gas/config/atof-ieee.c index 2a916cd..ce6afbb 100644 --- a/contrib/binutils/gas/config/atof-ieee.c +++ b/contrib/binutils/gas/config/atof-ieee.c @@ -1,5 +1,5 @@ /* atof_ieee.c - turn a Flonum into an IEEE floating point number - Copyright (C) 1987, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1987, 1992, 1994, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,6 +19,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Some float formats are based on the IEEE standard, but use the + largest exponent for normal numbers instead of NaNs and infinites. + The macro TC_LARGEST_EXPONENT_IS_NORMAL should evaluate to true + if the target machine uses such a format. The macro can depend on + command line flags if necessary. There is no need to define the + macro if it would always be 0. */ + #include "as.h" /* Flonums returned here. */ @@ -40,6 +47,10 @@ extern const char EXP_CHARS[]; /* Length in LittleNums of guard bits. */ #define GUARD (2) +#ifndef TC_LARGEST_EXPONENT_IS_NORMAL +#define TC_LARGEST_EXPONENT_IS_NORMAL 0 +#endif + static const unsigned long mask[] = { 0x00000000, @@ -291,6 +302,8 @@ gen_to_words (words, precision, exponent_bits) /* NaN: Do the right thing. */ if (generic_floating_point_number.sign == 0) { + if (TC_LARGEST_EXPONENT_IS_NORMAL) + as_warn ("NaNs are not supported by this target\n"); if (precision == F_PRECISION) { words[0] = 0x7fff; @@ -328,6 +341,9 @@ gen_to_words (words, precision, exponent_bits) } else if (generic_floating_point_number.sign == 'P') { + if (TC_LARGEST_EXPONENT_IS_NORMAL) + as_warn ("Infinities are not supported by this target\n"); + /* +INF: Do the right thing. */ if (precision == F_PRECISION) { @@ -366,6 +382,9 @@ gen_to_words (words, precision, exponent_bits) } else if (generic_floating_point_number.sign == 'N') { + if (TC_LARGEST_EXPONENT_IS_NORMAL) + as_warn ("Infinities are not supported by this target\n"); + /* Negative INF. */ if (precision == F_PRECISION) { @@ -578,7 +597,9 @@ gen_to_words (words, precision, exponent_bits) return return_value; } - else if ((unsigned long) exponent_4 >= mask[exponent_bits]) + else if ((unsigned long) exponent_4 > mask[exponent_bits] + || (! TC_LARGEST_EXPONENT_IS_NORMAL + && (unsigned long) exponent_4 == mask[exponent_bits])) { /* Exponent overflow. Lose immediately. */ diff --git a/contrib/binutils/gas/config/obj-aout.c b/contrib/binutils/gas/config/obj-aout.c index 67bb18e..9d4f24a 100644 --- a/contrib/binutils/gas/config/obj-aout.c +++ b/contrib/binutils/gas/config/obj-aout.c @@ -1,5 +1,5 @@ /* a.out object file format - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/obj-aout.h b/contrib/binutils/gas/config/obj-aout.h index d91cc48..54168d1 100644 --- a/contrib/binutils/gas/config/obj-aout.h +++ b/contrib/binutils/gas/config/obj-aout.h @@ -1,5 +1,5 @@ /* obj-aout.h, a.out object file format for gas, the assembler. - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 98, 99, 2000 + Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/obj-coff.c b/contrib/binutils/gas/config/obj-coff.c index e16e5df..69e5558 100644 --- a/contrib/binutils/gas/config/obj-coff.c +++ b/contrib/binutils/gas/config/obj-coff.c @@ -1,5 +1,6 @@ /* coff object file format - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS. @@ -445,12 +446,17 @@ add_lineno (frag, offset, num) { abort (); } + +#ifndef OBJ_XCOFF + /* The native aix assembler accepts negative line number */ + if (num <= 0) { /* Zero is used as an end marker in the file. */ as_warn (_("Line numbers must be positive integers\n")); num = 1; } +#endif /* OBJ_XCOFF */ new_line->next = line_nos; new_line->frag = frag; new_line->l.line_number = num; @@ -1434,7 +1440,7 @@ obj_coff_section (ignore) switch (*input_line_pointer) { case 'b': flags |= SEC_ALLOC; flags &=~ SEC_LOAD; break; - case 'n': flags &=~ SEC_LOAD; break; + case 'n': flags &=~ SEC_LOAD; flags |= SEC_NEVER_LOAD; break; case 'd': flags |= SEC_DATA | SEC_LOAD; /* fall through */ case 'w': flags &=~ SEC_READONLY; break; case 'x': flags |= SEC_CODE | SEC_LOAD; break; @@ -1487,8 +1493,8 @@ obj_coff_section (ignore) { /* This section's attributes have already been set. Warn if the attributes don't match. */ - flagword matchflags = SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE - | SEC_DATA | SEC_SHARED; + flagword matchflags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE + | SEC_DATA | SEC_SHARED | SEC_NEVER_LOAD); if ((flags ^ oldflags) & matchflags) as_warn (_("Ignoring changed section attributes for %s"), name); } @@ -2075,7 +2081,7 @@ fill_section (abfd, h, file_cursor) if (s->s_name[0]) { fragS *frag = segment_info[i].frchainP->frch_root; - char *buffer; + char *buffer = NULL; if (s->s_size == 0) s->s_scnptr = 0; @@ -3349,12 +3355,13 @@ do_linenos_for (abfd, h, file_cursor) line_ptr != (struct lineno_list *) NULL; line_ptr = line_ptr->next) { - if (line_ptr->line.l_lnno == 0) { - /* Turn a pointer to a symbol into the symbols' index */ - line_ptr->line.l_addr.l_symndx = - ((symbolS *) line_ptr->line.l_addr.l_symndx)->sy_number; + /* Turn a pointer to a symbol into the symbols' index, + provided that it has been initialised. */ + if (line_ptr->line.l_addr.l_symndx) + line_ptr->line.l_addr.l_symndx = + ((symbolS *) line_ptr->line.l_addr.l_symndx)->sy_number; } else { @@ -4056,10 +4063,10 @@ obj_coff_lcomm (ignore) } *p = 0; - symbolP = symbol_find_or_make(name); + symbolP = symbol_find_or_make (name); - if (S_GET_SEGMENT(symbolP) == SEG_UNKNOWN && - S_GET_VALUE(symbolP) == 0) + if (S_GET_SEGMENT (symbolP) == SEG_UNKNOWN && + S_GET_VALUE (symbolP) == 0) { if (! need_pass_2) { @@ -4073,14 +4080,14 @@ obj_coff_lcomm (ignore) (offsetT) temp, (char *) 0); *p = 0; subseg_set (current_seg, current_subseg); /* restore current seg */ - S_SET_SEGMENT(symbolP, SEG_E2); - S_SET_STORAGE_CLASS(symbolP, C_STAT); + S_SET_SEGMENT (symbolP, SEG_E2); + S_SET_STORAGE_CLASS (symbolP, C_STAT); } } else - as_bad(_("Symbol %s already defined"), name); + as_bad (_("Symbol %s already defined"), name); - demand_empty_rest_of_line(); + demand_empty_rest_of_line (); #endif } diff --git a/contrib/binutils/gas/config/obj-coff.h b/contrib/binutils/gas/config/obj-coff.h index 8cf7999..f862f77 100644 --- a/contrib/binutils/gas/config/obj-coff.h +++ b/contrib/binutils/gas/config/obj-coff.h @@ -1,5 +1,6 @@ /* coff object file format - Copyright (C) 1989, 90, 91, 92, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000 Free Software Foundation, Inc. This file is part of GAS. diff --git a/contrib/binutils/gas/config/obj-ecoff.c b/contrib/binutils/gas/config/obj-ecoff.c index 3f80e7d..d1eabce 100644 --- a/contrib/binutils/gas/config/obj-ecoff.c +++ b/contrib/binutils/gas/config/obj-ecoff.c @@ -1,5 +1,5 @@ /* ECOFF object file format. - Copyright (C) 1993, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Cygnus Support. This file was put together by Ian Lance Taylor <ian@cygnus.com>. @@ -95,7 +95,7 @@ const pseudo_typeS obj_pseudo_table[] = { "verstamp", s_ignore, 0 }, /* Sentinel. */ - { NULL } + { NULL, s_ignore, 0 } }; /* Swap out the symbols and debugging information for BFD. */ @@ -141,7 +141,7 @@ ecoff_frob_file () /* bss segment */ ".sbss", ".bss", }; -#define n_names (sizeof (names) / sizeof (names[0])) +#define n_names ((int) (sizeof (names) / sizeof (names[0]))) addr = 0; { @@ -272,7 +272,7 @@ obj_ecoff_set_ext (sym, ext) static int ecoff_sec_sym_ok_for_reloc (sec) - asection *sec; + asection *sec ATTRIBUTE_UNUSED; { return 1; } @@ -280,7 +280,7 @@ ecoff_sec_sym_ok_for_reloc (sec) static void obj_ecoff_frob_symbol (sym, puntp) symbolS *sym; - int *puntp; + int *puntp ATTRIBUTE_UNUSED; { ecoff_frob_symbol (sym); } diff --git a/contrib/binutils/gas/config/obj-ecoff.h b/contrib/binutils/gas/config/obj-ecoff.h index 8bca254..01a67d7 100644 --- a/contrib/binutils/gas/config/obj-ecoff.h +++ b/contrib/binutils/gas/config/obj-ecoff.h @@ -1,5 +1,6 @@ /* ECOFF object file format header file. - Copyright (C) 1993, 94, 95, 96, 97, 1999 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1999 + Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Ian Lance Taylor <ian@cygnus.com>. diff --git a/contrib/binutils/gas/config/obj-elf.c b/contrib/binutils/gas/config/obj-elf.c index d56eaa9..162f02f 100644 --- a/contrib/binutils/gas/config/obj-elf.c +++ b/contrib/binutils/gas/config/obj-elf.c @@ -1,5 +1,5 @@ /* ELF object file format - Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/obj-elf.h b/contrib/binutils/gas/config/obj-elf.h index 43daf64..8e3ce7d 100644 --- a/contrib/binutils/gas/config/obj-elf.h +++ b/contrib/binutils/gas/config/obj-elf.h @@ -1,5 +1,5 @@ /* ELF object file format. - Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/obj-generic.h b/contrib/binutils/gas/config/obj-generic.h index 00e4638..8cb8020 100644 --- a/contrib/binutils/gas/config/obj-generic.h +++ b/contrib/binutils/gas/config/obj-generic.h @@ -1,5 +1,6 @@ /* This file is obj-generic.h - Copyright (C) 1987-1992, 2000 Free Software Foundation, Inc. + Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 2000 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/obj-ieee.c b/contrib/binutils/gas/config/obj-ieee.c index 35b49da..521a0d7 100644 --- a/contrib/binutils/gas/config/obj-ieee.c +++ b/contrib/binutils/gas/config/obj-ieee.c @@ -1,5 +1,5 @@ /* obj-format for ieee-695 records. - Copyright (C) 1991, 92, 93, 94, 95, 97, 98, 2000 + Copyright 1991, 1992, 1993, 1994, 1997, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/obj-ieee.h b/contrib/binutils/gas/config/obj-ieee.h index fbef1cd..2652bc2 100644 --- a/contrib/binutils/gas/config/obj-ieee.h +++ b/contrib/binutils/gas/config/obj-ieee.h @@ -1,5 +1,6 @@ /* This file is obj-ieee.h - Copyright (C) 1987-1992, 2000 Free Software Foundation, Inc. + Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/obj-multi.h b/contrib/binutils/gas/config/obj-multi.h index 1d68a0c..225de2c 100644 --- a/contrib/binutils/gas/config/obj-multi.h +++ b/contrib/binutils/gas/config/obj-multi.h @@ -1,5 +1,5 @@ /* Multiple object format emulation. - Copyright (C) 1995, 96, 97, 99, 2000 + Copyright 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/tc-alpha.c b/contrib/binutils/gas/config/tc-alpha.c index ae42d95..ba42aaa 100644 --- a/contrib/binutils/gas/config/tc-alpha.c +++ b/contrib/binutils/gas/config/tc-alpha.c @@ -1,5 +1,6 @@ /* tc-alpha.c - Processor-specific code for the DEC Alpha AXP CPU. - Copyright (C) 1989, 93-98, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. Contributed by Carnegie Mellon University, 1993. Written by Alessandro Forin, based on earlier gas-1.38 target CPU files. Modified by Ken Raeburn for gas-2.x and ECOFF support. diff --git a/contrib/binutils/gas/config/tc-alpha.h b/contrib/binutils/gas/config/tc-alpha.h index 7edc412..2fe20b7 100644 --- a/contrib/binutils/gas/config/tc-alpha.h +++ b/contrib/binutils/gas/config/tc-alpha.h @@ -1,5 +1,6 @@ /* This file is tc-alpha.h - Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Free Software Foundation, Inc. Written by Ken Raeburn <raeburn@cygnus.com>. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/tc-arm.c b/contrib/binutils/gas/config/tc-arm.c index 514dba7..99aff8e 100644 --- a/contrib/binutils/gas/config/tc-arm.c +++ b/contrib/binutils/gas/config/tc-arm.c @@ -1,5 +1,5 @@ /* tc-arm.c -- Assemble for the ARM - Copyright (C) 1994, 95, 96, 97, 98, 1999, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modified by David Taylor (dtaylor@armltd.co.uk) @@ -1279,12 +1279,23 @@ add_to_lit_pool () == inst.reloc.exp.X_add_number) && literals[lit_count].exp.X_unsigned == inst.reloc.exp.X_unsigned) break; + + if (literals[lit_count].exp.X_op == inst.reloc.exp.X_op + && inst.reloc.exp.X_op == O_symbol + && (literals[lit_count].exp.X_add_number + == inst.reloc.exp.X_add_number) + && (literals[lit_count].exp.X_add_symbol + == inst.reloc.exp.X_add_symbol) + && (literals[lit_count].exp.X_op_symbol + == inst.reloc.exp.X_op_symbol)) + break; + lit_count++; } if (lit_count == next_literal_pool_place) /* New entry. */ { - if (next_literal_pool_place > MAX_LITERAL_POOL_SIZE) + if (next_literal_pool_place >= MAX_LITERAL_POOL_SIZE) { inst.error = _("Literal Pool Overflow"); return FAIL; @@ -2278,12 +2289,17 @@ do_msr (str, flags) return; } +#if 0 /* The first edition of the ARM architecture manual stated that + writing anything other than the flags with an immediate operation + had UNPREDICTABLE effects. This constraint was removed in the + second edition of the specification. */ if ((cpu_variant & ARM_EXT_V5) != ARM_EXT_V5 && inst.instruction & ((PSR_c | PSR_x | PSR_s) << PSR_SHIFT)) { inst.error = _("immediate value cannot be used to set this field"); return; } +#endif flags |= INST_IMMEDIATE; @@ -6014,7 +6030,7 @@ do_t_arit (str) if (Rs != Rd) { - inst.error = _("dest and source1 one must be the same register"); + inst.error = _("dest and source1 must be the same register"); return; } Rs = Rn; @@ -6513,29 +6529,26 @@ md_begin () } /* Catch special cases. */ - if (cpu_variant != (FPU_DEFAULT | CPU_DEFAULT)) + if (cpu_variant & ARM_EXT_XSCALE) + mach = bfd_mach_arm_XScale; + else if (cpu_variant & ARM_EXT_V5E) + mach = bfd_mach_arm_5TE; + else if (cpu_variant & ARM_EXT_V5) + { + if (cpu_variant & ARM_EXT_THUMB) + mach = bfd_mach_arm_5T; + else + mach = bfd_mach_arm_5; + } + else if (cpu_variant & ARM_EXT_HALFWORD) { - if (cpu_variant & ARM_EXT_XSCALE) - mach = bfd_mach_arm_XScale; - else if (cpu_variant & ARM_EXT_V5E) - mach = bfd_mach_arm_5TE; - else if (cpu_variant & ARM_EXT_V5) - { - if (cpu_variant & ARM_EXT_THUMB) - mach = bfd_mach_arm_5T; - else - mach = bfd_mach_arm_5; - } - else if (cpu_variant & ARM_EXT_HALFWORD) - { - if (cpu_variant & ARM_EXT_THUMB) - mach = bfd_mach_arm_4T; - else - mach = bfd_mach_arm_4; - } - else if (cpu_variant & ARM_EXT_LONGMUL) - mach = bfd_mach_arm_3M; + if (cpu_variant & ARM_EXT_THUMB) + mach = bfd_mach_arm_4T; + else + mach = bfd_mach_arm_4; } + else if (cpu_variant & ARM_EXT_LONGMUL) + mach = bfd_mach_arm_3M; bfd_set_arch_mach (stdoutput, TARGET_ARCH, mach); } @@ -7149,6 +7162,15 @@ md_apply_fix3 (fixP, val, seg) newval = (newval & 0xf800) | ((value & 0x7fffff) >> 12); newval2 = (newval2 & 0xf800) | ((value & 0xfff) >> 1); + if (fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX) + /* Remove bit zero of the adjusted offset. Bit zero can only be + set if the upper insn is at a half-word boundary, since the + destination address, an ARM instruction, must always be on a + word boundary. The semantics of the BLX (1) instruction, however, + are that bit zero in the offset must always be zero, and the + corresponding bit one in the target address will be set from bit + one of the source address. */ + newval2 &= ~1; md_number_to_chars (buf, newval, THUMB_SIZE); md_number_to_chars (buf + THUMB_SIZE, newval2, THUMB_SIZE); } @@ -8418,7 +8440,38 @@ arm_frob_label (sym) ARM_SET_INTERWORK (sym, support_interwork); #endif - if (label_is_thumb_function_name) + /* Note - do not allow local symbols (.Lxxx) to be labeled + as Thumb functions. This is because these labels, whilst + they exist inside Thumb code, are not the entry points for + possible ARM->Thumb calls. Also, these labels can be used + as part of a computed goto or switch statement. eg gcc + can generate code that looks like this: + + ldr r2, [pc, .Laaa] + lsl r3, r3, #2 + ldr r2, [r3, r2] + mov pc, r2 + + .Lbbb: .word .Lxxx + .Lccc: .word .Lyyy + ..etc... + .Laaa: .word Lbbb + + The first instruction loads the address of the jump table. + The second instruction converts a table index into a byte offset. + The third instruction gets the jump address out of the table. + The fourth instruction performs the jump. + + If the address stored at .Laaa is that of a symbol which has the + Thumb_Func bit set, then the linker will arrange for this address + to have the bottom bit set, which in turn would mean that the + address computation performed by the third instruction would end + up with the bottom bit set. Since the ARM is capable of unaligned + word loads, the instruction would then load the incorrect address + out of the jump table, and chaos would ensue. */ + if (label_is_thumb_function_name + && (S_GET_NAME (sym)[0] != '.' || S_GET_NAME (sym)[1] != 'L') + && (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) { /* When the address of a Thumb function is taken the bottom bit of that address should be set. This will allow @@ -8743,3 +8796,102 @@ s_arm_elf_cons (nbytes) } #endif /* OBJ_ELF */ + +/* This is called from HANDLE_ALIGN in write.c. Fill in the contents + of an rs_align_code fragment. */ + +void +arm_handle_align (fragP) + fragS *fragP; +{ + static char const arm_noop[4] = { 0x00, 0x00, 0xa0, 0xe1 }; + static char const thumb_noop[2] = { 0xc0, 0x46 }; + static char const arm_bigend_noop[4] = { 0xe1, 0xa0, 0x00, 0x00 }; + static char const thumb_bigend_noop[2] = { 0x46, 0xc0 }; + + int bytes, fix, noop_size; + char * p; + const char * noop; + + if (fragP->fr_type != rs_align_code) + return; + + bytes = fragP->fr_next->fr_address - fragP->fr_address - fragP->fr_fix; + p = fragP->fr_literal + fragP->fr_fix; + fix = 0; + + if (bytes > MAX_MEM_FOR_RS_ALIGN_CODE) + bytes &= MAX_MEM_FOR_RS_ALIGN_CODE; + + if (fragP->tc_frag_data) + { + if (target_big_endian) + noop = thumb_bigend_noop; + else + noop = thumb_noop; + noop_size = sizeof (thumb_noop); + } + else + { + if (target_big_endian) + noop = arm_bigend_noop; + else + noop = arm_noop; + noop_size = sizeof (arm_noop); + } + + if (bytes & (noop_size - 1)) + { + fix = bytes & (noop_size - 1); + memset (p, 0, fix); + p += fix; + bytes -= fix; + } + + while (bytes >= noop_size) + { + memcpy (p, noop, noop_size); + p += noop_size; + bytes -= noop_size; + fix += noop_size; + } + + fragP->fr_fix += fix; + fragP->fr_var = noop_size; +} + +/* Called from md_do_align. Used to create an alignment + frag in a code section. */ + +void +arm_frag_align_code (n, max) + int n; + int max; +{ + char * p; + + /* We assume that there will never be a requirment + to support alignments greater than 32 bytes. */ + if (max > MAX_MEM_FOR_RS_ALIGN_CODE) + as_fatal (_("alignments greater than 32 bytes not supported in .text sections.")); + + p = frag_var (rs_align_code, + MAX_MEM_FOR_RS_ALIGN_CODE, + 1, + (relax_substateT) max, + (symbolS *) NULL, + (offsetT) n, + (char *) NULL); + *p = 0; + +} + +/* Perform target specific initialisation of a frag. */ + +void +arm_init_frag (fragP) + fragS *fragP; +{ + /* Record whether this frag is in an ARM or a THUMB area. */ + fragP->tc_frag_data = thumb_mode; +} diff --git a/contrib/binutils/gas/config/tc-arm.h b/contrib/binutils/gas/config/tc-arm.h index 0a823dd..8de5704 100644 --- a/contrib/binutils/gas/config/tc-arm.h +++ b/contrib/binutils/gas/config/tc-arm.h @@ -1,5 +1,5 @@ /* This file is tc-arm.h - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modified by David Taylor (dtaylor@armltd.co.uk) @@ -214,3 +214,23 @@ void armelf_frob_symbol PARAMS ((symbolS *, int *)); #ifdef OBJ_ELF #define DWARF2_LINE_MIN_INSN_LENGTH 2 #endif + +#define MAX_MEM_FOR_RS_ALIGN_CODE 31 + +/* For frags in code sections we need to record whether they contain + ARM code or THUMB code. This is that if they have to be aligned, + they can contain the correct type of no-op instruction. */ +#define TC_FRAG_TYPE int +#define TC_FRAG_INIT(fragp) arm_init_frag (fragp) +extern void arm_init_frag PARAMS ((struct frag *)); + +#define HANDLE_ALIGN(fragp) arm_handle_align (fragp) +extern void arm_handle_align PARAMS ((struct frag *)); + +#define md_do_align(N, FILL, LEN, MAX, LABEL) \ + if (FILL == NULL && (N) != 0 && ! need_pass_2 && subseg_text_p (now_seg)) \ + { \ + arm_frag_align_code (N, MAX); \ + goto LABEL; \ + } +extern void arm_frag_align_code PARAMS ((int, int)); diff --git a/contrib/binutils/gas/config/tc-generic.h b/contrib/binutils/gas/config/tc-generic.h index 72df020..f3b676b 100644 --- a/contrib/binutils/gas/config/tc-generic.h +++ b/contrib/binutils/gas/config/tc-generic.h @@ -1,6 +1,6 @@ /* This file is tc-generic.h - Copyright (C) 1987, 91, 92, 95, 1997 Free Software Foundation, Inc. + Copyright 1987, 1991, 1992, 1995, 1997 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/tc-m68851.h b/contrib/binutils/gas/config/tc-m68851.h index 398e1d2..870e881 100644 --- a/contrib/binutils/gas/config/tc-m68851.h +++ b/contrib/binutils/gas/config/tc-m68851.h @@ -1,6 +1,7 @@ /* This file is tc-m68851.h - Copyright (C) 1987-1992, 2000 Free Software Foundation, Inc. + Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/tc-ppc.c b/contrib/binutils/gas/config/tc-ppc.c index 2b826cb..a893209 100644 --- a/contrib/binutils/gas/config/tc-ppc.c +++ b/contrib/binutils/gas/config/tc-ppc.c @@ -1,5 +1,5 @@ /* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000) - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. @@ -2845,9 +2845,29 @@ ppc_stabx (ignore) symbol_get_tc (sym)->output = 1; - if (S_GET_STORAGE_CLASS (sym) == C_STSYM) + if (S_GET_STORAGE_CLASS (sym) == C_STSYM) { + symbol_get_tc (sym)->within = ppc_current_block; + /* In this case : + + .bs name + .stabx "z",arrays_,133,0 + .es + + .comm arrays_,13768,3 + + resolve_symbol_value will copy the exp's "within" into sym's when the + offset is 0. Since this seems to be corner case problem, + only do the correction for storage class C_STSYM. A better solution + would be to have the tc field updated in ppc_symbol_new_hook. */ + + if (exp.X_op == O_symbol) + { + symbol_get_tc (exp.X_add_symbol)->within = ppc_current_block; + } + } + if (exp.X_op != O_symbol || ! S_IS_EXTERNAL (exp.X_add_symbol) || S_GET_SEGMENT (exp.X_add_symbol) != bss_section) diff --git a/contrib/binutils/gas/config/tc-ppc.h b/contrib/binutils/gas/config/tc-ppc.h index f246cd7..c2876bf 100644 --- a/contrib/binutils/gas/config/tc-ppc.h +++ b/contrib/binutils/gas/config/tc-ppc.h @@ -1,5 +1,5 @@ /* tc-ppc.h -- Header file for tc-ppc.c. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. diff --git a/contrib/binutils/gas/config/tc-sparc.c b/contrib/binutils/gas/config/tc-sparc.c index 6c9827c..558dc89 100644 --- a/contrib/binutils/gas/config/tc-sparc.c +++ b/contrib/binutils/gas/config/tc-sparc.c @@ -1,5 +1,6 @@ /* tc-sparc.c -- Assemble for the SPARC - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -2970,16 +2971,19 @@ md_apply_fix3 (fixP, value, segment) /* If this is a data relocation, just output VAL. */ - if (fixP->fx_r_type == BFD_RELOC_16) + if (fixP->fx_r_type == BFD_RELOC_16 + || fixP->fx_r_type == BFD_RELOC_SPARC_UA16) { md_number_to_chars (buf, val, 2); } else if (fixP->fx_r_type == BFD_RELOC_32 + || fixP->fx_r_type == BFD_RELOC_SPARC_UA32 || fixP->fx_r_type == BFD_RELOC_SPARC_REV32) { md_number_to_chars (buf, val, 4); } - else if (fixP->fx_r_type == BFD_RELOC_64) + else if (fixP->fx_r_type == BFD_RELOC_64 + || fixP->fx_r_type == BFD_RELOC_SPARC_UA64) { md_number_to_chars (buf, val, 8); } @@ -3315,6 +3319,9 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_SPARC_LOX10: case BFD_RELOC_SPARC_REV32: case BFD_RELOC_SPARC_OLO10: + case BFD_RELOC_SPARC_UA16: + case BFD_RELOC_SPARC_UA32: + case BFD_RELOC_SPARC_UA64: case BFD_RELOC_VTABLE_ENTRY: case BFD_RELOC_VTABLE_INHERIT: code = fixp->fx_r_type; @@ -4065,12 +4072,9 @@ sparc_cons_align (nbytes) if (! enforce_aligned_data) return; + /* Don't align if this is an unaligned pseudo-op. */ if (sparc_no_align_cons) - { - /* This is an unaligned pseudo-op. */ - sparc_no_align_cons = 0; - return; - } + return; nalign = log2 (nbytes); if (nalign == 0) @@ -4195,9 +4199,23 @@ cons_fix_new_sparc (frag, where, nbytes, exp) (nbytes == 2 ? BFD_RELOC_16 : (nbytes == 4 ? BFD_RELOC_32 : BFD_RELOC_64))); - if (target_little_endian_data && nbytes == 4 + if (target_little_endian_data + && nbytes == 4 && now_seg->flags & SEC_ALLOC) r = BFD_RELOC_SPARC_REV32; + + if (sparc_no_align_cons) + { + switch (nbytes) + { + case 2: r = BFD_RELOC_SPARC_UA16; break; + case 4: r = BFD_RELOC_SPARC_UA32; break; + case 8: r = BFD_RELOC_SPARC_UA64; break; + default: abort (); + } + sparc_no_align_cons = 0; + } + fix_new_exp (frag, where, (int) nbytes, exp, 0, r); } diff --git a/contrib/binutils/gas/config/tc-sparc.h b/contrib/binutils/gas/config/tc-sparc.h index 17bef83..ce19f5d 100644 --- a/contrib/binutils/gas/config/tc-sparc.h +++ b/contrib/binutils/gas/config/tc-sparc.h @@ -1,5 +1,6 @@ /* tc-sparc.h - Macros and type defines for the sparc. - Copyright (C) 1989, 90-96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/tc-tic30.c b/contrib/binutils/gas/config/tc-tic30.c index e11cb33..2190a85 100644 --- a/contrib/binutils/gas/config/tc-tic30.c +++ b/contrib/binutils/gas/config/tc-tic30.c @@ -1,5 +1,5 @@ /* tc-c30.c -- Assembly code for the Texas Instruments TMS320C30 - Copyright (C) 1998, 1999, 2000 Free Software Foundation. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/tc-tic30.h b/contrib/binutils/gas/config/tc-tic30.h index 5b34cf1..d55c870 100644 --- a/contrib/binutils/gas/config/tc-tic30.h +++ b/contrib/binutils/gas/config/tc-tic30.h @@ -1,5 +1,5 @@ /* tc-tic30.h -- Header file for tc-tic30.c - Copyright (C) 1998, 2000 Free Software Foundation. + Copyright 1998, 2000 Free Software Foundation, Inc. Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au) This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/tc-v850.c b/contrib/binutils/gas/config/tc-v850.c index 57931950..ce676cd 100644 --- a/contrib/binutils/gas/config/tc-v850.c +++ b/contrib/binutils/gas/config/tc-v850.c @@ -1,5 +1,6 @@ /* tc-v850.c -- Assembler code for the NEC V850 - Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation. + Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -604,8 +605,8 @@ const pseudo_typeS md_pseudo_table[] = { {"call_table_text", v850_call_table_text, 0}, {"v850e", set_machine, bfd_mach_v850e}, {"v850ea", set_machine, bfd_mach_v850ea}, - {"file", dwarf2_directive_file }, - {"loc", dwarf2_directive_loc }, + {"file", dwarf2_directive_file, 0}, + {"loc", dwarf2_directive_loc, 0}, { NULL, NULL, 0} }; @@ -1321,7 +1322,6 @@ md_convert_frag (abfd, sec, fragP) { fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol, fragP->fr_offset, 1, BFD_RELOC_UNUSED + (int)fragP->fr_opcode); - fragP->fr_var = 0; fragP->fr_fix += 2; } /* Out of range conditional branch. Emit a branch around a jump. */ @@ -1345,7 +1345,6 @@ md_convert_frag (abfd, sec, fragP) fix_new (fragP, fragP->fr_fix + 2, 4, fragP->fr_symbol, fragP->fr_offset, 1, BFD_RELOC_UNUSED + (int) fragP->fr_opcode + 1); - fragP->fr_var = 0; fragP->fr_fix += 6; } /* Out of range unconditional branch. Emit a jump. */ @@ -1355,7 +1354,6 @@ md_convert_frag (abfd, sec, fragP) fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol, fragP->fr_offset, 1, BFD_RELOC_UNUSED + (int) fragP->fr_opcode + 1); - fragP->fr_var = 0; fragP->fr_fix += 4; } else @@ -1702,7 +1700,6 @@ md_assemble (str) int relaxable = 0; unsigned long insn; unsigned long insn_size; - unsigned long total_insn_size = 0; char *f; int i; int match; @@ -2153,6 +2150,11 @@ md_assemble (str) input_line_pointer = str; + /* Tie dwarf2 debug info to the address at the start of the insn. + We can't do this after the insn has been output as the current + frag may have been closed off. eg. by frag_var. */ + dwarf2_emit_insn (0); + /* Write out the instruction. */ if (relaxable && fc > 0) @@ -2178,7 +2180,6 @@ md_assemble (str) md_number_to_chars (f, insn, insn_size); md_number_to_chars (f + 2, 0, 4); } - total_insn_size = insn_size; } else { @@ -2193,15 +2194,11 @@ md_assemble (str) insn_size = 2; f = frag_more (insn_size); - total_insn_size = insn_size; - md_number_to_chars (f, insn, insn_size); if (extra_data_after_insn) { f = frag_more (extra_data_len); - total_insn_size += extra_data_len; - md_number_to_chars (f, extra_data, extra_data_len); extra_data_after_insn = false; @@ -2274,8 +2271,6 @@ md_assemble (str) } input_line_pointer = saved_input_line_pointer; - - dwarf2_emit_insn (total_insn_size); } /* If while processing a fixup, a reloc really needs to be created @@ -2315,20 +2310,17 @@ tc_gen_reloc (seg, fixp) return reloc; } -/* Assume everything will fit in two bytes, then expand as necessary. */ +/* Return current size of variable part of frag. */ int md_estimate_size_before_relax (fragp, seg) fragS *fragp; asection *seg ATTRIBUTE_UNUSED; { - if (fragp->fr_subtype == 0) - fragp->fr_var = 4; - else if (fragp->fr_subtype == 2) - fragp->fr_var = 2; - else + if (fragp->fr_subtype >= sizeof (md_relax_table) / sizeof (md_relax_table[0])) abort (); - return 2; + + return md_relax_table[fragp->fr_subtype].rlx_length; } long diff --git a/contrib/binutils/gas/config/tc-v850.h b/contrib/binutils/gas/config/tc-v850.h index 1e597f0..7ce0491 100644 --- a/contrib/binutils/gas/config/tc-v850.h +++ b/contrib/binutils/gas/config/tc-v850.h @@ -1,5 +1,5 @@ /* tc-v850.h -- Header file for tc-v850.c. - Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/tc-z8k.c b/contrib/binutils/gas/config/tc-z8k.c index 58c85ea..73666ca 100644 --- a/contrib/binutils/gas/config/tc-z8k.c +++ b/contrib/binutils/gas/config/tc-z8k.c @@ -1,6 +1,6 @@ /* tc-z8k.c -- Assemble code for the Zilog Z800n - Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 - Free Software Foundation. + Copyright 1992, 1993, 1994, 1995, 1996, 1998, 2000 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -159,8 +159,6 @@ md_begin () for (opcode = z8k_table; opcode->name; opcode++) { /* Only enter unique codes into the table. */ - char *src = opcode->name; - if (strcmp (opcode->name, prev_name)) { hash_insert (opcode_hash_control, opcode->name, (char *) opcode); @@ -178,8 +176,8 @@ md_begin () { opcode_entry_type *fake_opcode; fake_opcode = (opcode_entry_type *) malloc (sizeof (opcode_entry_type)); - fake_opcode->name = md_pseudo_table[idx].poc_name, - fake_opcode->func = (void *) (md_pseudo_table + idx); + fake_opcode->name = md_pseudo_table[idx].poc_name; + fake_opcode->func = (void *) (md_pseudo_table + idx); fake_opcode->opcode = 250; hash_insert (opcode_hash_control, fake_opcode->name, fake_opcode); } @@ -404,25 +402,24 @@ struct ctrl_names { }; struct ctrl_names ctrl_table[] = { - 0x2, "fcw", - 0X3, "refresh", - 0x4, "psapseg", - 0x5, "psapoff", - 0x5, "psap", - 0x6, "nspseg", - 0x7, "nspoff", - 0x7, "nsp", - 0 , 0 + { 0x2, "fcw" }, + { 0x3, "refresh" }, + { 0x4, "psapseg" }, + { 0x5, "psapoff" }, + { 0x5, "psap" }, + { 0x6, "nspseg" }, + { 0x7, "nspoff" }, + { 0x7, "nsp" }, + { 0 , 0 } }; static void get_ctrl_operand (ptr, mode, dst) char **ptr; struct z8k_op *mode; - unsigned int dst; + unsigned int dst ATTRIBUTE_UNUSED; { char *src = *ptr; - int r; int i; while (*src == ' ') @@ -455,23 +452,22 @@ struct flag_names { }; struct flag_names flag_table[] = { - 0x1, "p", - 0x1, "v", - 0x2, "s", - 0x4, "z", - 0x8, "c", - 0x0, "+", - 0, 0 + { 0x1, "p" }, + { 0x1, "v" }, + { 0x2, "s" }, + { 0x4, "z" }, + { 0x8, "c" }, + { 0x0, "+" }, + { 0, 0 } }; static void get_flags_operand (ptr, mode, dst) char **ptr; struct z8k_op *mode; - unsigned int dst; + unsigned int dst ATTRIBUTE_UNUSED; { char *src = *ptr; - int r; int i; int j; @@ -508,21 +504,20 @@ struct interrupt_names { }; struct interrupt_names intr_table[] = { - 0x1, "nvi", - 0x2, "vi", - 0x3, "both", - 0x3, "all", - 0, 0 + { 0x1, "nvi" }, + { 0x2, "vi" }, + { 0x3, "both" }, + { 0x3, "all" }, + { 0, 0 } }; static void get_interrupt_operand (ptr, mode, dst) char **ptr; struct z8k_op *mode; - unsigned int dst; + unsigned int dst ATTRIBUTE_UNUSED; { char *src = *ptr; - int r; int i; while (*src == ' ') @@ -555,39 +550,38 @@ struct cc_names { }; struct cc_names table[] = { - 0x0, "f", - 0x1, "lt", - 0x2, "le", - 0x3, "ule", - 0x4, "ov", - 0x4, "pe", - 0x5, "mi", - 0x6, "eq", - 0x6, "z", - 0x7, "c", - 0x7, "ult", - 0x8, "t", - 0x9, "ge", - 0xa, "gt", - 0xb, "ugt", - 0xc, "nov", - 0xc, "po", - 0xd, "pl", - 0xe, "ne", - 0xe, "nz", - 0xf, "nc", - 0xf, "uge", - 0 , 0 + { 0x0, "f" }, + { 0x1, "lt" }, + { 0x2, "le" }, + { 0x3, "ule" }, + { 0x4, "ov" }, + { 0x4, "pe" }, + { 0x5, "mi" }, + { 0x6, "eq" }, + { 0x6, "z" }, + { 0x7, "c" }, + { 0x7, "ult" }, + { 0x8, "t" }, + { 0x9, "ge" }, + { 0xa, "gt" }, + { 0xb, "ugt" }, + { 0xc, "nov" }, + { 0xc, "po" }, + { 0xd, "pl" }, + { 0xe, "ne" }, + { 0xe, "nz" }, + { 0xf, "nc" }, + { 0xf, "uge" }, + { 0 , 0 } }; static void get_cc_operand (ptr, mode, dst) char **ptr; struct z8k_op *mode; - unsigned int dst; + unsigned int dst ATTRIBUTE_UNUSED; { char *src = *ptr; - int r; int i; while (*src == ' ') @@ -616,13 +610,10 @@ static void get_operand (ptr, mode, dst) char **ptr; struct z8k_op *mode; - unsigned int dst; + unsigned int dst ATTRIBUTE_UNUSED; { char *src = *ptr; char *end; - unsigned int num; - unsigned int len; - unsigned int size; mode->mode = 0; @@ -774,7 +765,7 @@ get_operands (opcode, op_end, operand) ptr = savptr; get_operand (&ptr, operand + 0, 0); if (ptr == 0) - return; + return NULL; if (*ptr == ',') ptr++; get_ctrl_operand (&ptr, operand + 1, 1); @@ -786,7 +777,7 @@ get_operands (opcode, op_end, operand) get_operand (&ptr, operand + 0, 0); } if (ptr == 0) - return; + return NULL; if (*ptr == ',') ptr++; get_operand (&ptr, operand + 1, 1); @@ -838,8 +829,7 @@ get_specific (opcode, operands) int found = 0; unsigned int noperands = opcode->noperands; - unsigned int dispreg; - unsigned int this_index = opcode->idx; + int this_index = opcode->idx; while (this_index == opcode->idx && !found) { @@ -848,7 +838,7 @@ get_specific (opcode, operands) this_try = opcode++; for (i = 0; i < noperands; i++) { - int mode = operands[i].mode; + unsigned int mode = operands[i].mode; if ((mode & CLASS_MASK) != (this_try->arg_info[i] & CLASS_MASK)) { @@ -912,6 +902,7 @@ get_specific (opcode, operands) return 0; } +#if 0 /* Not used. */ static void check_operand (operand, width, string) struct z8k_op *operand; @@ -935,6 +926,7 @@ check_operand (operand, width, string) } } +#endif static char buffer[20]; @@ -966,17 +958,15 @@ apply_fix (ptr, type, operand, size) { int n = operand->X_add_number; - operand->X_add_number = n; newfix ((ptr - buffer) / 2, type, operand); -#if 1 switch (size) { - case 8: /* 8 nibbles == 32 bits */ + case 8: /* 8 nibbles == 32 bits. */ *ptr++ = n >> 28; *ptr++ = n >> 24; *ptr++ = n >> 20; *ptr++ = n >> 16; - case 4: /* 4 niblles == 16 bits */ + case 4: /* 4 nibbles == 16 bits. */ *ptr++ = n >> 12; *ptr++ = n >> 8; case 2: @@ -985,9 +975,7 @@ apply_fix (ptr, type, operand, size) *ptr++ = n >> 0; break; } -#endif return ptr; - } /* Now we know what sort of opcodes it is. Let's build the bytes. */ @@ -997,16 +985,10 @@ apply_fix (ptr, type, operand, size) static void build_bytes (this_try, operand) opcode_entry_type *this_try; - struct z8k_op *operand; + struct z8k_op *operand ATTRIBUTE_UNUSED; { - unsigned int i; - - int length; - char *output; char *output_ptr = buffer; - char part; int c; - char high; int nib; int nibble; unsigned int *class_ptr; @@ -1017,8 +999,7 @@ build_bytes (this_try, operand) memset (buffer, 20, 0); class_ptr = this_try->byte_info; - top: - for (nibble = 0; c = *class_ptr++; nibble++) + for (nibble = 0; (c = *class_ptr++); nibble++) { switch (c & CLASS_MASK) @@ -1030,7 +1011,7 @@ build_bytes (this_try, operand) /* Direct address, we don't cope with the SS mode right now. */ if (segmented_mode) { - da_operand->X_add_number |= 0x80000000; + /* da_operand->X_add_number |= 0x80000000; -- Now set at relocation time. */ output_ptr = apply_fix (output_ptr, R_IMM32, da_operand, 8); } else @@ -1107,7 +1088,17 @@ build_bytes (this_try, operand) *output_ptr++ = reg[c & 0xf]; break; case CLASS_DISP: - output_ptr = apply_fix (output_ptr, R_IMM16, da_operand, 4); + switch (c & ARG_MASK) + { + case ARG_DISP12: + output_ptr = apply_fix (output_ptr, R_CALLR, da_operand, 4); + break; + case ARG_DISP16: + output_ptr = apply_fix (output_ptr, R_REL16, da_operand, 4); + break; + default: + output_ptr = apply_fix (output_ptr, R_IMM16, da_operand, 4); + } da_operand = 0; break; @@ -1170,16 +1161,13 @@ void md_assemble (str) char *str; { + char c; char *op_start; char *op_end; - unsigned int i; struct z8k_op operand[3]; opcode_entry_type *opcode; opcode_entry_type *prev_opcode; - char *dot = 0; - char c; - /* Drop leading whitespace. */ while (*str == ' ') str++; @@ -1253,21 +1241,21 @@ md_assemble (str) void tc_crawl_symbol_chain (headers) - object_headers *headers; + object_headers *headers ATTRIBUTE_UNUSED; { printf (_("call to tc_crawl_symbol_chain \n")); } symbolS * md_undefined_symbol (name) - char *name; + char *name ATTRIBUTE_UNUSED; { return 0; } void tc_headers_hook (headers) - object_headers *headers; + object_headers *headers ATTRIBUTE_UNUSED; { printf (_("call to tc_headers_hook \n")); } @@ -1389,9 +1377,9 @@ tc_aout_fix_to_chars () void md_convert_frag (headers, seg, fragP) - object_headers *headers; - segT seg; - fragS *fragP; + object_headers *headers ATTRIBUTE_UNUSED; + segT seg ATTRIBUTE_UNUSED; + fragS *fragP ATTRIBUTE_UNUSED; { printf (_("call to md_convert_frag \n")); abort (); @@ -1471,8 +1459,8 @@ md_apply_fix (fixP, val) int md_estimate_size_before_relax (fragP, segment_type) - register fragS *fragP; - register segT segment_type; + register fragS *fragP ATTRIBUTE_UNUSED; + register segT segment_type ATTRIBUTE_UNUSED; { printf (_("call tomd_estimate_size_before_relax \n")); abort (); @@ -1491,14 +1479,14 @@ md_number_to_chars (ptr, use, nbytes) long md_pcrel_from (fixP) - fixS *fixP; + fixS *fixP ATTRIBUTE_UNUSED; { abort (); } void tc_coff_symbol_emit_hook (s) - symbolS *s; + symbolS *s ATTRIBUTE_UNUSED; { } diff --git a/contrib/binutils/gas/config/tc-z8k.h b/contrib/binutils/gas/config/tc-z8k.h index 130c01c..d1899e1 100644 --- a/contrib/binutils/gas/config/tc-z8k.h +++ b/contrib/binutils/gas/config/tc-z8k.h @@ -1,5 +1,6 @@ /* This file is tc-z8k.h - Copyright (C) 1987-1992, 93, 95, 97, 98, 2000 + Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1997, 1998, + 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/te-386bsd.h b/contrib/binutils/gas/config/te-386bsd.h index 0f077b5..da2d692 100644 --- a/contrib/binutils/gas/config/te-386bsd.h +++ b/contrib/binutils/gas/config/te-386bsd.h @@ -1,5 +1,6 @@ /* te-386bsd.h -- 386BSD target environment declarations. - Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc. + Copyright 1987, 1990, 1991, 1992, 1993, 2000 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/te-nbsd.h b/contrib/binutils/gas/config/te-nbsd.h index 010a711..cb8dc09 100644 --- a/contrib/binutils/gas/config/te-nbsd.h +++ b/contrib/binutils/gas/config/te-nbsd.h @@ -1,5 +1,6 @@ /* te-nbsd.h -- NetBSD target environment declarations. - Copyright (C) 1987, 90, 91, 92, 94, 95, 1998 Free Software Foundation, Inc. + Copyright 1987, 1990, 1991, 1992, 1994, 1998, 2000 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/te-ppcnw.h b/contrib/binutils/gas/config/te-ppcnw.h index d23e38c..fcd3a972 100644 --- a/contrib/binutils/gas/config/te-ppcnw.h +++ b/contrib/binutils/gas/config/te-ppcnw.h @@ -1,5 +1,5 @@ /* te-ppcnw.h -- Power PC running Netware environment declarations. - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright 1994, 1995, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. diff --git a/contrib/binutils/gas/config/te-sparcaout.h b/contrib/binutils/gas/config/te-sparcaout.h index 6c92f63..edd3766 100644 --- a/contrib/binutils/gas/config/te-sparcaout.h +++ b/contrib/binutils/gas/config/te-sparcaout.h @@ -1,5 +1,5 @@ /* te-sparcaout.h -- embedded sparc-aout target environment declarations. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright 1996, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. |