From 8dfef67da3712459940bd6ca4ca9b80603b54051 Mon Sep 17 00:00:00 2001 From: amodra Date: Sun, 27 May 2001 11:57:24 +0000 Subject: [PATCH] * config/tc-m68k.c (md_assemble): Ensure variable part of frag is allocated in the same chunk as the fixed part. --- gas/ChangeLog | 5 +++++ gas/config/tc-m68k.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index ebc5b4a070..8564e7fdae 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2001-05-27 Alan Modra + + * config/tc-m68k.c (md_assemble): Ensure variable part of frag is + allocated in the same chunk as the fixed part. + 2001-05-26 Alan Modra * write.c (relax_segment ): Calculate growth using diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index 842510f957..62382ecbb7 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -3664,6 +3664,21 @@ md_assemble (str) } /* There's some frag hacking */ + { + /* Calculate the max frag size. */ + int wid; + + wid = 2 * the_ins.fragb[0].fragoff; + for (n = 1; n < the_ins.nfrag; n++) + wid += 2 * (the_ins.numo - the_ins.fragb[n - 1].fragoff); + /* frag_var part. */ + wid += 10; + /* Make sure the whole insn fits in one chunk, in particular that + the var part is attached, as we access one byte before the + variable frag for byte branches. */ + frag_grow (wid); + } + for (n = 0, fromP = &the_ins.opcode[0]; n < the_ins.nfrag; n++) { int wid; -- 2.11.0