* config/tc-mn10300.c: (md_apply_fix): New function.
(mn10300_force_relocation): New function.
(mn10300_fix_adjustable): New function.
* config/tc-mn10300.h: (TC_FORCE_RELOCATION): Define.
(TC_HANDLES_FX_DONE): Define.
(obj_fix_adjustable): Define.
(MD_APPLY_FIX3): Define.
(TC_LINKRELAX_FIXUP): Define.
* write.c: (TC_LINKRELAX_FIXUP): Define if not
previously defined.
(fixup_segment): Use TC_LINKRELAX_FIXUP.
* doc/internals.texi: Document TC_LINKRELAX_FIXUP.
+2000-08-22 Eric Christopher <echristo@cygnus.com>
+
+ * config/tc-mn10300.c: (md_apply_fix): New function.
+ (mn10300_force_relocation): New function.
+ (mn10300_fix_adjustable): New function.
+
+ * config/tc-mn10300.h: (TC_FORCE_RELOCATION): Define.
+ (TC_HANDLES_FX_DONE): Define.
+ (obj_fix_adjustable): Define.
+ (MD_APPLY_FIX3): Define.
+ (TC_LINKRELAX_FIXUP): Define.
+
+ * write.c: (TC_LINKRELAX_FIXUP): Define if not
+ previously defined.
+ (fixup_segment): Use TC_LINKRELAX_FIXUP.
+
+ * doc/internals.texi: Document TC_LINKRELAX_FIXUP.
+
2000-08-21 Jason Eckhardt <jle@cygnus.com>
* config/tc-i860.c (md_apply_fix3): Do not insert the immediate
(find): Accept 68hc12 register indirect modes.
* NEWS: Mention 68HC11 & 68HC12 support.
-
+
2000-08-07 Richard Henderson <rth@cygnus.com>
* config/tc-ia64.c (unwind): Add prologue_mask member.
* doc/c-m68k.texi (section M680x0 Options): Turn into a table
index by command line option.
-
+
2000-08-01 Michael Sokolov <msokolov@ivan.Harhan.ORG>
* doc/c-m68k.texi (@cindex @samp{--pcrel}): Rewrite option description.
emit absolute jumps for anything with --pcrel.
* doc/c-m68k.texi: Document new command line option.
-
+
2000-07-28 Jason Eckhardt <jle@cygnus.com>
* configure.in: Add bits for i860-stardent-{sysv4, elf}*.
* po/POTFILES.in, po/gas.pot: Regenerate.
2000-07-20 Kazu Hirata <kazu@hxi.com>
-
+
* read.c: Fix formatting.
* write.c: Fix formatting.
2000-07-08 Ulf Carlsson <ulfc@engr.sgi.com>
* doc/internals.texi (Expressions): Fix typo.
-
+
2000-07-08 Kazu Hirata <kazu@hxi.com>
* config/tc-sh.c: Fix formatting.
test for Link Once sections as in adjust_reloc_syms.
* config/te-tmips.h: New file for traditional mips targets. Define
TE_TMIPS.
-
+
2000-06-29 Mark Elbrecht <snowball3@bigfoot.com>
* config/obj-coff.c (obj_coff_setcion) [BFD_ASSEMBLER]: If the
2000-06-27 Nick Clifton <nickc@cygnus.com>
* config/tc-d30v.c (write_2_short): Do not allow opcodes with
- the EITHER_BUT_PREFER_MU attribute to be combined into a reverse
+ the EITHER_BUT_PREFER_MU attribute to be combined into a reverse
sequential order, and emit warning messages if the input source
code contains constructs like that, or parallel constructs
containing such opcodes.
(md_apply_fix3): ditto
2000-06-24 Frank Ch. Eigler <fche@redhat.com>
-
+
* cgen.c (expr_jmp_buf_p): New validity flag for expr_jmp_buf.
(gas_cgen_parse_operand): Set it around expression() call.
(gas_cgen_md_operand): Test for it before longjmp().
valueT *valuep;
segT seg;
{
- /* We shouldn't ever get here because linkrelax is nonzero. */
- abort ();
+
+ valueT value = *valuep;
+ char *fixpos = fixp->fx_where + fixp->fx_frag->fr_literal;
+ int size = 0;
+
+ assert (fixp->fx_r_type < BFD_RELOC_UNUSED);
+
+ /* This should never happen. */
+ if (seg->flags & SEC_ALLOC)
+ abort ();
+
+ /* If the fix is relative to a symbol which is not defined, or not
+ in the same segment as the fix, we cannot resolve it here. */
+ if (fixp->fx_addsy != NULL
+ && (! S_IS_DEFINED (fixp->fx_addsy)
+ || (S_GET_SEGMENT (fixp->fx_addsy) != seg)))
+ {
+ fixp->fx_done = 0;
+ return 0;
+ }
+
+ switch (fixp->fx_r_type)
+ {
+ case BFD_RELOC_8:
+ size = 1;
+ break;
+
+ case BFD_RELOC_16:
+ size = 2;
+ break;
+
+ case BFD_RELOC_32:
+ size = 4;
+ break;
+
+ case BFD_RELOC_VTABLE_INHERIT:
+ case BFD_RELOC_VTABLE_ENTRY:
+ fixp->fx_done = 0;
+ return 1;
+
+ case BFD_RELOC_NONE:
+ default:
+ as_bad_where (fixp->fx_file, fixp->fx_line,
+ _("Bad relocation fixup type (%d)"), fixp->fx_r_type);
+ }
+
+ md_number_to_chars (fixpos, fixp->fx_offset, size);
+
fixp->fx_done = 1;
return 0;
+
+}
+
+/* Return nonzero if the fixup in FIXP will require a relocation,
+ even it if appears that the fixup could be completely handled
+ within GAS. */
+
+int
+mn10300_force_relocation (fixp)
+ struct fix *fixp;
+{
+ if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
+ || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
+ return 1;
+
+ return 0;
+}
+
+/* Return zero if the fixup in fixp should be left alone and not
+ adjusted. */
+
+boolean
+mn10300_fix_adjustable (fixp)
+ struct fix *fixp;
+{
+ /* Prevent all adjustments to global symbols. */
+ if (S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy))
+ return 0;
+
+ if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
+ || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
+ return 0;
+
+ return 1;
}
/* Insert an operand value into an instruction. */
#define TARGET_FORMAT "elf32-mn10300"
-#define MD_APPLY_FIX3
+/* For fixup and relocation handling. */
+#define TC_FORCE_RELOCATION(fixp) mn10300_force_relocation (fixp)
+extern int mn10300_force_relocation PARAMS ((struct fix *));
+
+#define TC_HANDLES_FX_DONE
+
+#define obj_fix_adjustable(fixP) mn10300_fix_adjustable (fixP)
+extern boolean mn10300_fix_adjustable PARAMS ((struct fix *));
+
+#define MD_APPLY_FIX3 md_apply_fix3
+
+/* Fixup debug sections since we will never relax them. */
+#define TC_LINKRELAX_FIXUP(seg) (seg->flags & SEC_ALLOC)
+
+
#define md_operand(x)
/* Permit temporary numeric labels. */
have this type.
@item rs_leb128
-This state is used to implement the DWARF ``little endian base 128''
+This state is used to implement the DWARF ``little endian base 128''
variable length number format. The @code{fr_symbol} is always an expression
symbol, as constant expressions are emitted directly. The @code{fr_offset}
field is used during relaxation to hold the previous size of the number so
@item NUMBERS_WITH_SUFFIX
@cindex NUMBERS_WITH_SUFFIX
When this macro is defined to be non-zero, the parser allows the radix of a
-constant to be indicated with a suffix. Valid suffixes are binary (B),
+constant to be indicated with a suffix. Valid suffixes are binary (B),
octal (Q), and hexadecimal (H). Case is not significant.
@item SINGLE_QUOTE_STRINGS
@item TC_START_LABEL_WITHOUT_COLON
@cindex TC_START_LABEL_WITHOUT_COLON
Same as TC_START_LABEL, but should be used instead of TC_START_LABEL when
-LABELS_WITHOUT_COLONS is defined.
+LABELS_WITHOUT_COLONS is defined.
@item NO_PSEUDO_DOT
@cindex NO_PSEUDO_DOT
@samp{.align} directive will cause extra space to be allocated. The linker can
then discard this space when relaxing the section.
+@item TC_LINKRELAX_FIXUP ($var{segT})
+@cindex TC_LINKRELAX_FIXUP
+If defined, this macro allows control over whether fixups for a
+given section will be processed when the @var{linkrelax} variable is
+set. The macro is given the N_TYPE bits for the section in its
+@var{segT} argument. If the macro evaluates to a non-zero value
+then the fixups will be converted into relocs, otherwise they will
+be passed to @var{md_apply_fix3} as normal.
+
@item md_convert_frag
@cindex md_convert_frag
GAS will call this for each rs_machine_dependent fragment.
@cindex md_macro_start
If defined, GAS will call this macro when it starts to include a macro
expansion. @code{macro_nest} indicates the current macro nesting level, which
-includes the one being expanded.
+includes the one being expanded.
@item md_macro_info
@cindex md_macro_info
@item md_macro_end
@cindex md_macro_end
Complement to md_macro_start. If defined, it is called when finished
-processing an inserted macro expansion, just before decrementing macro_nest.
+processing an inserted macro expansion, just before decrementing macro_nest.
@item DOUBLEBAR_PARALLEL
@cindex DOUBLEBAR_PARALLEL
#define TC_FORCE_RELOCATION_SECTION(FIXP,SEG) TC_FORCE_RELOCATION(FIXP)
#endif
+#ifndef TC_LINKRELAX_FIXUP
+#define TC_LINKRELAX_FIXUP(SEG) 1
+#endif
+
#ifndef MD_PCREL_FROM_SECTION
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from(FIXP)
#endif
the difference expression cannot immediately be reduced. */
{
symbolS *stmp = make_expr_symbol (exp);
-
+
exp->X_op = O_symbol;
exp->X_op_symbol = 0;
exp->X_add_symbol = stmp;
exp->X_add_number = 0;
-
+
return fix_new_exp (frag, where, size, exp, pcrel, r_type);
}
/* Join the 2 segments into 1 huge segment.
To do this, re-compute every rn_address in the SEG_DATA frags.
Then join the data frags after the text frags.
-
+
Determine a_data [length of data segment]. */
if (data_frag_root)
{
#ifndef BFD_ASSEMBLER
/* Crawl the symbol chain.
-
+
For each symbol whose value depends on a frag, take the address of
that frag and subsume it into the value of the symbol.
After this, there is just one way to lookup a symbol value.
We adjust the values of 'L' local symbols, even if we do
not intend to emit them to the object file, because their values
are needed for fix-ups.
-
+
Unless we saw a -L flag, remove all symbols that begin with 'L'
from the symbol chain. (They are still pointed to by the fixes.)
-
+
Count the remaining symbols.
Assign a symbol number to each symbol.
Count the number of string-table chars we will emit.
/* Now we have a segment, not a crowd of sub-segments, we can make
fr_address values.
-
+
Relax the frags.
-
+
After this, all frags in this segment have addresses that are correct
within the segment. Since segments live in different file addresses,
these frag addresses may not be the same as final object-file
do
{
stretch = stretched = 0;
-
+
for (fragP = segment_frag_root; fragP; fragP = fragP->fr_next)
{
long growth = 0;
i960 (the only machine for which we've got a relaxing linker right now),
we might be able to turn callx/callj into bal anyways in cases where we
know the maximum displacement. */
- if (linkrelax)
+ if (linkrelax && TC_LINKRELAX_FIXUP (this_segment_type))
{
for (; fixP; fixP = fixP->fx_next)
seg_reloc_count++;