diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2001-03-23 05:27:42 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2001-03-23 05:27:42 +0000 |
commit | 08caf3f8700a59ac490d9179896b8e0c5ab1ab76 (patch) | |
tree | 9cad3eea670dad3297cf9cbb17c22bb24f0bc7d8 /gas/config/tc-cris.h | |
parent | 5300940c6834d114715e2ed30e1fc121f970fc0f (diff) | |
download | gdb-08caf3f8700a59ac490d9179896b8e0c5ab1ab76.zip gdb-08caf3f8700a59ac490d9179896b8e0c5ab1ab76.tar.gz gdb-08caf3f8700a59ac490d9179896b8e0c5ab1ab76.tar.bz2 |
* config/tc-cris.[ch]: Tweak attribution. Fix typos. PIC support.
Diffstat (limited to 'gas/config/tc-cris.h')
-rw-r--r-- | gas/config/tc-cris.h | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/gas/config/tc-cris.h b/gas/config/tc-cris.h index decb9f6..8f6d717 100644 --- a/gas/config/tc-cris.h +++ b/gas/config/tc-cris.h @@ -1,9 +1,9 @@ /* tc-cris.h -- Header file for tc-cris.c, the CRIS GAS port. - Copyright 2000 Free Software Foundation, Inc. + Copyright 2000, 2001 Free Software Foundation, Inc. Contributed by Axis Communications AB, Lund, Sweden. Originally written for GAS 1.38.1 by Mikael Asker. - Updated, BFDized and GNUified by Hans-Peter Nilsson. + Updates, BFDizing, GNUifying and ELF by Hans-Peter Nilsson. This file is part of GAS, the GNU Assembler. @@ -80,22 +80,52 @@ extern const struct relax_type md_cris_relax_table[]; #define TC_FORCE_RELOCATION(fixp) md_cris_force_relocation (fixp) extern int md_cris_force_relocation PARAMS ((struct fix *)); +#define MD_APPLY_FIX3 + +#define IS_CRIS_PIC_RELOC(X) \ + ((X) == BFD_RELOC_CRIS_16_GOT \ + || (X) == BFD_RELOC_CRIS_32_GOT \ + || (X) == BFD_RELOC_CRIS_16_GOTPLT \ + || (X) == BFD_RELOC_CRIS_32_GOTPLT \ + || (X) == BFD_RELOC_CRIS_32_GOTREL \ + || (X) == BFD_RELOC_CRIS_32_PLT_GOTREL \ + || (X) == BFD_RELOC_CRIS_32_PLT_PCREL) + + +/* FIXME: Undocumented macro. Make sure we don't resolve fixups for which + we want to emit dynamic relocations. */ + +#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) \ + /* FIXME: Set fx_plt instead of this check. */ \ + && ! IS_CRIS_PIC_RELOC ((FIX)->fx_r_type))) + /* This is really a workaround for a bug in write.c that resolves relocs for weak symbols - it should be postponed to the link stage or later. - */ + Also don't adjust fixups for global symbols for ELF. */ #define tc_fix_adjustable(X) \ - ((! (X)->fx_addsy || ! S_IS_WEAK((X)->fx_addsy)) \ + (((X)->fx_addsy == NULL \ + || (! S_IS_WEAK ((X)->fx_addsy) \ + && ! (OUTPUT_FLAVOR == bfd_target_elf_flavour \ + && S_IS_EXTERNAL ((X)->fx_addsy)))) \ && (X)->fx_r_type != BFD_RELOC_VTABLE_INHERIT \ && (X)->fx_r_type != BFD_RELOC_VTABLE_ENTRY) /* When we have fixups against constant expressions, we get a GAS-specific section symbol at no extra charge for obscure reasons in adjust_reloc_syms. Since ELF outputs section symbols, it gladly - outputs this "*ABS*" symbol in every object. Avoid that. */ + outputs this "*ABS*" symbol in every object. Avoid that. + Also, don't emit undefined symbols (that aren't used in relocations). + They pop up when tentatively parsing register names as symbols. */ #define tc_frob_symbol(symp, punt) \ do { \ - if (OUTPUT_FLAVOR == bfd_target_elf_flavour \ - && (symp) == section_symbol (absolute_section)) \ + if ((OUTPUT_FLAVOR == bfd_target_elf_flavour \ + && (symp) == section_symbol (absolute_section)) \ + || ! S_IS_DEFINED (symp)) \ (punt) = 1; \ } while (0) |