Lots of changes for:
authorKen Raeburn <raeburn@cygnus>
Fri, 3 Dec 1993 03:10:08 +0000 (03:10 +0000)
committerKen Raeburn <raeburn@cygnus>
Fri, 3 Dec 1993 03:10:08 +0000 (03:10 +0000)
 - sparc[lite]-coff as well as sparc-lynx
 - producing coff (including debug info) under BFD_ASSEMBLER option
 - cleanup of cpu-specific code in non-cpu-specific files
   (especially write.c)
 - providing common code to avoid duplication in cpu-specific files
   (specifically, md_number_to_chars)
 - stylistic changes & misc cleanup

================

* config/tc-sparc.c (tc_gen_reloc): Make adjustment to addend be dependent on
howto fields, not on format flavour.

* struc-symbol.h (struct symbol): New fields sy_obj and sy_tc, defined as types
OBJ_SYMFIELD_TYPE and TC_SYMFIELD_TYPE, if those macros are defined.
* config/obj-coff.h (TC_SYMFIELD_TYPE, OBJ_SYMFIELD_TYPE): Define.
(TARGET_SYMBOL_FIELDS, I960_SYM_FIELDS): Don't define.
(sy_tc, sy_obj): Define so that the fields look like they used to, until all
references get changed.

* write.c (fixup_segment): Lots of variables no longer register.  Reordered
some code for easier reading.
* config/obj-coff.c (obj_coff_dim): dim_index no longer register.  Deleted
superfluous return statement.
(obj_coff_line, obj_coff_size, obj_coff_scl, obj_coff_type, obj_coff_val,
tag_init, tag_insert): Deleted superfluous return statement.
(align, obj_coff_section): Deleted debugging printfs.
* config/tc-i386.c (md_assemble): Discard some register decls.  Use assignment
rather than memcpy to copy template.
(op_hash, reg_hash, prefix_hash): Default C initialization of statics is
sufficient.
* config/tc-sparc.c (print_insn): Array Reloc is now const, and points to
const.

* config/obj-coff.h (TARGET_FORMAT): Only use coff-sparc-lynx if TE_LYNX; use
coff-sparc otherwise.
[USE_NATIVE_HEADERS]: Delete this code; it isn't used.

* write.c (fixup_segment): Call TC_VALIDATE_FIX, if defined, before processing
a fixup.  Call TC_ADJUST_RELOC_COUNT just before returning.  Remove some
i960-coff-specific code.
(TC_ADJUST_RELOC_COUNT): Default to doing nothing.
* config/tc-i960.h (TC_ADJUST_RELOC_COUNT) [OBJ_COFF]: Define.
(i960_validate_fix): Declare.
(TC_VALIDATE_FIX): Define.
* config/tc-i960.c (i960_validate_fix): New function.

* write.c (number_to_chars_littleendian): New function.  Write out bytes in
little endian order, doing size and range checking.
(number_to_chars_bigendian): New function, similar.
* write.h: Declare them.
* config/tc-*.c (md_number_to_chars): Use them.
* config/tc-vax.c (md_apply_fix): Ditto.
* config/tc-i386.c (md_apply_fix): Ditto.

* config/obj-coff.c: Rearranged code for handling line number data.
(line_fsym): Renamed from function_lineoff in BFD_ASSEMBLER case, since the
usage is different from non-BFD_ASSEMBLER case.
(in_function, clear_function, set_function): New macros, to combine some of the
functionality implemented in differnet ways in BFD_ASSEMBLER and non-... code.
Used in other functions that used to check function_lineoff &c.
(obj_emit_lineno): Split into two copies, one for BFD_ASSEMBLER, one for not.
Non-BFD_ASSEMBLER version now has temporary variable to contain char* pointer
pointed to by char** argument.  Always follow CROSS_COMPILE code; easier to
read that way.
(obj_coff_ln): Don't call add_lineno or c_line_new if appline is set.
(obj_coff_endef) [BFD_ASSEMBLER]: Don't do anything special for ".bf", it's
been done elsewhere.
(coff_frob_symbol): If ilne number data is pending, call add_linesym to flush it.
(coff_frob_file): Don't do that here.
* config/obj-coff.h (coff_frob_file): Declare.
(obj_frob_file): Define, to call it.

* config/tc-sparc.h (md_create_short_jump, md_create_long_jump,
md_estimate_size_before_relax: Define them as macros calling as_fatal.
* config/tc-sparc.c: Don't define them as functions.

gas/.Sanitize
gas/ChangeLog
gas/config/tc-a29k.c
gas/config/tc-h8500.c
gas/config/tc-hppa.c
gas/config/tc-m88k.c
gas/config/tc-tahoe.c

index 7919817c4ba2aceefa472db9fae1bba491f47643..8442ebf81945ad8409984cd66f42ac46b9bf7102 100644 (file)
@@ -124,7 +124,86 @@ fi
 #
 #
 # $Log$
-# Revision 1.22  1993/11/22 06:04:32  law
+# Revision 1.23  1993/12/03 03:06:48  raeburn
+# Lots of changes for:
+#  - sparc[lite]-coff as well as sparc-lynx
+#  - producing coff (including debug info) under BFD_ASSEMBLER option
+#  - cleanup of cpu-specific code in non-cpu-specific files
+#    (especially write.c)
+#  - providing common code to avoid duplication in cpu-specific files
+#    (specifically, md_number_to_chars)
+#  - stylistic changes & misc cleanup
+#
+# ================
+#
+# * config/tc-sparc.c (tc_gen_reloc): Make adjustment to addend be dependent on
+# howto fields, not on format flavour.
+#
+# * struc-symbol.h (struct symbol): New fields sy_obj and sy_tc, defined as types
+# OBJ_SYMFIELD_TYPE and TC_SYMFIELD_TYPE, if those macros are defined.
+# * config/obj-coff.h (TC_SYMFIELD_TYPE, OBJ_SYMFIELD_TYPE): Define.
+# (TARGET_SYMBOL_FIELDS, I960_SYM_FIELDS): Don't define.
+# (sy_tc, sy_obj): Define so that the fields look like they used to, until all
+# references get changed.
+#
+# * write.c (fixup_segment): Lots of variables no longer register.  Reordered
+# some code for easier reading.
+# * config/obj-coff.c (obj_coff_dim): dim_index no longer register.  Deleted
+# superfluous return statement.
+# (obj_coff_line, obj_coff_size, obj_coff_scl, obj_coff_type, obj_coff_val,
+# tag_init, tag_insert): Deleted superfluous return statement.
+# (align, obj_coff_section): Deleted debugging printfs.
+# * config/tc-i386.c (md_assemble): Discard some register decls.  Use assignment
+# rather than memcpy to copy template.
+# (op_hash, reg_hash, prefix_hash): Default C initialization of statics is
+# sufficient.
+# * config/tc-sparc.c (print_insn): Array Reloc is now const, and points to
+# const.
+#
+# * config/obj-coff.h (TARGET_FORMAT): Only use coff-sparc-lynx if TE_LYNX; use
+# coff-sparc otherwise.
+# [USE_NATIVE_HEADERS]: Delete this code; it isn't used.
+#
+# * write.c (fixup_segment): Call TC_VALIDATE_FIX, if defined, before processing
+# a fixup.  Call TC_ADJUST_RELOC_COUNT just before returning.  Remove some
+# i960-coff-specific code.
+# (TC_ADJUST_RELOC_COUNT): Default to doing nothing.
+# * config/tc-i960.h (TC_ADJUST_RELOC_COUNT) [OBJ_COFF]: Define.
+# (i960_validate_fix): Declare.
+# (TC_VALIDATE_FIX): Define.
+# * config/tc-i960.c (i960_validate_fix): New function.
+#
+# * write.c (number_to_chars_littleendian): New function.  Write out bytes in
+# little endian order, doing size and range checking.
+# (number_to_chars_bigendian): New function, similar.
+# * write.h: Declare them.
+# * config/tc-*.c (md_number_to_chars): Use them.
+# * config/tc-vax.c (md_apply_fix): Ditto.
+# * config/tc-i386.c (md_apply_fix): Ditto.
+#
+# * config/obj-coff.c: Rearranged code for handling line number data.
+# (line_fsym): Renamed from function_lineoff in BFD_ASSEMBLER case, since the
+# usage is different from non-BFD_ASSEMBLER case.
+# (in_function, clear_function, set_function): New macros, to combine some of the
+# functionality implemented in differnet ways in BFD_ASSEMBLER and non-... code.
+# Used in other functions that used to check function_lineoff &c.
+# (obj_emit_lineno): Split into two copies, one for BFD_ASSEMBLER, one for not.
+# Non-BFD_ASSEMBLER version now has temporary variable to contain char* pointer
+# pointed to by char** argument.  Always follow CROSS_COMPILE code; easier to
+# read that way.
+# (obj_coff_ln): Don't call add_lineno or c_line_new if appline is set.
+# (obj_coff_endef) [BFD_ASSEMBLER]: Don't do anything special for ".bf", it's
+# been done elsewhere.
+# (coff_frob_symbol): If ilne number data is pending, call add_linesym to flush it.
+# (coff_frob_file): Don't do that here.
+# * config/obj-coff.h (coff_frob_file): Declare.
+# (obj_frob_file): Define, to call it.
+#
+# * config/tc-sparc.h (md_create_short_jump, md_create_long_jump,
+# md_estimate_size_before_relax: Define them as macros calling as_fatal.
+# * config/tc-sparc.c: Don't define them as functions.
+#
+# Revision 1.22  1993/11/22  06:04:32  law
 # Add stabs.c to things-to-keep.
 #
 # Revision 1.21  1993/11/17  23:23:36  ian
index 85f8ca3ca959cb3ac88b09321912ab6dbfbd60a7..214bd6877bb2fde1d5c5bde43d762d1a93d7bd91 100644 (file)
@@ -1,3 +1,81 @@
+Thu Dec  2 11:52:21 1993  Ken Raeburn  (raeburn@cygnus.com)
+
+       * config/tc-sparc.c (tc_gen_reloc): Make adjustment to addend be
+       dependent on howto fields, not on format flavour.
+
+       * struc-symbol.h (struct symbol): New fields sy_obj and sy_tc,
+       defined as types OBJ_SYMFIELD_TYPE and TC_SYMFIELD_TYPE, if those
+       macros are defined.
+       * config/obj-coff.h (TC_SYMFIELD_TYPE, OBJ_SYMFIELD_TYPE): Define.
+       (TARGET_SYMBOL_FIELDS, I960_SYM_FIELDS): Don't define.
+       (sy_tc, sy_obj): Define so that the fields look like they used to,
+       until all references get changed.
+
+       * write.c (fixup_segment): Lots of variables no longer register.
+       Reordered some code for easier reading.
+       * config/obj-coff.c (obj_coff_dim): dim_index no longer register.
+       Deleted superfluous return statement.
+       (obj_coff_line, obj_coff_size, obj_coff_scl, obj_coff_type,
+       obj_coff_val, tag_init, tag_insert): Deleted superfluous return
+       statement.
+       (align, obj_coff_section): Deleted debugging printfs.
+       * config/tc-i386.c (md_assemble): Discard some register decls.
+       Use assignment rather than memcpy to copy template.
+       (op_hash, reg_hash, prefix_hash): Default C initialization of
+       statics is sufficient.
+       * config/tc-sparc.c (print_insn): Array Reloc is now const, and
+       points to const.
+
+       * config/obj-coff.h (TARGET_FORMAT): Only use coff-sparc-lynx if
+       TE_LYNX; use coff-sparc otherwise.
+       [USE_NATIVE_HEADERS]: Delete this code; it isn't used.
+
+       * write.c (fixup_segment): Call TC_VALIDATE_FIX, if defined,
+       before processing a fixup.  Call TC_ADJUST_RELOC_COUNT just before
+       returning.  Remove some i960-coff-specific code.
+       (TC_ADJUST_RELOC_COUNT): Default to doing nothing.
+       * config/tc-i960.h (TC_ADJUST_RELOC_COUNT) [OBJ_COFF]: Define.
+       (i960_validate_fix): Declare.
+       (TC_VALIDATE_FIX): Define.
+       * config/tc-i960.c (i960_validate_fix): New function.
+
+       * write.c (number_to_chars_littleendian): New function.  Write out
+       bytes in little endian order, doing size and range checking.
+       (number_to_chars_bigendian): New function, similar.
+       * write.h: Declare them.
+       * config/tc-*.c (md_number_to_chars): Use them.
+       * config/tc-vax.c (md_apply_fix): Ditto.
+       * config/tc-i386.c (md_apply_fix): Ditto.
+
+       * config/obj-coff.c: Rearranged code for handling line number
+       data.
+       (line_fsym): Renamed from function_lineoff in BFD_ASSEMBLER case,
+       since the usage is different from non-BFD_ASSEMBLER case.
+       (in_function, clear_function, set_function): New macros, to
+       combine some of the functionality implemented in differnet ways in
+       BFD_ASSEMBLER and non-... code.  Used in other functions that used
+       to check function_lineoff &c.
+       (obj_emit_lineno): Split into two copies, one for BFD_ASSEMBLER,
+       one for not.  Non-BFD_ASSEMBLER version now has temporary variable
+       to contain char* pointer pointed to by char** argument.  Always
+       follow CROSS_COMPILE code; easier to read that way.
+       (obj_coff_ln): Don't call add_lineno or c_line_new if appline is
+       set.
+       (obj_coff_endef) [BFD_ASSEMBLER]: Don't do anything special for
+       ".bf", it's been done elsewhere.
+       (coff_frob_symbol): If ilne number data is pending, call
+       add_linesym to flush it.
+       (coff_frob_file): Don't do that here.
+       * config/obj-coff.h (coff_frob_file): Declare.
+       (obj_frob_file): Define, to call it.
+
+       * config/tc-sparc.h (md_create_short_jump, md_create_long_jump,
+       md_estimate_size_before_relax: Define them as macros calling
+       as_fatal.
+       * config/tc-sparc.c: Don't define them as functions.
+
+       * configure.in: Handle target alpha-*-osf*.  (No cpu files yet.)
+
 Wed Dec  1 23:37:14 1993  Jeffrey A. Law  (law@snake.cs.utah.edu)
 
        * Makefile (clean): Depend on clean-here.
index 877a924997eeab4da43b05e69db8e77491595546..24414b3363ef386b209bec2ab34d9ba179e2edd0 100644 (file)
@@ -776,23 +776,7 @@ md_number_to_chars (buf, val, n)
      valueT val;
      int n;
 {
-
-  switch (n)
-    {
-
-    case 4:
-      *buf++ = val >> 24;
-      *buf++ = val >> 16;
-    case 2:
-      *buf++ = val >> 8;
-    case 1:
-      *buf = val;
-      break;
-
-    default:
-      as_fatal ("failed sanity check.");
-    }
-  return;
+  number_to_chars_bigendian (buf, val, n);
 }
 
 void
index 651b1733d7d0ad7d3a2c6749d8b2cfd54b7a37be..ea3f335672ccb2103346b1fe3888906a5674d98c 100644 (file)
@@ -1523,25 +1523,12 @@ md_number_to_chars (ptr, use, nbytes)
      valueT use;
      int nbytes;
 {
-  switch (nbytes)
-    {
-    case 4:
-      *ptr++ = (use >> 24) & 0xff;
-    case 3:
-      *ptr++ = (use >> 16) & 0xff;
-    case 2:
-      *ptr++ = (use >> 8) & 0xff;
-    case 1:
-      *ptr++ = (use >> 0) & 0xff;
-      break;
-    default:
-      abort ();
-    }
+  number_to_chars_bigendian (ptr, use, nbytes);
 }
+
 long
 md_pcrel_from (fixP)
      fixS *fixP;
-
 {
   return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address;
 }
index 095fec9ec50148d116bce13fcbe7bc6eef4b1149..d07347511b1d45a9b99e6a7f2b071dee2f867184 100644 (file)
@@ -2613,21 +2613,7 @@ md_number_to_chars (buf, val, n)
      valueT val;
      int n;
 {
-
-  switch (n)
-    {
-    case 4:
-      *buf++ = val >> 24;
-      *buf++ = val >> 16;
-    case 2:
-      *buf++ = val >> 8;
-    case 1:
-      *buf = val;
-      break;
-    default:
-      abort ();
-    }
-  return;
+  number_to_chars_bigendian (buf, val, n);
 }
 
 /* Translate internal representation of relocation info to BFD target
index 84ba82372bee6f141dbd56ffefa9351196e38113..432b606d6388392f70b2d72e480abb241ad4e0a6 100644 (file)
@@ -945,20 +945,7 @@ md_number_to_chars (buf, val, nbytes)
      valueT val;
      int nbytes;
 {
-  switch (nbytes)
-    {
-    case 4:
-      *buf++ = val >> 24;
-      *buf++ = val >> 16;
-    case 2:
-      *buf++ = val >> 8;
-    case 1:
-      *buf = val;
-      break;
-
-    default:
-      abort ();
-    }
+  number_to_chars_bigendian (buf, val, nbytes);
 }
 
 #if 0
index ed5fb61984ee649106c0b4ca5817884a130288cd..7670be3d1ed5970ba3714e2a90fd8285a7e27741 100644 (file)
@@ -460,18 +460,7 @@ md_number_to_chars (con, value, nbytes)
      valueT value;             /* The value of the bits. */
      int nbytes;               /* Number of bytes in the output. */
 {
-  int n = nbytes;
-  valueT v = value;
-
-  con += nbytes - 1;           /* Tahoes is (Bleah!) big endian */
-  while (nbytes--)
-    {
-      *con-- = value;          /* Lint wants & MASK_CHAR. */
-      value >>= BITS_PER_CHAR;
-    }
-  /* XXX line number probably botched for this warning message. */
-  if (value != 0 && value != -1)
-    as_warn ("Displacement (%ld) long for instruction field length (%d).", v, n);
+  number_to_chars_bigendian (con, value, nbytes);
 }
 
 #ifdef comment
This page took 0.949741 seconds and 4 git commands to generate.