Ignore:
Timestamp:
Aug 16, 2003, 11:33:53 PM (22 years ago)
Author:
bird
Message:

Joined the port of 2.11.2 with 2.14.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/binutils/gas/config/tc-i386.h

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r617 r618  
    11/* tc-i386.h -- Header file for tc-i386.c
    22   Copyright 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
    3    2001
     3   2001, 2002, 2003
    44   Free Software Foundation, Inc.
    55
     
    3535
    3636#ifdef BFD_ASSEMBLER
    37 /* This is used to determine relocation types in tc-i386.c.  The first
    38    parameter is the current relocation type, the second one is the desired
    39    type.  The idea is that if the original type is already some kind of PIC
    40    relocation, we leave it alone, otherwise we give it the desired type */
    41 
    42 #define tc_fix_adjustable(X)  tc_i386_fix_adjustable(X)
    43 extern int tc_i386_fix_adjustable PARAMS ((struct fix *));
    44 
    45 #if (defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF) || defined (OBJ_MAYBE_COFF) || defined (OBJ_COFF)) && !defined (TE_PE)
    46 /* This arranges for gas/write.c to not apply a relocation if
    47    tc_fix_adjustable() says it is not adjustable.
    48    The "! symbol_used_in_reloc_p" test is there specifically to cover
    49    the case of non-global symbols in linkonce sections.  It's the
    50    generally correct thing to do though;  If a reloc is going to be
    51    emitted against a symbol then we don't want to adjust the fixup by
    52    applying the reloc during assembly.  The reloc will be applied by
    53    the linker during final link.  */
    54 #define TC_FIX_ADJUSTABLE(fixP) \
    55   (! symbol_used_in_reloc_p ((fixP)->fx_addsy) && tc_fix_adjustable (fixP))
    56 #endif
    57 
    58 /* This expression evaluates to false if the relocation is for a local object
    59    for which we still want to do the relocation at runtime.  True if we
    60    are willing to perform this relocation while building the .o file.
    61    This is only used for pcrel relocations, so GOTOFF does not need to be
    62    checked here.  I am not sure if some of the others are ever used with
    63    pcrel, but it is easier to be safe than sorry.  */
    64 
    65 #define TC_RELOC_RTSYM_LOC_FIXUP(FIX)                           \
    66   ((FIX)->fx_r_type != BFD_RELOC_386_PLT32                      \
    67    && (FIX)->fx_r_type != BFD_RELOC_386_GOT32                   \
    68    && (FIX)->fx_r_type != BFD_RELOC_386_GOTPC                   \
    69    && ((FIX)->fx_addsy == NULL                                  \
    70        || (! S_IS_EXTERNAL ((FIX)->fx_addsy)                    \
    71            && ! S_IS_WEAK ((FIX)->fx_addsy)                     \
    72            && S_IS_DEFINED ((FIX)->fx_addsy)                    \
    73            && ! S_IS_COMMON ((FIX)->fx_addsy))))
    74 
    7537#define TARGET_ARCH             bfd_arch_i386
    7638#define TARGET_MACH             (i386_mach ())
     
    10062#ifndef AOUT_TARGET_FORMAT
    10163#define AOUT_TARGET_FORMAT      "a.out-i386"
     64#endif
     65
     66#ifdef TE_FreeBSD
     67#define ELF_TARGET_FORMAT       "elf32-i386-freebsd"
     68#endif
     69#ifndef ELF_TARGET_FORMAT
     70#define ELF_TARGET_FORMAT       "elf32-i386"
    10271#endif
    10372
     
    10877#else
    10978#ifdef OBJ_ELF
    110 #define TARGET_FORMAT           "elf32-i386"
     79#define TARGET_FORMAT           ELF_TARGET_FORMAT
    11180#endif
    11281#ifdef OBJ_AOUT
     
    11483#endif
    11584#endif
     85
     86#if (defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF))
     87#define md_end i386_elf_emit_arch_note
     88extern void i386_elf_emit_arch_note PARAMS ((void));
     89#endif
     90
     91#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0
    11692
    11793#else /* ! BFD_ASSEMBLER */
     
    12399#define COFF_FLAGS F_AR32WR
    124100#define TC_COUNT_RELOC(x) ((x)->fx_addsy || (x)->fx_r_type==7)
    125 #define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype(fixP)
     101#define TC_COFF_FIX2RTYPE(FIX) tc_coff_fix2rtype(FIX)
    126102extern short tc_coff_fix2rtype PARAMS ((struct fix *));
    127 #define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep(frag)
     103#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep (frag)
    128104extern int tc_coff_sizemachdep PARAMS ((fragS *frag));
    129105
    130106#ifdef TE_GO32
    131107/* DJGPP now expects some sections to be 2**4 aligned.  */
    132 #define SUB_SEGMENT_ALIGN(SEG                                        \
     108#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN)                                 \
    133109  ((strcmp (obj_segment_name (SEG), ".text") == 0                       \
    134110    || strcmp (obj_segment_name (SEG), ".data") == 0                    \
     
    140116   : 2)
    141117#else
    142 #define SUB_SEGMENT_ALIGN(SEG) 2
    143 #endif
    144 
    145 #define TC_RVA_RELOC 7
    146 /* Need this for PIC relocations */
    147 #define NEED_FX_R_TYPE
     118#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 2
     119#endif
    148120
    149121#ifdef TE_386BSD
     
    155127#endif
    156128
    157 #undef REVERSE_SORT_RELOCS
    158 
    159 #endif /* ! BFD_ASSEMBLER */
    160 
    161 #ifndef LEX_AT
    162 #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) x86_cons (EXP, NBYTES)
    163 extern void x86_cons PARAMS ((expressionS *, int));
    164 
    165 #define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) x86_cons_fix_new(FRAG, OFF, LEN, EXP)
    166 extern void x86_cons_fix_new
    167   PARAMS ((fragS *, unsigned int, unsigned int, expressionS *));
    168 #endif
    169 
    170 #define TC_FORCE_RELOCATION(fixp) tc_i386_force_relocation(fixp)
    171 extern int tc_i386_force_relocation PARAMS ((struct fix *));
    172 
    173 #ifdef BFD_ASSEMBLER
    174 #define NO_RELOC BFD_RELOC_NONE
    175 #else
    176 #define NO_RELOC 0
    177 #endif
    178 #define tc_coff_symbol_emit_hook(a)     ;       /* not used */
    179 
    180 #ifndef BFD_ASSEMBLER
    181129#ifndef OBJ_AOUT
    182130#ifndef TE_PE
     
    188136#endif
    189137#endif
    190 #endif
    191 
    192 #define LOCAL_LABELS_FB 1
    193138
    194139#define tc_aout_pre_write_hook(x)       {;}     /* not used */
    195140#define tc_crawl_symbol_chain(a)        {;}     /* not used */
    196141#define tc_headers_hook(a)              {;}     /* not used */
     142#define tc_coff_symbol_emit_hook(a)     {;}     /* not used */
     143
     144#endif /* ! BFD_ASSEMBLER */
     145
     146#define LOCAL_LABELS_FB 1
    197147
    198148extern const char extra_symbol_chars[];
     
    297247#define CpuSSE2        0x2000   /* Streaming SIMD extensions 2 required */
    298248#define Cpu3dnow       0x4000   /* 3dnow! support required */
    299 #define CpuUnknown     0x8000   /* The CPU is unknown,  be on the safe side.  */
    300249
    301250  /* These flags are set by gas depending on the flag_code.  */
     
    467416
    468417/* x86-64 extension prefix.  */
    469 typedef struct
    470   {
    471     unsigned int mode64;
    472     unsigned int extX;          /* Used to extend modrm reg field.  */
    473     unsigned int extY;          /* Used to extend SIB index field.  */
    474     unsigned int extZ;          /* Used to extend modrm reg/mem, SIB base, modrm base fields.  */
    475     unsigned int empty;         /* Used to old-style byte registers to new style.  */
    476   }
    477 rex_byte;
     418typedef int rex_byte;
     419#define REX_OPCODE      0x40
     420
     421/* Indicates 64 bit operand size.  */
     422#define REX_MODE64      8
     423/* High extension to reg field of modrm byte.  */
     424#define REX_EXTX        4
     425/* High extension to SIB index field.  */
     426#define REX_EXTY        2
     427/* High extension to base field of modrm or SIB, or reg field of opcode.  */
     428#define REX_EXTZ        1
    478429
    479430/* 386 opcode byte to code indirect addressing.  */
     
    500451#endif
    501452
     453#ifndef LEX_AT
     454#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) x86_cons (EXP, NBYTES)
     455extern void x86_cons PARAMS ((expressionS *, int));
     456
     457#define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) x86_cons_fix_new(FRAG, OFF, LEN, EXP)
     458extern void x86_cons_fix_new
     459  PARAMS ((fragS *, unsigned int, unsigned int, expressionS *));
     460#endif
     461
     462#define DIFF_EXPR_OK    /* foo-. gets turned into PC relative relocs */
     463
    502464#ifdef BFD_ASSEMBLER
     465#define NO_RELOC BFD_RELOC_NONE
     466
    503467void i386_validate_fix PARAMS ((struct fix *));
    504 #define TC_VALIDATE_FIX(FIXP,SEGTYPE,SKIP) i386_validate_fix(FIXP)
    505 #endif
    506 
    507 #endif /* TC_I386 */
     468#define TC_VALIDATE_FIX(FIX,SEGTYPE,SKIP) i386_validate_fix(FIX)
     469
     470#define tc_fix_adjustable(X)  tc_i386_fix_adjustable(X)
     471extern int tc_i386_fix_adjustable PARAMS ((struct fix *));
     472
     473/* Values passed to md_apply_fix3 don't include the symbol value.  */
     474#define MD_APPLY_SYM_VALUE(FIX) 0
     475
     476/* ELF wants external syms kept, as does PE COFF.  */
     477#if defined (TE_PE) && defined (STRICT_PE_FORMAT)
     478#define EXTERN_FORCE_RELOC                              \
     479  (OUTPUT_FLAVOR == bfd_target_elf_flavour              \
     480   || OUTPUT_FLAVOR == bfd_target_coff_flavour)
     481#else
     482#define EXTERN_FORCE_RELOC                              \
     483  (OUTPUT_FLAVOR == bfd_target_elf_flavour)
     484#endif
     485
     486/* This expression evaluates to true if the relocation is for a local
     487   object for which we still want to do the relocation at runtime.
     488   False if we are willing to perform this relocation while building
     489   the .o file.  GOTOFF does not need to be checked here because it is
     490   not pcrel.  I am not sure if some of the others are ever used with
     491   pcrel, but it is easier to be safe than sorry.  */
     492
     493#define TC_FORCE_RELOCATION_LOCAL(FIX)                  \
     494  (!(FIX)->fx_pcrel                                     \
     495   || (FIX)->fx_plt                                     \
     496   || (FIX)->fx_r_type == BFD_RELOC_386_PLT32           \
     497   || (FIX)->fx_r_type == BFD_RELOC_386_GOT32           \
     498   || (FIX)->fx_r_type == BFD_RELOC_386_GOTPC           \
     499   || TC_FORCE_RELOCATION (FIX))
     500
     501#else /* ! BFD_ASSEMBLER */
     502
     503#define NO_RELOC 0
     504
     505#define TC_RVA_RELOC 7
     506
     507/* Need this for PIC relocations */
     508#define NEED_FX_R_TYPE
     509
     510#undef REVERSE_SORT_RELOCS
     511
     512/* For COFF.  */
     513#define TC_FORCE_RELOCATION(FIX)                        \
     514  ((FIX)->fx_r_type == 7 || generic_force_reloc (FIX))
     515#endif /* ! BFD_ASSEMBLER */
    508516
    509517#define md_operand(x)
     
    531539                           - fragP->fr_fix));
    532540
    533 /* call md_apply_fix3 with segment instead of md_apply_fix */
    534 #define MD_APPLY_FIX3
    535 
    536541void i386_print_statistics PARAMS ((FILE *));
    537542#define tc_print_statistics i386_print_statistics
     
    544549#endif
    545550
    546 #define DIFF_EXPR_OK    /* foo-. gets turned into PC relative relocs */
     551#endif /* TC_I386 */
Note: See TracChangeset for help on using the changeset viewer.