Changeset 618 for trunk/src/binutils/gas/config/tc-i386.h
- Timestamp:
- Aug 16, 2003, 11:33:53 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/binutils/gas/config/tc-i386.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r617 r618 1 1 /* tc-i386.h -- Header file for tc-i386.c 2 2 Copyright 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 3 2001 3 2001, 2002, 2003 4 4 Free Software Foundation, Inc. 5 5 … … 35 35 36 36 #ifdef BFD_ASSEMBLER 37 /* This is used to determine relocation types in tc-i386.c. The first38 parameter is the current relocation type, the second one is the desired39 type. The idea is that if the original type is already some kind of PIC40 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 if47 tc_fix_adjustable() says it is not adjustable.48 The "! symbol_used_in_reloc_p" test is there specifically to cover49 the case of non-global symbols in linkonce sections. It's the50 generally correct thing to do though; If a reloc is going to be51 emitted against a symbol then we don't want to adjust the fixup by52 applying the reloc during assembly. The reloc will be applied by53 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 #endif57 58 /* This expression evaluates to false if the relocation is for a local object59 for which we still want to do the relocation at runtime. True if we60 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 be62 checked here. I am not sure if some of the others are ever used with63 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 75 37 #define TARGET_ARCH bfd_arch_i386 76 38 #define TARGET_MACH (i386_mach ()) … … 100 62 #ifndef AOUT_TARGET_FORMAT 101 63 #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" 102 71 #endif 103 72 … … 108 77 #else 109 78 #ifdef OBJ_ELF 110 #define TARGET_FORMAT "elf32-i386"79 #define TARGET_FORMAT ELF_TARGET_FORMAT 111 80 #endif 112 81 #ifdef OBJ_AOUT … … 114 83 #endif 115 84 #endif 85 86 #if (defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF)) 87 #define md_end i386_elf_emit_arch_note 88 extern void i386_elf_emit_arch_note PARAMS ((void)); 89 #endif 90 91 #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0 116 92 117 93 #else /* ! BFD_ASSEMBLER */ … … 123 99 #define COFF_FLAGS F_AR32WR 124 100 #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) 126 102 extern 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) 128 104 extern int tc_coff_sizemachdep PARAMS ((fragS *frag)); 129 105 130 106 #ifdef TE_GO32 131 107 /* DJGPP now expects some sections to be 2**4 aligned. */ 132 #define SUB_SEGMENT_ALIGN(SEG )\108 #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \ 133 109 ((strcmp (obj_segment_name (SEG), ".text") == 0 \ 134 110 || strcmp (obj_segment_name (SEG), ".data") == 0 \ … … 140 116 : 2) 141 117 #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 148 120 149 121 #ifdef TE_386BSD … … 155 127 #endif 156 128 157 #undef REVERSE_SORT_RELOCS158 159 #endif /* ! BFD_ASSEMBLER */160 161 #ifndef LEX_AT162 #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_new167 PARAMS ((fragS *, unsigned int, unsigned int, expressionS *));168 #endif169 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_ASSEMBLER174 #define NO_RELOC BFD_RELOC_NONE175 #else176 #define NO_RELOC 0177 #endif178 #define tc_coff_symbol_emit_hook(a) ; /* not used */179 180 #ifndef BFD_ASSEMBLER181 129 #ifndef OBJ_AOUT 182 130 #ifndef TE_PE … … 188 136 #endif 189 137 #endif 190 #endif191 192 #define LOCAL_LABELS_FB 1193 138 194 139 #define tc_aout_pre_write_hook(x) {;} /* not used */ 195 140 #define tc_crawl_symbol_chain(a) {;} /* not used */ 196 141 #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 197 147 198 148 extern const char extra_symbol_chars[]; … … 297 247 #define CpuSSE2 0x2000 /* Streaming SIMD extensions 2 required */ 298 248 #define Cpu3dnow 0x4000 /* 3dnow! support required */ 299 #define CpuUnknown 0x8000 /* The CPU is unknown, be on the safe side. */300 249 301 250 /* These flags are set by gas depending on the flag_code. */ … … 467 416 468 417 /* 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; 418 typedef 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 478 429 479 430 /* 386 opcode byte to code indirect addressing. */ … … 500 451 #endif 501 452 453 #ifndef LEX_AT 454 #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) x86_cons (EXP, NBYTES) 455 extern 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) 458 extern 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 502 464 #ifdef BFD_ASSEMBLER 465 #define NO_RELOC BFD_RELOC_NONE 466 503 467 void 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) 471 extern 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 */ 508 516 509 517 #define md_operand(x) … … 531 539 - fragP->fr_fix)); 532 540 533 /* call md_apply_fix3 with segment instead of md_apply_fix */534 #define MD_APPLY_FIX3535 536 541 void i386_print_statistics PARAMS ((FILE *)); 537 542 #define tc_print_statistics i386_print_statistics … … 544 549 #endif 545 550 546 # define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs*/551 #endif /* TC_I386 */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.