Thu Jan 30 12:08:40 1997 Ian Lance Taylor <ian@cygnus.com>
+ * config/tc-mips.c (mips_fix_adjustable): New function.
+ * config/tc-mips.h (tc_fix_adjustable): Call mips_fix_adjustable.
+ (mips_fix_adjustable): Declare.
+
Ideas from Srinivas Addagarla <srinivas@cdotd.ernet.in>:
* read.c (read_a_source_file): After doing an mri_pending_align,
adjust the line_label if there is one.
return RELAX_NEW (fragp->fr_subtype) - RELAX_OLD (fragp->fr_subtype);
}
+/* This is called to see whether a reloc against a defined symbol
+ should be converted into a reloc against a section. Don't adjust
+ MIPS16 jump relocations, so we don't have to worry about the format
+ of the offset in the .o file. Don't adjust relocations against
+ externally visible mips16 symbols, so that the linker can find them
+ if it needs to set up a stub. */
+
+int
+mips_fix_adjustable (fixp)
+ fixS *fixp;
+{
+ if (fixp->fx_r_type == BFD_RELOC_MIPS16_JMP)
+ return 0;
+ if (fixp->fx_addsy == NULL)
+ return 1;
+ if (! S_IS_EXTERNAL (fixp->fx_addsy)
+ && ! S_IS_WEAK (fixp->fx_addsy))
+ return 1;
+#ifdef S_GET_OTHER
+ if (OUTPUT_FLAVOR == bfd_target_elf_flavour
+ && S_GET_OTHER (fixp->fx_addsy) == STO_MIPS16)
+ return 0;
+#endif
+ return 1;
+}
+
/* Translate internal representation of relocation info to BFD target
format. */
/* tc-mips.h -- header file for tc-mips.c.
- Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
Contributed by the OSF and Ralph Campbell.
Written by Keith Knowles and Ralph Campbell, working independently.
Modified for ECOFF support by Ian Lance Taylor of Cygnus Support.
embedded PIC code. */
#define DIFF_EXPR_OK
-#define LITTLE_ENDIAN 1234
-#define BIG_ENDIAN 4321
-
/* Default to big endian. */
#ifndef TARGET_BYTES_LITTLE_ENDIAN
#undef TARGET_BYTES_BIG_ENDIAN
#define tc_frob_file() mips_frob_file ()
extern void mips_frob_file PARAMS ((void));
-#ifdef OBJ_ELF
+#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
#define tc_frob_file_after_relocs mips_frob_file_after_relocs
extern void mips_frob_file_after_relocs PARAMS ((void));
#endif
#define TC_CONS_FIX_NEW cons_fix_new_mips
extern void cons_fix_new_mips ();
-/* Don't adjust MIPS16 jump relocations to section addresses, so we
- don't have to worry about the format of the offset in the .o file. */
-#define tc_fix_adjustable(fixp) ((fixp)->fx_r_type != BFD_RELOC_MIPS16_JMP)
+#define tc_fix_adjustable(fixp) mips_fix_adjustable (fixp)
+extern int mips_fix_adjustable PARAMS ((struct fix *));
/* When generating embedded PIC code we must keep PC relative
relocations. */
extern unsigned long mips_gprmask;
extern unsigned long mips_cprmask[4];
-#ifdef OBJ_ELF
+#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
#define elf_tc_final_processing mips_elf_final_processing
extern void mips_elf_final_processing PARAMS ((void));
extern void mips_enable_auto_align PARAMS ((void));
#define md_elf_section_change_hook() mips_enable_auto_align()
-extern void mips_init_after_args PARAMS ((void));
-#define tc_init_after_args mips_init_after_args
-
#endif /* TC_MIPS */