#ifndef TC_I386
#define TC_I386 1
#ifndef BFD_ASSEMBLER
#error So, do you know what you are doing?
#endif
#ifdef ANSI_PROTOTYPES
struct fix;
#endif
#define TARGET_BYTES_BIG_ENDIAN 0
#define TARGET_ARCH bfd_arch_i386
#define TARGET_MACH (i386_mach ())
extern unsigned long i386_mach (void);
#ifdef TE_FreeBSD
#define AOUT_TARGET_FORMAT "a.out-i386-freebsd"
#endif
#ifdef TE_NetBSD
#define AOUT_TARGET_FORMAT "a.out-i386-netbsd"
#endif
#ifdef TE_386BSD
#define AOUT_TARGET_FORMAT "a.out-i386-bsd"
#endif
#ifdef TE_LINUX
#define AOUT_TARGET_FORMAT "a.out-i386-linux"
#endif
#ifdef TE_Mach
#define AOUT_TARGET_FORMAT "a.out-mach3"
#endif
#ifdef TE_DYNIX
#define AOUT_TARGET_FORMAT "a.out-i386-dynix"
#endif
#ifndef AOUT_TARGET_FORMAT
#define AOUT_TARGET_FORMAT "a.out-i386"
#endif
#ifdef TE_FreeBSD
#define ELF_TARGET_FORMAT "elf32-i386-freebsd"
#endif
#ifndef ELF_TARGET_FORMAT
#define ELF_TARGET_FORMAT "elf32-i386"
#endif
#if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \
|| defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF))
extern const char *i386_target_format PARAMS ((void));
#define TARGET_FORMAT i386_target_format ()
#else
#ifdef OBJ_ELF
#define TARGET_FORMAT ELF_TARGET_FORMAT
#endif
#ifdef OBJ_AOUT
#define TARGET_FORMAT AOUT_TARGET_FORMAT
#endif
#endif
#if (defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF))
#define md_end i386_elf_emit_arch_note
extern void i386_elf_emit_arch_note PARAMS ((void));
#endif
#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0
#define LOCAL_LABELS_FB 1
extern const char extra_symbol_chars[];
#define tc_symbol_chars extra_symbol_chars
#define MAX_OPERANDS 3
#define MAX_IMMEDIATE_OPERANDS 2
#define MAX_MEMORY_OPERANDS 2
#define WAIT_PREFIX 0
#define LOCKREP_PREFIX 1
#define ADDR_PREFIX 2
#define DATA_PREFIX 3
#define SEG_PREFIX 4
#define REX_PREFIX 5
#define MAX_PREFIXES 6
#define REGISTER_PREFIX '%'
#define IMMEDIATE_PREFIX '$'
#define ABSOLUTE_PREFIX '*'
#define TWO_BYTE_OPCODE_ESCAPE 0x0f
#define NOP_OPCODE (char) 0x90
#define EBP_REG_NUM 5
#define ESP_REG_NUM 4
#define ESCAPE_TO_TWO_BYTE_ADDRESSING ESP_REG_NUM
#define NO_INDEX_REGISTER ESP_REG_NUM
#define NO_BASE_REGISTER EBP_REG_NUM
#define NO_BASE_REGISTER_16 6
#define WORD_MNEM_SUFFIX 'w'
#define BYTE_MNEM_SUFFIX 'b'
#define SHORT_MNEM_SUFFIX 's'
#define LONG_MNEM_SUFFIX 'l'
#define QWORD_MNEM_SUFFIX 'q'
#define LONG_DOUBLE_MNEM_SUFFIX 'x'
#define REGMEM_FIELD_HAS_REG 0x3
#define REGMEM_FIELD_HAS_MEM (~REGMEM_FIELD_HAS_REG)
#define END_OF_INSN '\0'
typedef struct
{
char *name;
unsigned int operands;
unsigned int base_opcode;
unsigned int extension_opcode;
#define None 0xffff
unsigned int cpu_flags;
#define Cpu086 0x1
#define Cpu186 0x2
#define Cpu286 0x4
#define Cpu386 0x8
#define Cpu486 0x10
#define Cpu586 0x20
#define Cpu686 0x40
#define CpuP4 0x80
#define CpuK6 0x100
#define CpuAthlon 0x200
#define CpuSledgehammer 0x400
#define CpuMMX 0x800
#define CpuMMX2 0x1000
#define CpuSSE 0x2000
#define CpuSSE2 0x4000
#define Cpu3dnow 0x8000
#define Cpu3dnowA 0x10000
#define CpuPNI 0x20000
#define CpuPadLock 0x40000
#define Cpu64 0x4000000
#define CpuNo64 0x8000000
#define CpuUnknownFlags (Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuPNI|Cpu3dnow|Cpu3dnowA|CpuK6|CpuAthlon|CpuPadLock)
unsigned int opcode_modifier;
#define W 0x1
#define D 0x2
#define Modrm 0x4
#define FloatR 0x8
#define ShortForm 0x10
#define FloatMF 0x20
#define Jump 0x40
#define JumpDword 0x80
#define JumpByte 0x100
#define JumpInterSegment 0x200
#define FloatD 0x400
#define Seg2ShortForm 0x800
#define Seg3ShortForm 0x1000
#define Size16 0x2000
#define Size32 0x4000
#define Size64 0x8000
#define IgnoreSize 0x10000
#define DefaultSize 0x20000
#define No_bSuf 0x40000
#define No_wSuf 0x80000
#define No_lSuf 0x100000
#define No_sSuf 0x200000
#define No_qSuf 0x400000
#define No_xSuf 0x800000
#define FWait 0x1000000
#define IsString 0x2000000
#define regKludge 0x4000000
#define IsPrefix 0x8000000
#define ImmExt 0x10000000
#define NoRex64 0x20000000
#define Rex64 0x40000000
#define Ugh 0x80000000
unsigned int operand_types[3];
#define Reg8 0x1
#define Reg16 0x2
#define Reg32 0x4
#define Reg64 0x8
#define Imm8 0x10
#define Imm8S 0x20
#define Imm16 0x40
#define Imm32 0x80
#define Imm32S 0x100
#define Imm64 0x200
#define Imm1 0x400
#define BaseIndex 0x800
#define Disp8 0x1000
#define Disp16 0x2000
#define Disp32 0x4000
#define Disp32S 0x8000
#define Disp64 0x10000
#define InOutPortReg 0x20000
#define ShiftCount 0x40000
#define Control 0x80000
#define Debug 0x100000
#define Test 0x200000
#define FloatReg 0x400000
#define FloatAcc 0x800000
#define SReg2 0x1000000
#define SReg3 0x2000000
#define Acc 0x4000000
#define JumpAbsolute 0x8000000
#define RegMMX 0x10000000
#define RegXMM 0x20000000
#define EsSeg 0x40000000
#define InvMem 0x80000000
#define Reg (Reg8|Reg16|Reg32|Reg64)
#define WordReg (Reg16|Reg32|Reg64)
#define ImplicitRegister (InOutPortReg|ShiftCount|Acc|FloatAcc)
#define Imm (Imm8|Imm8S|Imm16|Imm32S|Imm32|Imm64)
#define EncImm (Imm8|Imm16|Imm32|Imm32S)
#define Disp (Disp8|Disp16|Disp32|Disp32S|Disp64)
#define AnyMem (Disp8|Disp16|Disp32|Disp32S|BaseIndex|InvMem)
#define LLongMem AnyMem
#define LongMem AnyMem
#define ShortMem AnyMem
#define WordMem AnyMem
#define ByteMem AnyMem
}
template;
typedef struct
{
const template *start;
const template *end;
}
templates;
typedef struct
{
char *reg_name;
unsigned int reg_type;
unsigned int reg_flags;
#define RegRex 0x1
#define RegRex64 0x2
unsigned int reg_num;
}
reg_entry;
typedef struct
{
char *seg_name;
unsigned int seg_prefix;
}
seg_entry;
typedef struct
{
unsigned int regmem;
unsigned int reg;
unsigned int mode;
}
modrm_byte;
typedef int rex_byte;
#define REX_OPCODE 0x40
#define REX_MODE64 8
#define REX_EXTX 4
#define REX_EXTY 2
#define REX_EXTZ 1
typedef struct
{
unsigned base;
unsigned index;
unsigned scale;
}
sib_byte;
typedef struct
{
const char *name;
unsigned int flags;
}
arch_entry;
#ifndef GLOBAL_OFFSET_TABLE_NAME
#define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_"
#endif
#ifndef LEX_AT
#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) x86_cons (EXP, NBYTES)
extern void x86_cons PARAMS ((expressionS *, int));
#define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) x86_cons_fix_new(FRAG, OFF, LEN, EXP)
extern void x86_cons_fix_new
PARAMS ((fragS *, unsigned int, unsigned int, expressionS *));
#endif
#ifdef TE_PE
#define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) x86_pe_cons_fix_new(FRAG, OFF, LEN, EXP)
extern void x86_pe_cons_fix_new
PARAMS ((fragS *, unsigned int, unsigned int, expressionS *));
#endif
#define DIFF_EXPR_OK
#define NO_RELOC BFD_RELOC_NONE
void i386_validate_fix PARAMS ((struct fix *));
#define TC_VALIDATE_FIX(FIX,SEGTYPE,SKIP) i386_validate_fix(FIX)
#define tc_fix_adjustable(X) tc_i386_fix_adjustable(X)
extern int tc_i386_fix_adjustable PARAMS ((struct fix *));
#define MD_APPLY_SYM_VALUE(FIX) 0
#if defined (TE_PE) && defined (STRICT_PE_FORMAT)
#define EXTERN_FORCE_RELOC \
(OUTPUT_FLAVOR == bfd_target_elf_flavour \
|| OUTPUT_FLAVOR == bfd_target_coff_flavour)
#else
#define EXTERN_FORCE_RELOC \
(OUTPUT_FLAVOR == bfd_target_elf_flavour)
#endif
#define TC_FORCE_RELOCATION_LOCAL(FIX) \
(!(FIX)->fx_pcrel \
|| (FIX)->fx_plt \
|| (FIX)->fx_r_type == BFD_RELOC_386_PLT32 \
|| (FIX)->fx_r_type == BFD_RELOC_386_GOT32 \
|| (FIX)->fx_r_type == BFD_RELOC_386_GOTPC \
|| TC_FORCE_RELOCATION (FIX))
#define md_operand(x)
extern const struct relax_type md_relax_table[];
#define TC_GENERIC_RELAX_TABLE md_relax_table
extern int optimize_align_code;
#define md_do_align(n, fill, len, max, around) \
if ((n) \
&& !need_pass_2 \
&& optimize_align_code \
&& (!(fill) \
|| ((char)*(fill) == (char)0x90 && (len) == 1)) \
&& subseg_text_p (now_seg)) \
{ \
frag_align_code ((n), (max)); \
goto around; \
}
#define MAX_MEM_FOR_RS_ALIGN_CODE 15
extern void i386_align_code PARAMS ((fragS *, int));
#define HANDLE_ALIGN(fragP) \
if (fragP->fr_type == rs_align_code) \
i386_align_code (fragP, (fragP->fr_next->fr_address \
- fragP->fr_address \
- fragP->fr_fix));
void i386_print_statistics PARAMS ((FILE *));
#define tc_print_statistics i386_print_statistics
#define md_number_to_chars number_to_chars_littleendian
#ifdef SCO_ELF
#define tc_init_after_args() sco_id ()
extern void sco_id PARAMS ((void));
#endif
#define TARGET_USE_CFIPOP 1
extern unsigned int x86_dwarf2_return_column;
#define DWARF2_DEFAULT_RETURN_COLUMN x86_dwarf2_return_column
extern int x86_cie_data_alignment;
#define DWARF2_CIE_DATA_ALIGNMENT x86_cie_data_alignment
#define tc_regname_to_dw2regnum tc_x86_regname_to_dw2regnum
extern int tc_x86_regname_to_dw2regnum PARAMS ((const char *regname));
#define tc_cfi_frame_initial_instructions tc_x86_frame_initial_instructions
extern void tc_x86_frame_initial_instructions PARAMS ((void));
#define md_elf_section_type(str,len) i386_elf_section_type (str, len)
extern int i386_elf_section_type PARAMS ((const char *, size_t len));
#ifdef TE_PE
#define O_secrel O_md1
#define TC_DWARF2_EMIT_OFFSET tc_pe_dwarf2_emit_offset
void tc_pe_dwarf2_emit_offset (symbolS *, unsigned int);
#endif
#endif