[PATCH] m68000 ELF + two m68k gas fixes
Alan Modra
amodra@bigpond.net.au
Sun Jan 6 05:10:00 GMT 2002
On Thu, Dec 27, 2001 at 11:49:38PM +0100, Andreas Schwab wrote:
>
> FWIW, this is broken since revision 1.11 of tc-m68k.c, where the
> relaxation was redesigned. The hardcoding in md_prepare_relax_scan should
> probably be prominently documented in the comment for md_relax_table. And
> btw, you need to check for this_step == 0 and this_step == 12 as well, as
> there are now four cases where disp == 0 provokes an error in
> tc-m68k.c:md_convert_frag_1.
I'm applying the following to fix this problem.
gas/ChangeLog
* config/tc-m68k.h (md_prepare_relax_scan): Rewrite.
* config/tc-m68k.c (md_relax_table): Add md_prepare_relax_scan comment.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
Index: gas/config/tc-m68k.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68k.c,v
retrieving revision 1.35
diff -u -p -r1.35 tc-m68k.c
--- tc-m68k.c 2002/01/02 17:19:07 1.35
+++ tc-m68k.c 2002/01/06 12:08:38
@@ -471,7 +471,8 @@ static const int n_archs = sizeof (archs
How far Backward this mode will reach:
How many bytes this mode will add to the size of the frag
Which mode to go to if the offset won't fit in this one
- */
+
+ Please check tc-m68k.h:md_prepare_relax_scan if changing this table. */
relax_typeS md_relax_table[] =
{
{ 127, -128, 0, TAB (BRANCHBWL, SHORT) },
Index: gas/config/tc-m68k.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-m68k.h,v
retrieving revision 1.10
diff -u -p -r1.10 tc-m68k.h
--- tc-m68k.h 2001/07/18 10:25:58 1.10
+++ tc-m68k.h 2002/01/06 12:08:38
@@ -227,11 +227,14 @@ extern int m68k_parse_long_option PARAMS
extern struct relax_type md_relax_table[];
#define TC_GENERIC_RELAX_TABLE md_relax_table
-/* Copied from write.c */
-/* This was formerly called M68K_AIM_KLUDGE. */
+/* We can't do a byte jump to the next instruction, so in that case
+ force word mode by faking AIM. */
#define md_prepare_relax_scan(fragP, address, aim, this_state, this_type) \
- if (aim==0 && this_state== 4) { /* hard encoded from tc-m68k.c */ \
- aim=this_type->rlx_forward+1; /* Force relaxation into word mode */ \
- }
+ do \
+ { \
+ if (aim == 0 && this_type->rlx_forward == 127) \
+ aim = 128; \
+ } \
+ while (0)
#define DWARF2_LINE_MIN_INSN_LENGTH 2
More information about the Binutils
mailing list