This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Move i386 opcode to opcodes/i386-opc.c
On Wed, Mar 21, 2007 at 11:28:12AM +0100, Andreas Schwab wrote:
> Andreas Schwab <schwab@suse.de> writes:
>
> > "H. J. Lu" <hjl@lucon.org> writes:
> >
> >> --- binutils/gas/config/tc-i386.h.opc 2007-03-12 14:36:55.000000000 -0700
> >> +++ binutils/gas/config/tc-i386.h 2007-03-14 14:21:57.000000000 -0700
> >> @@ -96,10 +96,6 @@ extern const char extra_symbol_chars[];
> >> extern const char *i386_comment_chars;
> >> #define tc_comment_chars i386_comment_chars
> >>
> >> -#define MAX_OPERANDS 4 /* max operands per insn */
> >> -#define MAX_IMMEDIATE_OPERANDS 2/* max immediates per insn (lcall, ljmp, insertq, extrq) */
> >> -#define MAX_MEMORY_OPERANDS 2 /* max memory refs per insn (string ops) */
> >> -
> >> /* Prefixes will be emitted in the order defined below.
> >> WAIT_PREFIX must be the first prefix since FWAIT is really is an
> >> instruction, and so must come before any prefixes.
> >> @@ -118,21 +114,6 @@ extern const char *i386_comment_chars;
> >> #define IMMEDIATE_PREFIX '$'
> >> #define ABSOLUTE_PREFIX '*'
> >>
> >> -#define TWO_BYTE_OPCODE_ESCAPE 0x0f
> >> -#define NOP_OPCODE (char) 0x90
> >
> > Which means that frag_align_code no longer nop-fills.
>
> Installed as obvious.
>
> Andreas.
>
> 2007-03-21 Andreas Schwab <schwab@suse.de>
>
> * config/tc-i386.h (NOP_OPCODE): Restore.
>
NOP_OPCODE is defined in opcode/i386.h. We just need to include
"opcodes/i386-opc.h" in config/tc-i386.h.
H.J.
---
2007-03-21 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.am: Run dep-am.
* Makefile.in: Regenerated.
* config/tc-i386.c: Don't include "opcodes/i386-opc.h".
* config/tc-i386.h: Include "opcodes/i386-opc.h".
(NOP_OPCODE): Removed.
(template): Likewise.
--- gas/Makefile.am.nop 2007-03-15 07:31:37.000000000 -0700
+++ gas/Makefile.am 2007-03-21 06:46:18.000000000 -0700
@@ -1117,22 +1117,22 @@ DEPTC_i370_elf = $(srcdir)/config/obj-el
struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h \
$(INCDIR)/elf/reloc-macros.h
DEPTC_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
+ $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
DEPTC_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
+ $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
DEPTC_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
+ $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
+ subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
+ $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
DEPTC_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \
@@ -1543,18 +1543,21 @@ DEPOBJ_i370_elf = $(srcdir)/config/obj-e
$(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/i370.h \
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
DEPOBJ_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/obstack.h
DEPOBJ_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
subsegs.h $(INCDIR)/obstack.h
DEPOBJ_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/x86-64.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
+ $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
+ dwarf2dbg.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \
+ $(INCDIR)/aout/aout64.h
DEPOBJ_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \
@@ -1884,15 +1887,18 @@ DEP_i370_elf = $(srcdir)/config/obj-elf.
$(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
$(BFDDIR)/libcoff.h
DEP_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
DEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
DEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
+ $(INCDIR)/opcode/i386.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
+ $(BFDDIR)/libcoff.h
DEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
$(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h dwarf2dbg.h \
--- gas/Makefile.in.nop 2007-03-15 07:31:37.000000000 -0700
+++ gas/Makefile.in 2007-03-21 06:46:40.000000000 -0700
@@ -886,24 +886,24 @@ DEPTC_i370_elf = $(srcdir)/config/obj-el
$(INCDIR)/elf/reloc-macros.h
DEPTC_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
+ $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
DEPTC_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \
subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
- $(INCDIR)/elf/dwarf2.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
+ $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
DEPTC_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(srcdir)/../opcodes/i386-opc.h \
- $(INCDIR)/opcode/i386.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
+ $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
+ subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h \
+ $(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h
DEPTC_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
@@ -1391,20 +1391,23 @@ DEPOBJ_i370_elf = $(srcdir)/config/obj-e
$(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
DEPOBJ_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \
$(INCDIR)/obstack.h
DEPOBJ_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \
subsegs.h $(INCDIR)/obstack.h
DEPOBJ_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h dwarf2dbg.h \
- $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \
- $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/x86-64.h \
- $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
+ $(INCDIR)/opcode/i386.h dwarf2dbg.h $(INCDIR)/safe-ctype.h \
+ subsegs.h $(INCDIR)/obstack.h $(INCDIR)/obstack.h struc-symbol.h \
+ dwarf2dbg.h $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/reloc-macros.h \
+ $(INCDIR)/aout/aout64.h
DEPOBJ_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
@@ -1811,17 +1814,20 @@ DEP_i370_elf = $(srcdir)/config/obj-elf.
$(BFDDIR)/libcoff.h
DEP_i386_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h
DEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \
+ $(srcdir)/../opcodes/i386-opc.h $(INCDIR)/opcode/i386.h \
$(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
DEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
- $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h dwarf2dbg.h \
- $(srcdir)/config/obj-coff.h $(INCDIR)/coff/internal.h \
- $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h
+ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h $(srcdir)/../opcodes/i386-opc.h \
+ $(INCDIR)/opcode/i386.h dwarf2dbg.h $(srcdir)/config/obj-coff.h \
+ $(INCDIR)/coff/internal.h $(INCDIR)/coff/x86_64.h $(INCDIR)/coff/external.h \
+ $(BFDDIR)/libcoff.h
DEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \
$(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
--- gas/config/tc-i386.c.nop 2007-03-15 10:30:57.000000000 -0700
+++ gas/config/tc-i386.c 2007-03-21 06:44:19.000000000 -0700
@@ -32,7 +32,6 @@
#include "subsegs.h"
#include "dwarf2dbg.h"
#include "dw2gencfi.h"
-#include "opcodes/i386-opc.h"
#include "elf/x86-64.h"
#ifndef REGISTER_WARNINGS
--- gas/config/tc-i386.h.nop 2007-03-21 06:30:54.000000000 -0700
+++ gas/config/tc-i386.h 2007-03-21 06:45:35.000000000 -0700
@@ -23,6 +23,8 @@
#ifndef TC_I386
#define TC_I386 1
+#include "opcodes/i386-opc.h"
+
struct fix;
#define TARGET_BYTES_BIG_ENDIAN 0
@@ -114,9 +116,6 @@ extern const char *i386_comment_chars;
#define IMMEDIATE_PREFIX '$'
#define ABSOLUTE_PREFIX '*'
-/* Byte to use for filling in frag_align_code. */
-#define NOP_OPCODE (char) 0x90
-
/* these are the instruction mnemonic suffixes. */
#define WORD_MNEM_SUFFIX 'w'
#define BYTE_MNEM_SUFFIX 'b'
@@ -135,12 +134,10 @@ extern const char *i386_comment_chars;
The templates themselves start at START and range up to (but not including)
END.
*/
-struct template;
-
typedef struct
{
- const struct template *start;
- const struct template *end;
+ const template *start;
+ const template *end;
}
templates;