X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gas%2Fconfig%2Ftc-i960.h;h=47015ce778d27357fe8749f281ab1f38a62f128f;hb=97f50151221de0a023a8317559b1992a90f9cb8f;hp=2746edeeb232f317450ad7c72f589b36cb218e73;hpb=d0352a18a504a4e7b761f6b3264cf11347d8d056;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/config/tc-i960.h b/gas/config/tc-i960.h index 2746edeeb2..47015ce778 100644 --- a/gas/config/tc-i960.h +++ b/gas/config/tc-i960.h @@ -1,12 +1,11 @@ /* tc-i960.h - Basic 80960 instruction formats. - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 - Free Software Foundation, Inc. + Copyright (C) 1989-2016 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. GAS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2, + published by the Free Software Foundation; either version 3, or (at your option) any later version. GAS is distributed in the hope that it will be useful, but @@ -16,8 +15,8 @@ You should have received a copy of the GNU General Public License along with GAS; see the file COPYING. If not, write to the Free - Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ #ifndef TC_I960 #define TC_I960 1 @@ -51,23 +50,12 @@ */ /* tailor gas */ -#define SYMBOLS_NEED_BACKPOINTERS #define LOCAL_LABELS_FB 1 #define BITFIELD_CONS_EXPRESSIONS /* tailor the coff format */ -#define BFD_ARCH bfd_arch_i960 -#define COFF_FLAGS F_AR32WR #define COFF_MAGIC I960ROMAGIC -#define OBJ_COFF_SECTION_HEADER_HAS_ALIGNMENT #define OBJ_COFF_MAX_AUXENTRIES (2) -#define TC_COUNT_RELOC(FIXP) (!(FIXP)->fx_done) -#define TC_COFF_FIX2RTYPE(FIXP) tc_coff_fix2rtype(FIXP) -#define TC_COFF_SIZEMACHDEP(FRAGP) tc_coff_sizemachdep(FRAGP) -#define TC_COFF_SET_MACHINE(HDRS) tc_headers_hook (HDRS) -extern void tc_headers_hook (); -extern short tc_coff_fix2rtype (); -extern int tc_coff_sizemachdep (); /* MEANING OF 'n_other' in the symbol record. * @@ -101,7 +89,7 @@ extern int tc_coff_sizemachdep (); #define N_CALLNAME ((char)-1) #define N_BALNAME ((char)-2) -/* i960 uses a custom relocation record. */ +/* i960 uses a custom relocation record. */ /* let obj-aout.h know */ #define CUSTOM_RELOC_FORMAT 1 @@ -127,53 +115,61 @@ struct relocation_info nuthin:1; /* Unused */ }; +/* No shared lib support, so we don't need to ensure externally + visible symbols can be overridden. */ +#define EXTERN_FORCE_RELOC 0 + +/* Makes no sense to use the difference of 2 arbitrary symbols + as the target of a call instruction. */ +#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \ + ((FIX)->fx_tcbit \ + || ! SEG_NORMAL (SEG) \ + || TC_FORCE_RELOCATION (FIX)) + +/* reloc_callj() may replace a 'call' with a 'calls' or a + 'bal', in which cases it modifies *fixP as appropriate. + In the case of a 'calls', no further work is required. */ +extern int reloc_callj (struct fix *); + +#define TC_FORCE_RELOCATION_ABS(FIX) \ + (TC_FORCE_RELOCATION (FIX) \ + || reloc_callj (FIX)) + +#define TC_FORCE_RELOCATION_LOCAL(FIX) \ + (!(FIX)->fx_pcrel \ + || TC_FORCE_RELOCATION (FIX) \ + || reloc_callj (FIX)) + #ifdef OBJ_COFF /* We store the bal information in the sy_tc field. */ #define TC_SYMFIELD_TYPE symbolS * -#define TC_ADJUST_RELOC_COUNT(FIXP,COUNT) \ - { fixS *tcfixp = (FIXP); \ - for (;tcfixp;tcfixp=tcfixp->fx_next) \ - if (tcfixp->fx_tcbit && tcfixp->fx_addsy != 0) \ - ++(COUNT); \ - } #endif -extern int i960_validate_fix PARAMS ((struct fix *, segT, symbolS **)); -#define TC_VALIDATE_FIX(FIXP,SEGTYPE,LABEL) \ - if (i960_validate_fix (FIXP, SEGTYPE, &add_symbolP) != 0) goto LABEL +extern int i960_validate_fix (struct fix *, segT); +#define TC_VALIDATE_FIX(FIX,SEGTYPE,LABEL) \ + if (!i960_validate_fix (FIX, SEGTYPE)) goto LABEL -#ifdef OBJ_ELF -#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ - ((FIX)->fx_addsy == NULL \ - || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && S_IS_DEFINED ((FIX)->fx_addsy) \ - && ! S_IS_COMMON ((FIX)->fx_addsy))) -#endif +#define tc_fix_adjustable(FIX) ((FIX)->fx_bsr == 0) #ifndef OBJ_ELF -#define tc_fix_adjustable(FIXP) ((FIXP)->fx_bsr == 0) +/* Values passed to md_apply_fix sometimes include symbol values. */ +#define MD_APPLY_SYM_VALUE(FIX) tc_fix_adjustable (FIX) #else -#define tc_fix_adjustable(FIXP) \ - ((FIXP)->fx_bsr == 0 \ - && ! S_IS_EXTERNAL ((FIXP)->fx_addsy) \ - && ! S_IS_WEAK ((FIXP)->fx_addsy)) +/* Values passed to md_apply_fix don't include the symbol value. */ +#define MD_APPLY_SYM_VALUE(FIX) 0 #endif -extern void brtab_emit PARAMS ((void)); +extern void brtab_emit (void); #define md_end() brtab_emit () -extern void reloc_callj (); +extern void tc_set_bal_of_call (symbolS *, symbolS *); -extern void tc_set_bal_of_call PARAMS ((symbolS *, symbolS *)); +extern struct symbol *tc_get_bal_of_call (symbolS *); -extern struct symbol *tc_get_bal_of_call PARAMS ((symbolS *)); - -extern void i960_handle_align (); +extern void i960_handle_align (struct frag *); #define HANDLE_ALIGN(FRAG) i960_handle_align (FRAG) -#define NEED_FX_R_TYPE #define NO_RELOC -1 #define md_operand(x) @@ -188,5 +184,3 @@ extern const struct relax_type md_relax_table[]; #define TC_INIT_FIX_DATA(F) ((F)->tc_fix_data.bsr = 0) #endif - -/* end of tc-i960.h */