From: Ken Raeburn Date: Thu, 20 Jun 1996 20:06:44 +0000 (+0000) Subject: * config/tc-i386.c (md_number_to_chars): Deleted. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=214f540d12e910ed6f9977971585b9b8cbe0254d;p=binutils-gdb.git * config/tc-i386.c (md_number_to_chars): Deleted. * config/tc-i386.h (md_number_to_chars): New macro. * config/tc-alpha.c (build_operate_n, build_mem): Moved earlier in the file. (load_symbol_address, load_expression): Use build_mem. (build_operate): New function. (emit_addq_r): Use it. Wed Mar 13 22:14:14 1996 Pat Rankin * symbols.c (colon): #if VMS, use S_SET_OTHER to store `const_flag'. Tue Mar 5 14:31:45 1996 Pat Rankin * config/tc-vax.h (NOP_OPCODE): Define. Sun Feb 4 21:01:03 1996 Pat Rankin * config/obj-vms.h (S_IS_COMMON): Define. (S_IS_LOCAL): Check for \002 as well as \001. (LONGWORD_ALIGNMENT): New macro. (SUB_SEGMENT_ALIGN): Use it. Fri Jan 26 17:44:09 1996 Pat Rankin * config/vms-conf.h: Reconcile with conf.in. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 6b10cd18364..d59f7215442 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,33 @@ +Thu Jun 20 15:57:41 1996 Ken Raeburn + + * config/tc-i386.c (md_number_to_chars): Deleted. + * config/tc-i386.h (md_number_to_chars): New macro. + + * config/tc-alpha.c (build_operate_n, build_mem): Moved earlier in + the file. + (load_symbol_address, load_expression): Use build_mem. + (build_operate): New function. + (emit_addq_r): Use it. + + Wed Mar 13 22:14:14 1996 Pat Rankin + + * symbols.c (colon): #if VMS, use S_SET_OTHER to store `const_flag'. + + Tue Mar 5 14:31:45 1996 Pat Rankin + + * config/tc-vax.h (NOP_OPCODE): Define. + + Sun Feb 4 21:01:03 1996 Pat Rankin + + * config/obj-vms.h (S_IS_COMMON): Define. + (S_IS_LOCAL): Check for \002 as well as \001. + (LONGWORD_ALIGNMENT): New macro. + (SUB_SEGMENT_ALIGN): Use it. + + Fri Jan 26 17:44:09 1996 Pat Rankin + + * config/vms-conf.h: Reconcile with conf.in. + Wed Jun 19 11:31:50 1996 Ian Lance Taylor * write.c (is_dnrange): Only define if TC_GENERIC_RELAX_TABLE is diff --git a/gas/config/obj-vms.h b/gas/config/obj-vms.h index 1105bb2f860..7421bb5aacb 100644 --- a/gas/config/obj-vms.h +++ b/gas/config/obj-vms.h @@ -1,5 +1,5 @@ /* VMS object file format - Copyright (C) 1989, 1990, 1991, 1994, 1995 Free Software Foundation, Inc. + Copyright (C) 1989,90,91,94,95,1996 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -22,6 +22,8 @@ to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1 #include "targ-cpu.h" +#define LONGWORD_ALIGNMENT 2 + /* This macro controls subsection alignment within a section. * * Under VAX/VMS, the linker (and PSECT specifications) @@ -29,7 +31,8 @@ to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1 * Doing the alignment here (on initialized data) can * mess up the calculation of global data PSECT sizes. */ -#define SUB_SEGMENT_ALIGN(SEG) (((SEG) == data_section) ? 0 : 2) +#define SUB_SEGMENT_ALIGN(SEG) \ + (((SEG) == data_section) ? 0 : LONGWORD_ALIGNMENT) /* This flag is used to remember whether we are in the const or the data section. By and large they are identical, but we set a no-write @@ -132,6 +135,8 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */ /* True if symbol has been defined, ie is in N_{TEXT,DATA,BSS,ABS} or N_EXT */ #define S_IS_DEFINED(s) (S_GET_TYPE(s) != N_UNDF) +#define S_IS_COMMON(s) (S_GET_TYPE(s) == N_UNDF && S_GET_VALUE(s) != 0) + #define S_IS_REGISTER(s) ((s)->sy_symbol.n_type == N_REGISTER) /* True if a debug special symbol entry */ @@ -141,7 +146,8 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */ nameless symbols come from .stab directives. */ #define S_IS_LOCAL(s) (S_GET_NAME(s) && \ !S_IS_DEBUG(s) && \ - (S_GET_NAME(s)[0] == '\001' || \ + (strchr(S_GET_NAME(s), '\001') != 0 || \ + strchr(S_GET_NAME(s), '\002') != 0 || \ (S_LOCAL_NAME(s) && !flag_keep_locals))) /* True if a symbol is not defined in this file */ #define S_IS_EXTERN(s) ((s)->sy_symbol.n_type & N_EXT) diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c index a597dbc6262..f35ea203387 100644 --- a/gas/config/tc-alpha.c +++ b/gas/config/tc-alpha.c @@ -860,6 +860,34 @@ md_section_align (seg, size) return size; } +static int +build_mem (opc, ra, rb, disp) + int opc, ra, rb; + bfd_signed_vma disp; +{ + if ((disp >> 15) != 0 + && (disp >> 15) + 1 != 0) + abort (); + return ((opc << 26) | (ra << SA) | (rb << SB) | (disp & 0xffff)); +} + +static int +build_operate_n (opc, fn, ra, lit, rc) + int opc, fn, ra, rc; + int lit; +{ + if (lit & ~0xff) + abort (); + return ((opc << 26) | (fn << 5) | (ra << SA) | (lit << SN) | (1 << 12) | (rc << SC)); +} + +static int +build_operate (opc, fn, ra, rb, rc) + int opc, fn, ra, rb, rc; +{ + return ((opc << 26) | (fn << 5) | (ra << SA) | (rb << SB) | (rc << SC)); +} + /* Add this thing to the .lita section and produce a LITERAL reloc referring to it. */ @@ -898,16 +926,8 @@ load_symbol_address (reg, insn) /* Overflow? */ as_fatal ("overflow in literal (.lita) table"); x = retval; - if (addr32) - insn->opcode = (0xa0000000 /* ldl */ - | (reg << SA) - | (base_register << SB) - | (x & 0xffff)); - else - insn->opcode = (0xa4000000 /* ldq */ - | (reg << SA) - | (base_register << SB) - | (x & 0xffff)); + insn->opcode = build_mem (addr32 ? 0x28 : 0x29, /* ldl or ldq */ + reg, base_register, x & 0xffff); note_gpreg (base_register); } @@ -958,20 +978,15 @@ load_expression (reg, insn) an LDAH instruction. */ if (addendlo) { - insn[1].opcode = (0x20000000 /* lda */ - | (reg << SA) - | (reg << SB) - | (addendlo & 0xffff)); + insn[1].opcode = build_mem (0x08, reg, reg, addendlo & 0xffff); insn[1].reloc[0].code = BFD_RELOC_ALPHA_LITUSE; insn[1].reloc[0].exp = lituse_basereg; num_insns++; } if (addendhi) { - insn[num_insns].opcode = (0x24000000 - | (reg << SA) - | (reg << SB) - | (addendhi & 0xffff)); + insn[num_insns].opcode = build_mem (0x09, reg, reg, + addendhi & 0xffff); num_insns++; } if (num_insns == 1) @@ -1118,27 +1133,6 @@ emit_bis_r (in1, in2, out) md_assemble (buf); } -static int -build_mem (opc, ra, rb, disp) - int opc, ra, rb; - bfd_signed_vma disp; -{ - if ((disp >> 15) != 0 - && (disp >> 15) + 1 != 0) - abort (); - return ((opc << 26) | (ra << SA) | (rb << SB) | (disp & 0xffff)); -} - -static int -build_operate_n (opc, fn, ra, lit, rc) - int opc, fn, ra, rc; - int lit; -{ - if (lit & ~0xff) - abort (); - return ((opc << 26) | (fn << 5) | (ra << SA) | (lit << SN) | (1 << 12) | (rc << SC)); -} - static void emit_sll_n (dest, disp, src) int dest, disp, src; @@ -1163,7 +1157,7 @@ emit_addq_r (in1, in2, out) int in1, in2, out; { struct alpha_it insn = clear_insn; - insn.opcode = 0x40000400 | (in1 << SA) | (in2 << SB) | (out << SC); + insn.opcode = build_operate (0x10, 0x20, in1, in2, out); emit_insn (&insn); } diff --git a/gas/config/vms-conf.h b/gas/config/vms-conf.h index c948d1a0331..9eada1dba2a 100644 --- a/gas/config/vms-conf.h +++ b/gas/config/vms-conf.h @@ -12,6 +12,9 @@ This function is required for alloca.c support on those systems. */ #undef CRAY_STACKSEG_END +/* Define if you have alloca, as a function or macro. */ +#undef HAVE_ALLOCA + /* Define if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H @@ -65,13 +68,38 @@ #undef MANY_SEGMENTS -/* Needed only for sparc configuration */ +/* Needed only for sparc configuration. */ #undef SPARC_V9 #undef SPARC_ARCH64 +/* Needed only for some configurations that can produce multiple output + formats. */ +#undef DEFAULT_EMULATION +#undef EMULATIONS +#undef USE_EMULATIONS +#undef OBJ_MAYBE_AOUT +#undef OBJ_MAYBE_BOUT +#undef OBJ_MAYBE_COFF +#undef OBJ_MAYBE_ECOFF +#undef OBJ_MAYBE_ELF +#undef OBJ_MAYBE_GENERIC +#undef OBJ_MAYBE_HP300 +#undef OBJ_MAYBE_IEEE +#undef OBJ_MAYBE_SOM +#undef OBJ_MAYBE_VMS + +/* Used for some of the COFF configurations, when the COFF code needs + to select something based on the CPU type before it knows it... */ +#undef I386COFF +#undef M68KCOFF +#undef M88KCOFF + /* Define if you have the remove function. */ #define HAVE_REMOVE +/* sbrk() is available, but we don't want gas to use it. */ +#undef HAVE_SBRK + /* Define if you have the unlink function. */ #undef HAVE_UNLINK diff --git a/gas/symbols.c b/gas/symbols.c index b1212cbd42c..dde84f4ecdb 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -229,7 +229,7 @@ colon (sym_name) /* just seen "x:" - rattle symbols & frags */ { symbolP->sy_frag = frag_now; #ifdef OBJ_VMS - S_GET_OTHER(symbolP) = const_flag; + S_SET_OTHER(symbolP, const_flag); #endif S_SET_VALUE (symbolP, (valueT) frag_now_fix ()); S_SET_SEGMENT (symbolP, now_seg); @@ -281,8 +281,8 @@ colon (sym_name) /* just seen "x:" - rattle symbols & frags */ data. */ symbolP->sy_frag = frag_now; #ifdef OBJ_VMS - S_GET_OTHER(symbolP) = const_flag; -#endif /* OBJ_VMS */ + S_SET_OTHER(symbolP, const_flag); +#endif S_SET_VALUE (symbolP, (valueT) frag_now_fix ()); S_SET_SEGMENT (symbolP, now_seg); /* keep N_EXT bit */ }